BeRTOS
ser_xmega.h
Go to the documentation of this file.
00001 
00044 #ifndef DRV_SER_XMEGA_H
00045 #define DRV_SER_XMEGA_H
00046 
00047 #include <cfg/macros.h>   /* BV() */
00048 #include <cfg/compiler.h> /* uint8_t */
00049 
00050 typedef uint8_t serstatus_t;
00051 
00052 /* Software errors */
00053 #define SERRF_RXFIFOOVERRUN  BV(0)  
00054 #define SERRF_RXTIMEOUT      BV(5)  
00055 #define SERRF_TXTIMEOUT      BV(6)  
00057 /*
00058 * Hardware errors.
00059 * These flags map directly to the AVR XMEGA UART Status Register.
00060 */
00061 #define SERRF_RXSROVERRUN    BV(3)  
00062 #define SERRF_FRAMEERROR     BV(4)  
00063 #define SERRF_PARITYERROR    BV(2)  
00064 #define SERRF_NOISEERROR     0      
00066 /*
00067  * \name Serial hw numbers
00068  *
00069  * \{
00070  */
00071 enum
00072 {
00073     SER_UART0,
00074     SER_UART1,
00075 #ifdef CPU_AVR_XMEGA_A
00076     //the XMEGA A Family have 5 USART ports
00077     SER_UART2,
00078     SER_UART3,
00079     SER_UART4,
00080 #endif
00081     SER_CNT  
00082 };
00083 /*\}*/
00084 
00085 #endif /* DRV_SER_XMEGA_H */