OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [isoinfra/] [v2_0/] [include/] [termios.h] - Blame information for rev 582

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

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

powered by: WebSVN 2.1.0

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