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

4.104.114.84.95
Last change on this file since 5a23ca84 was 08311cc3, checked in by Joel Sherrill <joel.sherrill@…>, on 11/17/99 at 17:51:34

Updated copyright notice.

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