00001 /* 00002 FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd. 00003 00004 *************************************************************************** 00005 * * 00006 * If you are: * 00007 * * 00008 * + New to FreeRTOS, * 00009 * + Wanting to learn FreeRTOS or multitasking in general quickly * 00010 * + Looking for basic training, * 00011 * + Wanting to improve your FreeRTOS skills and productivity * 00012 * * 00013 * then take a look at the FreeRTOS eBook * 00014 * * 00015 * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * 00016 * http://www.FreeRTOS.org/Documentation * 00017 * * 00018 * A pdf reference manual is also available. Both are usually delivered * 00019 * to your inbox within 20 minutes to two hours when purchased between 8am * 00020 * and 8pm GMT (although please allow up to 24 hours in case of * 00021 * exceptional circumstances). Thank you for your support! * 00022 * * 00023 *************************************************************************** 00024 00025 This file is part of the FreeRTOS distribution. 00026 00027 FreeRTOS is free software; you can redistribute it and/or modify it under 00028 the terms of the GNU General Public License (version 2) as published by the 00029 Free Software Foundation AND MODIFIED BY the FreeRTOS exception. 00030 ***NOTE*** The exception to the GPL is included to allow you to distribute 00031 a combined work that includes FreeRTOS without being obliged to provide the 00032 source code for proprietary components outside of the FreeRTOS kernel. 00033 FreeRTOS is distributed in the hope that it will be useful, but WITHOUT 00034 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00035 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 00036 more details. You should have received a copy of the GNU General Public 00037 License and the FreeRTOS license exception along with FreeRTOS; if not it 00038 can be viewed here: http://www.freertos.org/a00114.html and also obtained 00039 by writing to Richard Barry, contact details for whom are available on the 00040 FreeRTOS WEB site. 00041 00042 1 tab == 4 spaces! 00043 00044 http://www.FreeRTOS.org - Documentation, latest information, license and 00045 contact details. 00046 00047 http://www.SafeRTOS.com - A version that is certified for use in safety 00048 critical systems. 00049 00050 http://www.OpenRTOS.com - Commercial support, development, porting, 00051 licensing and training services. 00052 */ 00053 00054 #ifndef SERIAL_COMMS_H 00055 #define SERIAL_COMMS_H 00056 00057 typedef void * xComPortHandle; 00058 00059 typedef enum 00060 { 00061 serCOM1, 00062 serCOM2, 00063 serCOM3, 00064 serCOM4, 00065 serCOM5, 00066 serCOM6, 00067 serCOM7, 00068 serCOM8 00069 } eCOMPort; 00070 00071 typedef enum 00072 { 00073 serNO_PARITY, 00074 serODD_PARITY, 00075 serEVEN_PARITY, 00076 serMARK_PARITY, 00077 serSPACE_PARITY 00078 } eParity; 00079 00080 typedef enum 00081 { 00082 serSTOP_1, 00083 serSTOP_2 00084 } eStopBits; 00085 00086 typedef enum 00087 { 00088 serBITS_5, 00089 serBITS_6, 00090 serBITS_7, 00091 serBITS_8 00092 } eDataBits; 00093 00094 typedef enum 00095 { 00096 ser50, 00097 ser75, 00098 ser110, 00099 ser134, 00100 ser150, 00101 ser200, 00102 ser300, 00103 ser600, 00104 ser1200, 00105 ser1800, 00106 ser2400, 00107 ser4800, 00108 ser9600, 00109 ser19200, 00110 ser38400, 00111 ser57600, 00112 ser115200 00113 } eBaud; 00114 00115 xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned portBASE_TYPE uxQueueLength ); 00116 xComPortHandle xSerialPortInit( eCOMPort ePort, eBaud eWantedBaud, eParity eWantedParity, eDataBits eWantedDataBits, eStopBits eWantedStopBits, unsigned portBASE_TYPE uxBufferLength ); 00117 void vSerialPutString( xComPortHandle pxPort, const signed char * const pcString, unsigned short usStringLength ); 00118 signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime ); 00119 signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime ); 00120 portBASE_TYPE xSerialWaitForSemaphore( xComPortHandle xPort ); 00121 void vSerialClose( xComPortHandle xPort ); 00122 00123 #endif 00124