source: trunk/libs/newlib/src/libgloss/pa/w89k-io.c @ 444

Last change on this file since 444 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 1.6 KB
Line 
1/* w89k-io.c -- I/O code for the Winbond Cougar board.
2 *
3 * Copyright (c) 1995 Cygnus Support
4 *
5 * The authors hereby grant permission to use, copy, modify, distribute,
6 * and license this software and its documentation for any purpose, provided
7 * that existing copyright notices are retained in all copies and that this
8 * notice is included verbatim in any distributions. No written agreement,
9 * license, or royalty fee is required for any of the authorized uses.
10 * Modifications to this software may be copyrighted by their authors
11 * and need not follow the licensing terms described here, provided that
12 * the new terms are clearly indicated on the first page of each file where
13 * they apply.
14 */
15#include "w89k.h"
16
17void zylons();
18void led_putnum();
19void delay();
20
21/*
22 * outbyte -- shove a byte out the serial port. We wait till the byte
23 */
24void
25outbyte (byte)
26     unsigned char byte;
27{
28  while ((inp(COM1_LSR) & TRANSMIT) == 0x0) ;
29
30  outp (COM1_DATA, byte);
31
32  return;
33}
34
35/*
36 * inbyte -- get a byte from the serial port
37 */
38unsigned char
39inbyte ()
40{
41  while ((inp(COM1_LSR) & RECEIVE) == 0x0) ;
42
43  return (inp(COM1_DATA));
44}
45
46/*
47 * led_putnum -- print a hex number on the LED. the value of num must be a byte.
48 *               The max number 15, since the front panel only has 4 LEDs.
49 */
50void
51led_putnum ( num )
52char num;
53{
54  print ("Sorry, no LED's on the WinBond W89k board, using putnum instead\r\n");
55  putnum (num);
56}
57
58/*
59 * zylons -- draw a rotating pattern. NOTE: this function never returns.
60 */
61void
62zylons()
63{
64  print ("Sorry, no LED's on the WinBond W89k board\r\n");
65}
66
67void
68delay (x)
69     int x;
70{
71  int  y = 17;
72  while (x-- !=0)
73    y = y^2;
74}
Note: See TracBrowser for help on using the repository browser.