From: asterix Date: Fri, 26 Oct 2007 10:42:10 +0000 (+0000) Subject: Add specific hardware definition for arm. X-Git-Tag: 1.0.0~305 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=19a56005e6f7b6c58499b7faf413cc3442e2011b;p=bertos.git Add specific hardware definition for arm. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@937 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/cpu/arm/drv/ser_arm.h b/cpu/arm/drv/ser_arm.h new file mode 100644 index 00000000..d3abfea6 --- /dev/null +++ b/cpu/arm/drv/ser_arm.h @@ -0,0 +1,47 @@ +/** + * \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 + +#if CPU_ARM_AT91 + #include "ser_at91.h" +/*#elif Add other ARM families here */ +#else + #error Unknown CPU +#endif diff --git a/cpu/arm/drv/ser_at91.h b/cpu/arm/drv/ser_at91.h new file mode 100644 index 00000000..e784a8ab --- /dev/null +++ b/cpu/arm/drv/ser_at91.h @@ -0,0 +1,79 @@ +/** + * \file + * + * + * \brief High level serial I/O API + * + * \version $Id: ser.h 19505 2007-10-19 10:18:35Z asterix $ + * \author Daniele Basile + */ + +#ifndef SER_AT91_H +#define SER_AT91_H + +#include /* BV() */ +#include /* uint32_t */ + +/** \name Serial Error/status flags. */ +/*\{*/ +typedef uint32_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 ARM USART Channel Status Register (US_CSR). + */ +#define SERRF_RXSROVERRUN BV(5) /**< Rx shift register overrun */ +#define SERRF_FRAMEERROR BV(6) /**< Stop bit missing */ +#define SERRF_PARITYERROR BV(7) /**< Parity error */ +#define SERRF_NOISEERROR 0 /**< Unsupported */ +/*\}*/ + +/** + * \name Serial hw numbers + * + * \{ + */ +enum +{ +SER_UART0, +SER_UART1, +SER_SPI, +SER_CNT /**< Number of serial ports */ +}; +/*\}*/ + +#endif /* SER_AT91_H */