From 28b5d3be3a4fa44246db263306bda7ae99f3f238 Mon Sep 17 00:00:00 2001 From: asterix Date: Fri, 26 Oct 2007 13:05:44 +0000 Subject: [PATCH] Specific hardware denfine. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@938 38d2e660-2303-0410-9eaa-f027e97ec537 --- cpu/avr/drv/ser_avr.h | 79 +++++++++++++++++++++++++++++++++++++ cpu/dsp56k/drv/ser_dsp56k.h | 72 +++++++++++++++++++++++++++++++++ 2 files changed, 151 insertions(+) create mode 100644 cpu/avr/drv/ser_avr.h create mode 100644 cpu/dsp56k/drv/ser_dsp56k.h diff --git a/cpu/avr/drv/ser_avr.h b/cpu/avr/drv/ser_avr.h new file mode 100644 index 00000000..4cf17064 --- /dev/null +++ b/cpu/avr/drv/ser_avr.h @@ -0,0 +1,79 @@ +/** + * \file + * + * + * \version $Id: timer_arm.h 18273 2007-10-11 14:53:02Z batt $ + * + * \author Daniele Basile + * + * \brief Low-level serial module for ARM (interface). + */ + +#include /* BV() */ +#include /* uint32_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 UART Status Register (USR). +*/ +#define SERRF_RXSROVERRUN BV(3) /**< Rx shift register overrun */ +#define SERRF_FRAMEERROR BV(4) /**< Stop bit missing */ +#define SERRF_PARITYERROR BV(7) /**< Parity error */ +#define SERRF_NOISEERROR 0 /**< Unsupported */ + + +/** + * \name Serial hw numbers + * + * \{ + */ +enum +{ +#if CPU_AVR_ATMEGA64 || CPU_AVR_ATMEGA128 || CPU_AVR_ATMEGA1281 + SER_UART0, + SER_UART1, + SER_SPI, +#elif CPU_AVR_ATMEGA103 || CPU_AVR_ATMEGA8 + SER_UART0, + SER_SPI, +#else + #error unknown architecture +#endif + SER_CNT /**< Number of serial ports */ +}; +/*\}*/ diff --git a/cpu/dsp56k/drv/ser_dsp56k.h b/cpu/dsp56k/drv/ser_dsp56k.h new file mode 100644 index 00000000..d035df67 --- /dev/null +++ b/cpu/dsp56k/drv/ser_dsp56k.h @@ -0,0 +1,72 @@ +/** + * \file + * + * + * \version $Id: timer_arm.h 18273 2007-10-11 14:53:02Z batt $ + * + * \author Daniele Basile + * + * \brief Low-level serial module for ARM (interface). + */ + +#include /* BV() */ +#include /* uint32_t */ + +typedef uint16_t serstatus_t; + +/* Software errors */ +#define SERRF_RXFIFOOVERRUN BV(0) /**< Rx FIFO buffer overrun */ +#define SERRF_RXTIMEOUT BV(1) /**< Receive timeout */ +#define SERRF_TXTIMEOUT BV(2) /**< Transmit timeout */ + +/* + * Hardware errors. + * These flags map directly to the SCI Control Register. + */ +#define SERRF_PARITYERROR BV(8) /**< Parity error */ +#define SERRF_FRAMEERROR BV(9) /**< Stop bit missing */ +#define SERRF_NOISEERROR BV(10) /**< Noise error */ +#define SERRF_RXSROVERRUN BV(11) /**< Rx shift register overrun */ + +/** + * \name Serial hw numbers + * + * \{ + */ +enum +{ +// \todo since we now support "fake" multiplexed serials, this should be moved to hw.h +SER_UART0, +SER_PUNTALI, +SER_BARCODE, +SER_CNT /**< Number of serial ports */ +}; +/*\}*/ -- 2.25.1