wdenk | 012771d | 2002-03-08 21:31:05 +0000 | [diff] [blame] | 1 | /* serial.h - mostly useful for DUART serial_init in serial.c */ |
| 2 | |
| 3 | #ifndef __SERIAL_H__ |
| 4 | #define __SERIAL_H__ |
| 5 | |
| 6 | #if 0 |
| 7 | |
| 8 | #define B230400 1 |
| 9 | #define B115200 2 |
| 10 | #define B57600 4 |
| 11 | #define B38400 82 |
| 12 | #define B19200 163 |
| 13 | #define B9600 24 |
| 14 | #define B4800 651 |
| 15 | #define B2400 1302 |
| 16 | #define B1200 2604 |
| 17 | #define B600 5208 |
| 18 | #define B300 10417 |
| 19 | #define B150 20833 |
| 20 | #define B110 28409 |
| 21 | #define BDEFAULT B115200 |
| 22 | |
| 23 | /* this stuff is important to initialize |
| 24 | the DUART channels */ |
| 25 | |
| 26 | #define Scale 0x01L /* distance between port addresses */ |
| 27 | #define COM1 0x000003f8 /* Keyboard */ |
| 28 | #define COM2 0x000002f8 /* Host */ |
| 29 | |
| 30 | |
| 31 | /* Port Definitions relative to base COM port addresses */ |
| 32 | #define DataIn (0x00*Scale) /* data input port */ |
| 33 | #define DataOut (0x00*Scale) /* data output port */ |
| 34 | #define BaudLsb (0x00*Scale) /* baud rate divisor least significant byte */ |
| 35 | #define BaudMsb (0x01*Scale) /* baud rate divisor most significant byte */ |
| 36 | #define Ier (0x01*Scale) /* interrupt enable register */ |
| 37 | #define Iir (0x02*Scale) /* interrupt identification register */ |
| 38 | #define Lcr (0x03*Scale) /* line control register */ |
| 39 | #define Mcr (0x04*Scale) /* modem control register */ |
| 40 | #define Lsr (0x05*Scale) /* line status register */ |
| 41 | #define Msr (0x06*Scale) /* modem status register */ |
| 42 | |
| 43 | /* Bit Definitions for above ports */ |
| 44 | #define LcrDlab 0x80 /* b7: enable baud rate divisor registers */ |
| 45 | #define LcrDflt 0x03 /* b6-0: no parity, 1 stop, 8 data */ |
| 46 | |
| 47 | #define McrRts 0x02 /* b1: request to send (I am ready to xmit) */ |
| 48 | #define McrDtr 0x01 /* b0: data terminal ready (I am alive ready to rcv) */ |
| 49 | #define McrDflt (McrRts|McrDtr) |
| 50 | |
| 51 | #define LsrTxD 0x6000 /* b5: transmit holding register empty (i.e. xmit OK!)*/ |
| 52 | /* b6: transmitter empty */ |
| 53 | #define LsrRxD 0x0100 /* b0: received data ready (i.e. got a byte!) */ |
| 54 | |
| 55 | #define MsrRi 0x0040 /* b6: ring indicator (other guy is ready to rcv) */ |
| 56 | #define MsrDsr 0x0020 /* b5: data set ready (other guy is alive ready to rcv */ |
| 57 | #define MsrCts 0x0010 /* b4: clear to send (other guy is ready to rcv) */ |
| 58 | |
| 59 | #define IerRda 0xf /* b0: Enable received data available interrupt */ |
| 60 | |
| 61 | #endif |
| 62 | |
| 63 | #endif /* __SERIAL_H__ */ |