ser_avr.h

Go to the documentation of this file.
00001 
00040 #ifndef DRV_SER_AVR_H
00041 #define DRV_SER_AVR_H
00042 
00043 #include <cfg/macros.h> /* BV() */
00044 #include <cfg/compiler.h>  /* uint32_t */
00045 
00046 typedef uint8_t serstatus_t;
00047 
00048 /* Software errors */
00049 #define SERRF_RXFIFOOVERRUN  BV(0)  
00050 #define SERRF_RXTIMEOUT      BV(5)  
00051 #define SERRF_TXTIMEOUT      BV(6)  
00053 /*
00054 * Hardware errors.
00055 * These flags map directly to the AVR UART Status Register (USR).
00056 */
00057 #define SERRF_RXSROVERRUN    BV(3)  
00058 #define SERRF_FRAMEERROR     BV(4)  
00059 #define SERRF_PARITYERROR    BV(7)  
00060 #define SERRF_NOISEERROR     0      
00068 enum
00069 {
00070 #if  CPU_AVR_ATMEGA64 || CPU_AVR_ATMEGA128 || CPU_AVR_ATMEGA1281
00071     SER_UART0,
00072     SER_UART1,
00073     SER_SPI,
00074 #elif CPU_AVR_ATMEGA103 || CPU_AVR_ATMEGA8
00075     SER_UART0,
00076     SER_SPI,
00077 #else
00078     #error unknown architecture
00079 #endif
00080     SER_CNT  
00081 };
00082 /*\}*/
00083 
00084 #endif /* DRV_SER_AVR_H */