diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-02-06 22:07:17 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-02-06 22:07:17 +0000 |
commit | d5f443f74d551831ef4f93c043f70b53d9b1008b (patch) | |
tree | 599b517e171ed7258776d3960ac6e3908855a1aa /ports/ARM7-LPC214x | |
parent | 35b0454ddb7ac3b9a7b4142c7c04be4570a29798 (diff) | |
download | ChibiOS-d5f443f74d551831ef4f93c043f70b53d9b1008b.tar.gz ChibiOS-d5f443f74d551831ef4f93c043f70b53d9b1008b.tar.bz2 ChibiOS-d5f443f74d551831ef4f93c043f70b53d9b1008b.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@732 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'ports/ARM7-LPC214x')
-rw-r--r-- | ports/ARM7-LPC214x/lpc214x_serial.c | 32 | ||||
-rw-r--r-- | ports/ARM7-LPC214x/lpc214x_serial.h | 12 | ||||
-rw-r--r-- | ports/ARM7-LPC214x/lpc214x_ssp.c | 6 | ||||
-rw-r--r-- | ports/ARM7-LPC214x/lpc214x_ssp.h | 4 | ||||
-rw-r--r-- | ports/ARM7-LPC214x/vic.c | 2 | ||||
-rw-r--r-- | ports/ARM7-LPC214x/vic.h | 2 |
6 files changed, 29 insertions, 29 deletions
diff --git a/ports/ARM7-LPC214x/lpc214x_serial.c b/ports/ARM7-LPC214x/lpc214x_serial.c index 1e56739e5..f9ed67260 100644 --- a/ports/ARM7-LPC214x/lpc214x_serial.c +++ b/ports/ARM7-LPC214x/lpc214x_serial.c @@ -102,8 +102,8 @@ static void ServeInterrupt(UART *u, FullDuplexDriver *com) { break;
case IIR_SRC_TX:
{
-#if LPC214x_UART_FIFO_PRELOAD > 0
- int i = LPC214x_UART_FIFO_PRELOAD;
+#if UART_FIFO_PRELOAD > 0
+ int i = UART_FIFO_PRELOAD;
do {
chSysLockFromIsr();
msg_t b = chOQGetI(&com->sd_oqueue);
@@ -134,11 +134,11 @@ static void ServeInterrupt(UART *u, FullDuplexDriver *com) { }
}
-#if LPC214x_UART_FIFO_PRELOAD > 0
+#if UART_FIFO_PRELOAD > 0
static void preload(UART *u, FullDuplexDriver *com) {
if (u->UART_LSR & LSR_THRE) {
- int i = LPC214x_UART_FIFO_PRELOAD;
+ int i = UART_FIFO_PRELOAD;
do {
chSysLockFromIsr();
msg_t b = chOQGetI(&com->sd_oqueue);
@@ -168,7 +168,7 @@ CH_IRQ_HANDLER(UART0IrqHandler) { }
static void OutNotify1(void) {
-#if LPC214x_UART_FIFO_PRELOAD > 0
+#if UART_FIFO_PRELOAD > 0
preload(U0Base, &COM1);
#else
@@ -196,7 +196,7 @@ CH_IRQ_HANDLER(UART1IrqHandler) { }
static void OutNotify2(void) {
-#if LPC214x_UART_FIFO_PRELOAD > 0
+#if UART_FIFO_PRELOAD > 0
preload(U1Base, &COM2);
#else
@@ -218,7 +218,7 @@ static void OutNotify2(void) { * @note Must be invoked with interrupts disabled.
* @note Does not reset the I/O queues.
*/
-void lpc2148x_set_uart(UART *u, int speed, int lcr, int fcr) {
+void uart_setup(UART *u, int speed, int lcr, int fcr) {
int div = PCLK / (speed << 4);
u->UART_LCR = lcr | LCR_DLAB;
@@ -240,16 +240,16 @@ void lpc2148x_set_uart(UART *u, int speed, int lcr, int fcr) { * may have another use, enable them externally if needed.
* RX and TX pads are handled inside.
*/
-void lpc2148x_serial_init(int vector1, int vector2) {
+void serial_init(int vector1, int vector2) {
#if USE_LPC214x_UART0
SetVICVector(UART0IrqHandler, vector1, SOURCE_UART0);
PCONP = (PCONP & PCALL) | PCUART0;
chFDDInit(&COM1, ib1, sizeof ib1, NULL, ob1, sizeof ob1, OutNotify1);
- lpc2148x_set_uart(U0Base,
- LPC214x_UART_BITRATE,
- LCR_WL8 | LCR_STOP1 | LCR_NOPARITY,
- FCR_TRIGGER0);
+ uart_setup(U0Base,
+ DEFAULT_UART_BITRATE,
+ LCR_WL8 | LCR_STOP1 | LCR_NOPARITY,
+ FCR_TRIGGER0);
VICIntEnable = INTMASK(SOURCE_UART0);
#endif
@@ -257,10 +257,10 @@ void lpc2148x_serial_init(int vector1, int vector2) { SetVICVector(UART1IrqHandler, vector2, SOURCE_UART1);
PCONP = (PCONP & PCALL) | PCUART1;
chFDDInit(&COM2, ib2, sizeof ib2, NULL, ob2, sizeof ob2, OutNotify2);
- lpc2148x_set_uart(U1Base,
- LPC214x_UART_BITRATE,
- LCR_WL8 | LCR_STOP1 | LCR_NOPARITY,
- FCR_TRIGGER0);
+ uart_setup(U1Base,
+ DEFAULT_UART_BITRATE,
+ LCR_WL8 | LCR_STOP1 | LCR_NOPARITY,
+ FCR_TRIGGER0);
VICIntEnable = INTMASK(SOURCE_UART0) | INTMASK(SOURCE_UART1);
#endif
}
diff --git a/ports/ARM7-LPC214x/lpc214x_serial.h b/ports/ARM7-LPC214x/lpc214x_serial.h index fbba6a365..021dbf6a1 100644 --- a/ports/ARM7-LPC214x/lpc214x_serial.h +++ b/ports/ARM7-LPC214x/lpc214x_serial.h @@ -44,8 +44,8 @@ * @note It is possible to use @p SetUART() in order to change the working
* parameters at runtime.
*/
-#if !defined(LPC214x_UART_BITRATE) || defined(__DOXYGEN__)
-#define LPC214x_UART_BITRATE 38400
+#if !defined(DEFAULT_UART_BITRATE) || defined(__DOXYGEN__)
+#define DEFAULT_UART_BITRATE 38400
#endif
/**
@@ -60,8 +60,8 @@ * that will generate an interrupt for each output byte but is much
* smaller and simpler.
*/
-#if !defined(LPC214x_UART_FIFO_PRELOAD) || defined(__DOXYGEN__)
-#define LPC214x_UART_FIFO_PRELOAD 16
+#if !defined(UART_FIFO_PRELOAD) || defined(__DOXYGEN__)
+#define UART_FIFO_PRELOAD 16
#endif
/**
@@ -85,8 +85,8 @@ #ifdef __cplusplus
extern "C" {
#endif
- void lpc2148x_serial_init(int vector1, int vector2);
- void SetUART(UART *u, int speed, int lcr, int fcr);
+ void serial_init(int vector1, int vector2);
+ void uart_setup(UART *u, int speed, int lcr, int fcr);
CH_IRQ_HANDLER(UART0IrqHandler);
CH_IRQ_HANDLER(UART1IrqHandler);
#ifdef __cplusplus
diff --git a/ports/ARM7-LPC214x/lpc214x_ssp.c b/ports/ARM7-LPC214x/lpc214x_ssp.c index ebe29b6e7..43c4100bc 100644 --- a/ports/ARM7-LPC214x/lpc214x_ssp.c +++ b/ports/ARM7-LPC214x/lpc214x_ssp.c @@ -104,7 +104,7 @@ void sspRW(uint8_t *in, uint8_t *out, size_t n) { * @param[in] cr0 the value for the @p CR0 register
* @param[in] cr1 the value for the @p CR1 register
*/
-void lpc214x_ssp_setup(int cpsr, int cr0, int cr1) {
+void ssp_setup(int cpsr, int cr0, int cr1) {
SSP *ssp = SSPBase;
ssp->SSP_CR1 = 0;
@@ -116,13 +116,13 @@ void lpc214x_ssp_setup(int cpsr, int cr0, int cr1) { /**
* @brief SSP subsystem initialization.
*/
-void lpc214x_ssp_init(void) {
+void ssp_init(void) {
/* Enables the SPI1 clock */
PCONP = (PCONP & PCALL) | PCSPI1;
/* Clock = PCLK / 2 (fastest). */
- lpc214x_ssp_setup(2, CR0_DSS8BIT | CR0_FRFSPI | CR0_CLOCKRATE(0), 0);
+ ssp_setup(2, CR0_DSS8BIT | CR0_FRFSPI | CR0_CLOCKRATE(0), 0);
#if LPC214x_SSP_USE_MUTEX
chSemInit(&me, 1);
diff --git a/ports/ARM7-LPC214x/lpc214x_ssp.h b/ports/ARM7-LPC214x/lpc214x_ssp.h index 01e8b3a93..5f497dc5f 100644 --- a/ports/ARM7-LPC214x/lpc214x_ssp.h +++ b/ports/ARM7-LPC214x/lpc214x_ssp.h @@ -41,8 +41,8 @@ #ifdef __cplusplus
}
#endif
- void lpc214x_ssp_init(void);
- void lpc214x_ssp_setup(int cpsr, int cr0, int cr1);
+ void ssp_init(void);
+ void ssp_setup(int cpsr, int cr0, int cr1);
void sspAcquireBus(void);
void sspReleaseBus(void);
void sspRW(uint8_t *in, uint8_t *out, size_t n);
diff --git a/ports/ARM7-LPC214x/vic.c b/ports/ARM7-LPC214x/vic.c index 739a259c1..88e9814bb 100644 --- a/ports/ARM7-LPC214x/vic.c +++ b/ports/ARM7-LPC214x/vic.c @@ -32,7 +32,7 @@ * @brief VIC Initialization.
* @note Better reset everything in the VIC, it is a HUGE source of trouble.
*/
-void lpc214x_vic_init(void) {
+void vic_init(void) {
int i;
VIC *vic = VICBase;
diff --git a/ports/ARM7-LPC214x/vic.h b/ports/ARM7-LPC214x/vic.h index a219f4a32..b4b88948c 100644 --- a/ports/ARM7-LPC214x/vic.h +++ b/ports/ARM7-LPC214x/vic.h @@ -30,7 +30,7 @@ #ifdef __cplusplus
extern "C" {
#endif
- void lpc214x_vic_init(void);
+ void vic_init(void);
void SetVICVector(void *handler, int vector, int source);
#ifdef __cplusplus
}
|