Mercurial > ecos
annotate packages/io/serial/current/include/serialio.h @ 76:435cced73e2f ecos-v1_3_1-release
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
| author | jlarmour |
|---|---|
| date | Tue, 28 Mar 2000 14:10:45 +0000 |
| parents | bf00f99aec69 |
| children | 6512add4f5d6 |
| rev | line source |
|---|---|
| 2 | 1 #ifndef CYGONCE_SERIALIO_H |
| 2 #define CYGONCE_SERIALIO_H | |
| 3 // ==================================================================== | |
| 4 // | |
| 5 // serialio.h | |
| 6 // | |
| 7 // Device I/O | |
| 8 // | |
| 9 // ==================================================================== | |
| 10 //####COPYRIGHTBEGIN#### | |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
11 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
12 // ------------------------------------------- |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
13 // The contents of this file are subject to the Red Hat eCos Public License |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
14 // Version 1.1 (the "License"); you may not use this file except in |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
15 // compliance with the License. You may obtain a copy of the License at |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
16 // http://www.redhat.com/ |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
17 // |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
18 // Software distributed under the License is distributed on an "AS IS" |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
19 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
20 // License for the specific language governing rights and limitations under |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
21 // the License. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
22 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
23 // The Original Code is eCos - Embedded Configurable Operating System, |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
24 // released September 30, 1998. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
25 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
26 // The Initial Developer of the Original Code is Red Hat. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
27 // Portions created by Red Hat are |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
28 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
29 // All Rights Reserved. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
30 // ------------------------------------------- |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
31 // |
| 2 | 32 //####COPYRIGHTEND#### |
| 33 // ==================================================================== | |
| 34 //#####DESCRIPTIONBEGIN#### | |
| 35 // | |
| 36 // Author(s): gthomas | |
| 37 // Contributors: gthomas | |
| 38 // Date: 1999-02-04 | |
| 39 // Purpose: Special support for serial I/O devices | |
| 40 // Description: | |
| 41 // | |
| 42 //####DESCRIPTIONEND#### | |
| 43 // | |
| 44 // ==================================================================== | |
| 45 | |
| 46 // This file contains the user-level visible I/O interfaces | |
| 47 | |
| 48 #include <pkgconf/hal.h> | |
| 49 #include <cyg/infra/cyg_type.h> | |
| 50 #include <cyg/io/config_keys.h> | |
| 51 | |
| 52 #ifdef __cplusplus | |
| 53 extern "C" { | |
| 54 #endif | |
| 55 | |
| 56 // Supported baud rates | |
| 57 typedef enum { | |
| 58 CYGNUM_SERIAL_BAUD_50 = 1, | |
| 59 CYGNUM_SERIAL_BAUD_75, | |
| 60 CYGNUM_SERIAL_BAUD_110, | |
| 61 CYGNUM_SERIAL_BAUD_134_5, | |
| 62 CYGNUM_SERIAL_BAUD_150, | |
| 63 CYGNUM_SERIAL_BAUD_200, | |
| 64 CYGNUM_SERIAL_BAUD_300, | |
| 65 CYGNUM_SERIAL_BAUD_600, | |
| 66 CYGNUM_SERIAL_BAUD_1200, | |
| 67 CYGNUM_SERIAL_BAUD_1800, | |
| 68 CYGNUM_SERIAL_BAUD_2400, | |
| 69 CYGNUM_SERIAL_BAUD_3600, | |
| 70 CYGNUM_SERIAL_BAUD_4800, | |
| 71 CYGNUM_SERIAL_BAUD_7200, | |
| 72 CYGNUM_SERIAL_BAUD_9600, | |
| 73 CYGNUM_SERIAL_BAUD_14400, | |
| 74 CYGNUM_SERIAL_BAUD_19200, | |
| 75 CYGNUM_SERIAL_BAUD_38400, | |
| 76 CYGNUM_SERIAL_BAUD_57600, | |
| 77 CYGNUM_SERIAL_BAUD_115200, | |
|
76
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
66
diff
changeset
|
78 CYGNUM_SERIAL_BAUD_230400 |
| 2 | 79 } cyg_serial_baud_rate_t; |
| 80 #define CYGNUM_SERIAL_BAUD_MIN CYGNUM_SERIAL_BAUD_50 | |
|
76
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
66
diff
changeset
|
81 #define CYGNUM_SERIAL_BAUD_MAX CYGNUM_SERIAL_BAUD_230400 |
| 2 | 82 |
| 83 // Note: two levels of macro are required to get proper expansion. | |
| 84 #define _CYG_SERIAL_BAUD_RATE(n) CYGNUM_SERIAL_BAUD_##n | |
| 85 #define CYG_SERIAL_BAUD_RATE(n) _CYG_SERIAL_BAUD_RATE(n) | |
| 86 | |
| 87 // Stop bit selections | |
| 88 typedef enum { | |
| 89 CYGNUM_SERIAL_STOP_1 = 1, | |
| 90 CYGNUM_SERIAL_STOP_1_5, | |
| 91 CYGNUM_SERIAL_STOP_2 | |
| 92 } cyg_serial_stop_bits_t; | |
| 93 | |
| 94 // Parity modes | |
| 95 typedef enum { | |
| 96 CYGNUM_SERIAL_PARITY_NONE = 0, | |
| 97 CYGNUM_SERIAL_PARITY_EVEN, | |
| 98 CYGNUM_SERIAL_PARITY_ODD, | |
| 99 CYGNUM_SERIAL_PARITY_MARK, | |
| 100 CYGNUM_SERIAL_PARITY_SPACE | |
| 101 } cyg_serial_parity_t; | |
| 102 | |
| 103 // Word length | |
| 104 typedef enum { | |
| 105 CYGNUM_SERIAL_WORD_LENGTH_5 = 5, | |
| 106 CYGNUM_SERIAL_WORD_LENGTH_6, | |
| 107 CYGNUM_SERIAL_WORD_LENGTH_7, | |
| 108 CYGNUM_SERIAL_WORD_LENGTH_8 | |
| 109 } cyg_serial_word_length_t; | |
| 110 | |
| 111 typedef struct { | |
| 112 cyg_serial_baud_rate_t baud; | |
| 113 cyg_serial_stop_bits_t stop; | |
| 114 cyg_serial_parity_t parity; | |
| 115 cyg_serial_word_length_t word_length; | |
| 116 cyg_uint32 flags; | |
| 117 } cyg_serial_info_t; | |
| 118 | |
| 119 #define CYG_SERIAL_INFO_INIT(_baud,_stop,_parity,_word_length,_flags) \ | |
| 120 { _baud, _stop, _parity, _word_length, _flags} | |
| 121 | |
| 122 // Control flags | |
| 123 #define CYG_SERIAL_FLAGS_RTSCTS 0x0001 | |
| 124 | |
| 125 // Default configuration | |
| 126 #define CYG_SERIAL_BAUD_DEFAULT CYGNUM_SERIAL_BAUD_38400 | |
| 127 #define CYG_SERIAL_STOP_DEFAULT CYGNUM_SERIAL_STOP_1 | |
| 128 #define CYG_SERIAL_PARITY_DEFAULT CYGNUM_SERIAL_PARITY_NONE | |
| 129 #define CYG_SERIAL_WORD_LENGTH_DEFAULT CYGNUM_SERIAL_WORD_LENGTH_8 | |
| 130 #define CYG_SERIAL_FLAGS_DEFAULT 0 | |
| 131 | |
| 132 #ifdef __cplusplus | |
| 133 } | |
| 134 #endif | |
| 135 | |
| 136 #endif /* CYGONCE_SERIALIO_H */ | |
| 137 /* EOF serialio.h */ |
