pic24_serial.h

Go to the documentation of this file.
00001 /*
00002  * "Copyright (c) 2008 Robert B. Reese, Bryan A. Jones, J. W. Bruce ("AUTHORS")"
00003  * All rights reserved.
00004  * (R. Reese, reese_AT_ece.msstate.edu, Mississippi State University)
00005  * (B. A. Jones, bjones_AT_ece.msstate.edu, Mississippi State University)
00006  * (J. W. Bruce, jwbruce_AT_ece.msstate.edu, Mississippi State University)
00007  *
00008  * Permission to use, copy, modify, and distribute this software and its
00009  * documentation for any purpose, without fee, and without written agreement is
00010  * hereby granted, provided that the above copyright notice, the following
00011  * two paragraphs and the authors appear in all copies of this software.
00012  *
00013  * IN NO EVENT SHALL THE "AUTHORS" BE LIABLE TO ANY PARTY FOR
00014  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
00015  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE "AUTHORS"
00016  * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00017  *
00018  * THE "AUTHORS" SPECIFICALLY DISCLAIMS ANY WARRANTIES,
00019  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
00020  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
00021  * ON AN "AS IS" BASIS, AND THE "AUTHORS" HAS NO OBLIGATION TO
00022  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
00023  *
00024  * Please maintain this header in its entirety when copying/modifying
00025  * these files.
00026  *
00027  *
00028  */
00029 
00030 
00031 // Documentation for this file. If the \file tag isn't present,
00032 // this file won't be documented.
00041 #ifndef _PIC24_SERIAL_H_
00042 #define _PIC24_SERIAL_H_
00043 
00052 #define SERIAL_EOL_CR_LF 0
00053 
00057 #define SERIAL_EOL_CR   1
00058 
00064 #define SERIAL_EOL_LF   2
00065 
00071 #ifndef SERIAL_EOL_DEFAULT   //can be overridden in project file
00072 #define SERIAL_EOL_DEFAULT SERIAL_EOL_LF
00073 #endif
00074 
00075 #if (SERIAL_EOL_DEFAULT != SERIAL_EOL_CR_LF) && \
00076         (SERIAL_EOL_DEFAULT != SERIAL_EOL_CR)    && \
00077     (SERIAL_EOL_DEFAULT != SERIAL_EOL_LF)
00078 #error Invalid choice for SERIAL_EOF_DEFAULT
00079 #endif
00080 
00082 
00087 #ifndef DEFAULT_UART
00088 #define DEFAULT_UART 1
00089 #endif
00090 #if (DEFAULT_UART > NUM_UART_MODS) || (DEFAULT_UART < 1)
00091 #error Invalid choice of DEFAULT_UART
00092 #endif
00093 
00094 
00095 uint8 inChar(void);  //blocking single character input
00096 void outString(const char* psz_s);
00097 uint16 inString (char *psz_buff, int16 u16_maxCount);
00098 uint16 inStringEcho (char *psz_buff, int16 u16_maxCount);
00099 void outChar(uint8 u8_c);
00100 void outUint8NoLeader (uint8 u8_x);
00101 void outUint8 (uint8 u8_x);
00102 void outUint16(uint16 u16_x);
00103 void outUint32(uint32 u32_x);
00104 void outUint8Decimal(uint8 u8_x);
00105 void outUint16Decimal(uint16 u16_x);
00106 uint8 isCharReady(void); //determine if character is available to be read
00107 
00108 uint8 inCharEcho(void);
00109 void configDefaultUART(uint32 u32_baudRate);
00110 
00111 #endif

Generated on Mon Oct 18 07:40:47 2010 for Python-on-a-chip by  doxygen 1.5.9