1 |
/* |
---|
2 |
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd. |
---|
3 |
|
---|
4 |
This file is part of the FreeRTOS distribution. |
---|
5 |
|
---|
6 |
FreeRTOS is free software; you can redistribute it and/or modify it under |
---|
7 |
the terms of the GNU General Public License (version 2) as published by the |
---|
8 |
Free Software Foundation and modified by the FreeRTOS exception. |
---|
9 |
**NOTE** The exception to the GPL is included to allow you to distribute a |
---|
10 |
combined work that includes FreeRTOS without being obliged to provide the |
---|
11 |
source code for proprietary components outside of the FreeRTOS kernel. |
---|
12 |
Alternative commercial license and support terms are also available upon |
---|
13 |
request. See the licensing section of http://www.FreeRTOS.org for full |
---|
14 |
license details. |
---|
15 |
|
---|
16 |
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT |
---|
17 |
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
18 |
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
---|
19 |
more details. |
---|
20 |
|
---|
21 |
You should have received a copy of the GNU General Public License along |
---|
22 |
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59 |
---|
23 |
Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
---|
24 |
|
---|
25 |
|
---|
26 |
*************************************************************************** |
---|
27 |
* * |
---|
28 |
* Looking for a quick start? Then check out the FreeRTOS eBook! * |
---|
29 |
* See http://www.FreeRTOS.org/Documentation for details * |
---|
30 |
* * |
---|
31 |
*************************************************************************** |
---|
32 |
|
---|
33 |
1 tab == 4 spaces! |
---|
34 |
|
---|
35 |
Please ensure to read the configuration and relevant port sections of the |
---|
36 |
online documentation. |
---|
37 |
|
---|
38 |
http://www.FreeRTOS.org - Documentation, latest information, license and |
---|
39 |
contact details. |
---|
40 |
|
---|
41 |
http://www.SafeRTOS.com - A version that is certified for use in safety |
---|
42 |
critical systems. |
---|
43 |
|
---|
44 |
http://www.OpenRTOS.com - Commercial support, development, porting, |
---|
45 |
licensing and training services. |
---|
46 |
*/ |
---|
47 |
|
---|
48 |
#ifndef SERIAL_COMMS_H |
---|
49 |
#define SERIAL_COMMS_H |
---|
50 |
|
---|
51 |
typedef void * xComPortHandle; |
---|
52 |
|
---|
53 |
typedef enum |
---|
54 |
{ |
---|
55 |
serCOM1, |
---|
56 |
serCOM2, |
---|
57 |
serCOM3, |
---|
58 |
serCOM4, |
---|
59 |
serCOM5, |
---|
60 |
serCOM6, |
---|
61 |
serCOM7, |
---|
62 |
serCOM8 |
---|
63 |
} eCOMPort; |
---|
64 |
|
---|
65 |
typedef enum |
---|
66 |
{ |
---|
67 |
serNO_PARITY, |
---|
68 |
serODD_PARITY, |
---|
69 |
serEVEN_PARITY, |
---|
70 |
serMARK_PARITY, |
---|
71 |
serSPACE_PARITY |
---|
72 |
} eParity; |
---|
73 |
|
---|
74 |
typedef enum |
---|
75 |
{ |
---|
76 |
serSTOP_1, |
---|
77 |
serSTOP_2 |
---|
78 |
} eStopBits; |
---|
79 |
|
---|
80 |
typedef enum |
---|
81 |
{ |
---|
82 |
serBITS_5, |
---|
83 |
serBITS_6, |
---|
84 |
serBITS_7, |
---|
85 |
serBITS_8 |
---|
86 |
} eDataBits; |
---|
87 |
|
---|
88 |
typedef enum |
---|
89 |
{ |
---|
90 |
ser50, |
---|
91 |
ser75, |
---|
92 |
ser110, |
---|
93 |
ser134, |
---|
94 |
ser150, |
---|
95 |
ser200, |
---|
96 |
ser300, |
---|
97 |
ser600, |
---|
98 |
ser1200, |
---|
99 |
ser1800, |
---|
100 |
ser2400, |
---|
101 |
ser4800, |
---|
102 |
ser9600, |
---|
103 |
ser19200, |
---|
104 |
ser38400, |
---|
105 |
ser57600, |
---|
106 |
ser115200 |
---|
107 |
} eBaud; |
---|
108 |
|
---|
109 |
xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength ); |
---|
110 |
xComPortHandle xSerialPortInit( eCOMPort ePort, eBaud eWantedBaud, eParity eWantedParity, eDataBits eWantedDataBits, eStopBits eWantedStopBits, unsigned portBASE_TYPE uxBufferLength ); |
---|
111 |
void vSerialPutString( xComPortHandle pxPort, const signed portCHAR * const pcString, unsigned portSHORT usStringLength ); |
---|
112 |
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcRxedChar, portTickType xBlockTime ); |
---|
113 |
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime ); |
---|
114 |
portBASE_TYPE xSerialWaitForSemaphore( xComPortHandle xPort ); |
---|
115 |
void vSerialClose( xComPortHandle xPort ); |
---|
116 |
|
---|
117 |
#endif |
---|
118 |
|
---|