source: rtems/cpukit/libcsupport/include/sys/termios.h @ e79a766f

4.115
Last change on this file since e79a766f was e79a766f, checked in by Gedare Bloom <gedare@…>, on 12/15/12 at 12:26:34

libcsupport: Update file header for termios.h to remove link, add description.

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