/** * \file * * * * \brief Low-level serial module for AVR XMEGA (interface). * * This file is heavily inspired by the AVR implementation for BeRTOS, * but uses a different approach for implementing the different debug * ports, by using the USART_t structs. * * \author Onno * */ #ifndef DRV_SER_XMEGA_H #define DRV_SER_XMEGA_H #include /* BV() */ #include /* uint8_t */ typedef uint8_t serstatus_t; /* Software errors */ #define SERRF_RXFIFOOVERRUN BV(0) /**< Rx FIFO buffer overrun */ #define SERRF_RXTIMEOUT BV(5) /**< Receive timeout */ #define SERRF_TXTIMEOUT BV(6) /**< Transmit timeout */ /* * Hardware errors. * These flags map directly to the AVR XMEGA UART Status Register. */ #define SERRF_RXSROVERRUN BV(3) /**< Rx shift register overrun */ #define SERRF_FRAMEERROR BV(4) /**< Stop bit missing */ #define SERRF_PARITYERROR BV(2) /**< Parity error */ #define SERRF_NOISEERROR 0 /**< Unsupported */ /* * \name Serial hw numbers * * \{ */ enum { SER_UART0, SER_UART1, #ifdef CPU_AVR_XMEGA_A //the XMEGA A Family have 5 USART ports SER_UART2, SER_UART3, SER_UART4, #endif SER_CNT /**< Number of serial ports */ }; /*\}*/ #endif /* DRV_SER_XMEGA_H */