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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [isoinfra/] [current/] [include/] [termios.h] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
#ifndef CYGONCE_ISO_TERMIOS_H
2
#define CYGONCE_ISO_TERMIOS_H
3
/* ====================================================================
4
//
5
//      termios.h
6
//
7
//      POSIX termios
8
//
9
// ====================================================================
10
// ####ECOSGPLCOPYRIGHTBEGIN####
11
// -------------------------------------------
12
// This file is part of eCos, the Embedded Configurable Operating System.
13
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
14
//
15
// eCos is free software; you can redistribute it and/or modify it under
16
// the terms of the GNU General Public License as published by the Free
17
// Software Foundation; either version 2 or (at your option) any later
18
// version.
19
//
20
// eCos is distributed in the hope that it will be useful, but WITHOUT
21
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
23
// for more details.
24
//
25
// You should have received a copy of the GNU General Public License
26
// along with eCos; if not, write to the Free Software Foundation, Inc.,
27
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
28
//
29
// As a special exception, if other files instantiate templates or use
30
// macros or inline functions from this file, or you compile this file
31
// and link it with other works to produce a work based on this file,
32
// this file does not by itself cause the resulting work to be covered by
33
// the GNU General Public License. However the source code for this file
34
// must still be made available in accordance with section (3) of the GNU
35
// General Public License v2.
36
//
37
// This exception does not invalidate any other reasons why a work based
38
// on this file might be covered by the GNU General Public License.
39
// -------------------------------------------
40
// ####ECOSGPLCOPYRIGHTEND####
41
// ====================================================================
42
//#####DESCRIPTIONBEGIN####
43
//
44
// Author(s):    jlarmour
45
// Contributors:
46
// Date:         2000-07-22
47
// Purpose:      POSIX termios support
48
// Description:
49
//
50
//####DESCRIPTIONEND####
51
//
52
// ==================================================================*/
53
 
54
#include <pkgconf/isoinfra.h>
55
 
56
#if CYGINT_ISO_TERMIOS
57
# ifdef CYGBLD_ISO_TERMIOS_HEADER
58
#  include CYGBLD_ISO_TERMIOS_HEADER
59
# else
60
 
61
/* TYPES */
62
 
63
typedef unsigned int tcflag_t;  /* terminal flags type */
64
typedef unsigned char cc_t;     /* control chars type */
65
typedef unsigned int speed_t;   /* baud rate type */
66
 
67
#define NCCS 16    /* May as well hard-code - ASCII isn't that configurable! */
68
 
69
struct termios {
70
    tcflag_t c_iflag;    /* Input mode flags */
71
    tcflag_t c_oflag;    /* Output mode flags */
72
    tcflag_t c_cflag;    /* Control mode flags */
73
    tcflag_t c_lflag;    /* Local mode flags */
74
    cc_t c_cc[NCCS];     /* Control characters */
75
    speed_t c_ispeed;    /* input speed */
76
    speed_t c_ospeed;    /* output speed */
77
};
78
 
79
/* CONSTANTS */
80
 
81
/* Input mode flags */
82
 
83
#define BRKINT          (1<<0)
84
#define ICRNL           (1<<1)
85
#define IGNBRK          (1<<2)
86
#define IGNCR           (1<<3)
87
#define IGNPAR          (1<<4)
88
#define INLCR           (1<<5)
89
#define INPCK           (1<<6)
90
#define ISTRIP          (1<<7)
91
#define IXOFF           (1<<8)
92
#define IXON            (1<<9)
93
#define PARMRK          (1<<10)
94
 
95
/* Output mode flags */
96
 
97
#define OPOST           (1<<0)
98
#define ONLCR           (1<<1) /* Note: This isn't POSIX */
99
 
100
/* Control mode flags */
101
 
102
#define CLOCAL          (1<<0)
103
#define CREAD           (1<<1)
104
#define   CS5              (0)
105
#define   CS6           (1<<2)
106
#define   CS7           (1<<3)
107
#define   CS8           (CS6|CS7)
108
#define CSIZE           (CS8)
109
#define CSTOPB          (1<<4)
110
#define HUPCL           (1<<5)
111
#define PARENB          (1<<6)
112
#define PARODD          (1<<7)
113
#ifndef _POSIX_SOURCE_
114
# define CRTSCTS        (1<<8)
115
#endif
116
 
117
/* Local mode flags */
118
 
119
#define ECHO            (1<<0)
120
#define ECHOE           (1<<1)
121
#define ECHOK           (1<<2)
122
#define ECHONL          (1<<3)
123
#define ICANON          (1<<4)
124
#define IEXTEN          (1<<5)
125
#define ISIG            (1<<6)
126
#define NOFLSH          (1<<7)
127
#define TOSTOP          (1<<8)
128
 
129
/* Special control characters */
130
 
131
#define VEOF            0
132
#define VEOL            1
133
#define VERASE          2
134
#define VINTR           3
135
#define VKILL           4
136
#define VMIN            5
137
#define VQUIT           6
138
#define VSUSP           7
139
#define VTIME           8
140
#define VSTART          9
141
#define VSTOP           10
142
 
143
/* Baud rates */
144
/* There may be tables in the implementation that rely on the
145
 * values here, so only append to this table - do not insert values!
146
 */
147
#define B0              0
148
#define B50             1
149
#define B75             2
150
#define B110            3
151
#define B134            4
152
#define B150            5
153
#define B200            6
154
#define B300            7
155
#define B600            8
156
#define B1200           9
157
#define B1800           10
158
#define B2400           11
159
#define B3600           12
160
#define B4800           13
161
#define B7200           14
162
#define B9600           15
163
#define B14400          16
164
#define B19200          17
165
#define B38400          18
166
#define B57600          19
167
#define B115200         20
168
#define B230400         21
169
#define B460800         22
170
#define B500000         23
171
#define B576000         24
172
#define B921600         25
173
#define B1000000        26
174
#define B1152000        27
175
#define B1500000        28
176
#define B2000000        29
177
#define B2500000        30
178
#define B3000000        31
179
#define B3500000        32
180
#define B4000000        33
181
 
182
 
183
/* Optional actions to tcsetattr() */
184
 
185
#define TCSANOW         0
186
#define TCSADRAIN       1
187
#define TCSAFLUSH       2
188
 
189
/* Queue selectors for tcflush() */
190
 
191
#define TCIFLUSH        0
192
#define TCOFLUSH        1
193
#define TCIOFLUSH       2
194
 
195
/* Actions for tcflow() */
196
 
197
#define TCOOFF          0
198
#define TCOON           1
199
#define TCIOFF          2
200
#define TCION           3
201
 
202
 
203
/* FUNCTIONS */
204
 
205
#ifdef __cplusplus
206
extern "C" {
207
#endif
208
 
209
extern speed_t
210
cfgetospeed( const struct termios *__termios_p );
211
 
212
extern int
213
cfsetospeed( struct termios *__termios_p, speed_t __speed );
214
 
215
extern speed_t
216
cfgetispeed( const struct termios *__termios_p );
217
 
218
extern int
219
cfsetispeed( struct termios *__termios_p, speed_t __speed );
220
 
221
extern int
222
tcgetattr( int __fildes, struct termios *__termios_p );
223
 
224
extern int
225
tcsetattr( int __fildes, int __optact, const struct termios *__termios_p );
226
 
227
extern int
228
tcsendbreak( int __fildes, int __duration );
229
 
230
extern int
231
tcdrain( int __fildes );
232
 
233
extern int
234
tcflush( int __fildes, int __queue_sel );
235
 
236
extern int
237
tcflow( int __fildes, int __action );
238
 
239
/* tcgetpgrp() and tcsetpgrp() not included in the absence of job control */
240
 
241
#ifdef __cplusplus
242
} /* extern "C" */
243
#endif
244
 
245
# endif /* ifndef CYGBLD_ISO_TERMIOS_HEADER */
246
#endif /* if CYGINT_ISO_TERMIOS */
247
 
248
 
249
#endif /* ifndef CYGONCE_ISO_TERMIOS_H */
250
 
251
/* EOF termios.h */

powered by: WebSVN 2.1.0

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