source: rtems/c/src/lib/include/sys/termios.h @ b29378e

4.104.114.84.95
Last change on this file since b29378e was e2476ed4, checked in by Joel Sherrill <joel.sherrill@…>, on 05/22/98 at 14:49:49

Added tcdrain(), cfgetospeed(), cfsetospeed(), cfgetispeed(), and cfsetispeed().

  • Property mode set to 100644
File size: 4.0 KB
Line 
1/*
2 *  POSIX termios implementation for RTEMS console device driver.
3 *
4 *  COPYRIGHT (c) 1989-1998.
5 *  On-Line Applications Research Corporation (OAR).
6 *  Copyright assigned to U.S. Government, 1994.
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.OARcorp.com/rtems/license.html.
11 *
12 *  $Id$
13 */
14
15#ifndef TERMIOS_H
16#define TERMIOS_H
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22typedef unsigned char   cc_t;
23typedef unsigned int    speed_t;
24typedef unsigned int    tcflag_t;
25
26#define NCCS 19
27struct termios {
28        tcflag_t c_iflag;               /* input mode flags */
29        tcflag_t c_oflag;               /* output mode flags */
30        tcflag_t c_cflag;               /* control mode flags */
31        tcflag_t c_lflag;               /* local mode flags */
32        cc_t c_line;                    /* line discipline */
33        cc_t c_cc[NCCS];                /* control characters */
34};
35
36/* c_cc characters */
37#define VINTR 0
38#define VQUIT 1
39#define VERASE 2
40#define VKILL 3
41#define VEOF 4
42#define VTIME 5
43#define VMIN 6
44#define VSWTC 7
45#define VSTART 8
46#define VSTOP 9
47#define VSUSP 10
48#define VEOL 11
49#define VREPRINT 12
50#define VDISCARD 13
51#define VWERASE 14
52#define VLNEXT 15
53#define VEOL2 16
54
55/* c_iflag bits */
56#define IGNBRK  0000001
57#define BRKINT  0000002
58#define IGNPAR  0000004
59#define PARMRK  0000010
60#define INPCK   0000020
61#define ISTRIP  0000040
62#define INLCR   0000100
63#define IGNCR   0000200
64#define ICRNL   0000400
65#define IUCLC   0001000
66#define IXON    0002000
67#define IXANY   0004000
68#define IXOFF   0010000
69#define IMAXBEL 0020000
70
71/* c_oflag bits */
72#define OPOST   0000001
73#define OLCUC   0000002
74#define ONLCR   0000004
75#define OCRNL   0000010
76#define ONOCR   0000020
77#define ONLRET  0000040
78#define OFILL   0000100
79#define OFDEL   0000200
80#define NLDLY   0000400
81#define   NL0   0000000
82#define   NL1   0000400
83#define CRDLY   0003000
84#define   CR0   0000000
85#define   CR1   0001000
86#define   CR2   0002000
87#define   CR3   0003000
88#define TABDLY  0014000
89#define   TAB0  0000000
90#define   TAB1  0004000
91#define   TAB2  0010000
92#define   TAB3  0014000
93#define   XTABS 0014000
94#define BSDLY   0020000
95#define   BS0   0000000
96#define   BS1   0020000
97#define VTDLY   0040000
98#define   VT0   0000000
99#define   VT1   0040000
100#define FFDLY   0100000
101#define   FF0   0000000
102#define   FF1   0100000
103
104/* c_cflag bit meaning */
105#define CBAUD   0010017
106#define  B0     0000000         /* hang up */
107#define  B50    0000001
108#define  B75    0000002
109#define  B110   0000003
110#define  B134   0000004
111#define  B150   0000005
112#define  B200   0000006
113#define  B300   0000007
114#define  B600   0000010
115#define  B1200  0000011
116#define  B1800  0000012
117#define  B2400  0000013
118#define  B4800  0000014
119#define  B9600  0000015
120#define  B19200 0000016
121#define  B38400 0000017
122#define EXTA B19200
123#define EXTB B38400
124#define CSIZE   0000060
125#define   CS5   0000000
126#define   CS6   0000020
127#define   CS7   0000040
128#define   CS8   0000060
129#define CSTOPB  0000100
130#define CREAD   0000200
131#define PARENB  0000400
132#define PARODD  0001000
133#define HUPCL   0002000
134#define CLOCAL  0004000
135#define CBAUDEX 0010000
136#define  B57600  0010001
137#define  B115200 0010002
138#define  B230400 0010003
139#define  B460800 0010004
140#define CIBAUD    002003600000  /* input baud rate (not used) */
141#define CRTSCTS   020000000000          /* flow control */
142
143/* c_lflag bits */
144#define ISIG    0000001
145#define ICANON  0000002
146#define XCASE   0000004
147#define ECHO    0000010
148#define ECHOE   0000020
149#define ECHOK   0000040
150#define ECHONL  0000100
151#define NOFLSH  0000200
152#define TOSTOP  0000400
153#define ECHOCTL 0001000
154#define ECHOPRT 0002000
155#define ECHOKE  0004000
156#define FLUSHO  0010000
157#define PENDIN  0040000
158#define IEXTEN  0100000
159
160/* tcflow() and TCXONC use these */
161#define TCOOFF          0
162#define TCOON           1
163#define TCIOFF          2
164#define TCION           3
165
166/* tcflush() and TCFLSH use these */
167#define TCIFLUSH        0
168#define TCOFLUSH        1
169#define TCIOFLUSH       2
170
171/* tcsetattr uses these */
172#define TCSANOW         0
173#define TCSADRAIN       1
174#define TCSAFLUSH       2
175
176int     tcgetattr(int, struct termios *);
177int     tcsetattr(int, int, struct termios *);
178int     tcdrain(int);
179speed_t cfgetospeed(const struct termios *tp);
180int     cfsetospeed(struct termios *tp, speed_t speed);
181speed_t cfgetispeed(const struct termios *tp);
182int     cfsetispeed(struct termios *tp, speed_t speed);
183
184#ifdef __cplusplus
185}
186#endif
187
188#endif  /* TERMIOS_H */
Note: See TracBrowser for help on using the repository browser.