OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems/] [c/] [src/] [lib/] [include/] [sys/] [termios.h] - Blame information for rev 208

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.