1 /* Copyright (C) 1996 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
20 #define _SYS_SERIAL_H 1
21 /* Defines for PC AT serial port. */
23 /* Serial port addresses and IRQs. */
29 /* Definitions for INS8250 / 16550 chips. */
31 /* Defined as offsets from the port address (data port). */
32 #define DAT 0 /* Receive/transmit data. */
33 #define ICR 1 /* Interrupt control register. */
34 #define ISR 2 /* Interrupt status register. */
35 #define LCR 3 /* Line control register. */
36 #define MCR 4 /* Modem control register. */
37 #define LSR 5 /* Line status register. */
38 #define MSR 6 /* Modem status register. */
39 #define DLL 0 /* Divisor latch (lsb). */
40 #define DLH 1 /* Divisor latch (msb). */
44 #define RIEN 0x01 /* Enable receiver interrupt. */
45 #define TIEN 0x02 /* Enable transmitter interrupt. */
46 #define SIEN 0x04 /* Enable receiver line status interrupt. */
47 #define MIEN 0x08 /* Enable modem status interrupt. */
51 #define FFTMOUT 0x0c /* Fifo rcvr timeout. */
52 #define RSTATUS 0x06 /* Change in receiver line status. */
53 #define RxRDY 0x04 /* Receiver data available. */
54 #define TxRDY 0x02 /* Transmitter holding register empty. */
55 #define MSTATUS 0x00 /* Change in modem status. */
59 Number of data bits per received/transmitted character. */
69 /* Baud rate definitions. */
72 /* Definitions for character length (data bits) in RXLEN field. */
79 #define DTR 0x01 /* Bring up DTR. */
80 #define RTS 0x02 /* Bring up RTS. */
83 #define LOOP 0x10 /* Put chip into loopback state. */
87 #define RCA 0x01 /* Receive char available. */
88 #define OVRRUN 0x02 /* Receive overrun. */
89 #define PARERR 0x04 /* Parity error. */
90 #define FRMERR 0x08 /* Framing/CRC error. */
91 #define BRKDET 0x10 /* Break detected (null char + frame error). */
92 #define XHRE 0x20 /* Transmit holding register empty. */
93 #define XSRE 0x40 /* Transmit shift register empty. */
97 #define DCTS 0x01 /* CTS has changed state. */
98 #define DDSR 0x02 /* DSR has changed state. */
99 #define DRI 0x04 /* RI has changed state. */
100 #define DDCD 0x08 /* DCD has changed state. */
101 #define CTS 0x10 /* State of CTS. */
102 #define DSR 0x20 /* State of DSR. */
103 #define RI 0x40 /* State of RI. */
104 #define DCD 0x80 /* State of DCD. */
107 #define DELTAS(x) ((x) & (DCTS | DDSR | DRI | DDCD))
108 #define STATES(x) ((x) (CTS | DSR | RI | DCD))
110 #endif /* sys/serial.h */