aboutsummaryrefslogtreecommitdiffstats
path: root/os/io/platforms
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-08-27 16:42:07 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-08-27 16:42:07 +0000
commit8b55cb9767ce881b7a22c5af34605ed3a261582d (patch)
tree2b1e4239c2909496d83058a0a16da65525c9e70c /os/io/platforms
parentb8e618f59a5bc34aa76e2aacd6484ad217c54e33 (diff)
downloadChibiOS-8b55cb9767ce881b7a22c5af34605ed3a261582d.tar.gz
ChibiOS-8b55cb9767ce881b7a22c5af34605ed3a261582d.tar.bz2
ChibiOS-8b55cb9767ce881b7a22c5af34605ed3a261582d.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1109 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/io/platforms')
-rw-r--r--os/io/platforms/AT91SAM7X/pal_lld.h4
-rw-r--r--os/io/platforms/AT91SAM7X/serial_lld.c20
-rw-r--r--os/io/platforms/AT91SAM7X/serial_lld.h4
-rw-r--r--os/io/platforms/LPC214x/lpc214x_ssp.c4
-rw-r--r--os/io/platforms/LPC214x/pal_lld.h4
-rw-r--r--os/io/platforms/LPC214x/serial_lld.c28
-rw-r--r--os/io/platforms/LPC214x/serial_lld.h4
-rw-r--r--os/io/platforms/MSP430/pal_lld.c44
-rw-r--r--os/io/platforms/MSP430/pal_lld.h12
-rw-r--r--os/io/platforms/MSP430/serial_lld.c32
-rw-r--r--os/io/platforms/MSP430/serial_lld.h4
-rw-r--r--os/io/platforms/STM32F103/pal_lld.c42
-rw-r--r--os/io/platforms/STM32F103/pal_lld.h14
-rw-r--r--os/io/platforms/STM32F103/serial_lld.c30
-rw-r--r--os/io/platforms/STM32F103/serial_lld.h6
15 files changed, 126 insertions, 126 deletions
diff --git a/os/io/platforms/AT91SAM7X/pal_lld.h b/os/io/platforms/AT91SAM7X/pal_lld.h
index 1f50b5734..c00007fc3 100644
--- a/os/io/platforms/AT91SAM7X/pal_lld.h
+++ b/os/io/platforms/AT91SAM7X/pal_lld.h
@@ -90,12 +90,12 @@ typedef AT91PS_PIO ioportid_t;
/**
* @brief PIO port A identifier.
*/
-#define IOPORT_A AT91C_BASE_PIOA
+#define IOPORT1 AT91C_BASE_PIOA
/**
* @brief PIO port B identifier.
*/
-#define IOPORT_B AT91C_BASE_PIOB
+#define IOPORT2 AT91C_BASE_PIOB
/*===========================================================================*/
/* Implementation, some of the following macros could be implemented as */
diff --git a/os/io/platforms/AT91SAM7X/serial_lld.c b/os/io/platforms/AT91SAM7X/serial_lld.c
index e053aac13..282ebbf7a 100644
--- a/os/io/platforms/AT91SAM7X/serial_lld.c
+++ b/os/io/platforms/AT91SAM7X/serial_lld.c
@@ -31,12 +31,12 @@
#if USE_SAM7X_USART0 || defined(__DOXYGEN__)
/** @brief USART0 serial driver identifier.*/
-SerialDriver COM1;
+SerialDriver SD1;
#endif
#if USE_SAM7X_USART1 || defined(__DOXYGEN__)
/** @brief USART1 serial driver identifier.*/
-SerialDriver COM2;
+SerialDriver SD2;
#endif
/** @brief Driver default configuration.*/
@@ -165,7 +165,7 @@ CH_IRQ_HANDLER(USART0IrqHandler) {
CH_IRQ_PROLOGUE();
- serve_interrupt(AT91C_BASE_US0, &COM1);
+ serve_interrupt(AT91C_BASE_US0, &SD1);
CH_IRQ_EPILOGUE();
}
@@ -176,7 +176,7 @@ CH_IRQ_HANDLER(USART1IrqHandler) {
CH_IRQ_PROLOGUE();
- serve_interrupt(AT91C_BASE_US1, &COM2);
+ serve_interrupt(AT91C_BASE_US1, &SD2);
CH_IRQ_EPILOGUE();
}
@@ -192,7 +192,7 @@ CH_IRQ_HANDLER(USART1IrqHandler) {
void sd_lld_init(void) {
#if USE_SAM7X_USART0
- sdObjectInit(&COM1, NULL, notify1);
+ sdObjectInit(&SD1, NULL, notify1);
AT91C_BASE_PIOA->PIO_PDR = AT91C_PA0_RXD0 | AT91C_PA1_TXD0;
AT91C_BASE_PIOA->PIO_ASR = AT91C_PIO_PA0 | AT91C_PIO_PA1;
AT91C_BASE_PIOA->PIO_PPUDR = AT91C_PIO_PA0 | AT91C_PIO_PA1;
@@ -202,7 +202,7 @@ void sd_lld_init(void) {
#endif
#if USE_SAM7X_USART1
- sdObjectInit(&COM2, NULL, notify2);
+ sdObjectInit(&SD2, NULL, notify2);
AT91C_BASE_PIOA->PIO_PDR = AT91C_PA5_RXD1 | AT91C_PA6_TXD1;
AT91C_BASE_PIOA->PIO_ASR = AT91C_PIO_PA5 | AT91C_PIO_PA6;
AT91C_BASE_PIOA->PIO_PPUDR = AT91C_PIO_PA5 | AT91C_PIO_PA6;
@@ -226,7 +226,7 @@ void sd_lld_start(SerialDriver *sdp, const SerialDriverConfig *config) {
config = &default_config;
#if USE_SAM7X_USART0
- if (&COM1 == sdp) {
+ if (&SD1 == sdp) {
/* Starts the clock and clears possible sources of immediate interrupts.*/
AT91C_BASE_PMC->PMC_PCER = (1 << AT91C_ID_US0);
/* USART initialization.*/
@@ -237,7 +237,7 @@ void sd_lld_start(SerialDriver *sdp, const SerialDriverConfig *config) {
}
#endif
#if USE_SAM7X_USART1
- if (&COM2 == sdp) {
+ if (&SD2 == sdp) {
/* Starts the clock and clears possible sources of immediate interrupts.*/
AT91C_BASE_PMC->PMC_PCER = (1 << AT91C_ID_US1);
/* USART initialization.*/
@@ -259,7 +259,7 @@ void sd_lld_start(SerialDriver *sdp, const SerialDriverConfig *config) {
void sd_lld_stop(SerialDriver *sdp) {
#if USE_LPC214x_UART1
- if (&COM1 == sdp) {
+ if (&SD1 == sdp) {
usart_deinit(AT91C_BASE_US0);
AT91C_BASE_PMC->PMC_PCDR = (1 << AT91C_ID_US0);
AIC_DisableIT(AT91C_ID_US0);
@@ -267,7 +267,7 @@ void sd_lld_stop(SerialDriver *sdp) {
}
#endif
#if USE_LPC214x_UART2
- if (&COM2 == sdp) {
+ if (&SD2 == sdp) {
usart_deinit(AT91C_BASE_US1);
AT91C_BASE_PMC->PMC_PCDR = (1 << AT91C_ID_US1);
AIC_DisableIT(AT91C_ID_US1);
diff --git a/os/io/platforms/AT91SAM7X/serial_lld.h b/os/io/platforms/AT91SAM7X/serial_lld.h
index f6f704e95..639c4055d 100644
--- a/os/io/platforms/AT91SAM7X/serial_lld.h
+++ b/os/io/platforms/AT91SAM7X/serial_lld.h
@@ -139,10 +139,10 @@ typedef struct {
/** @cond never*/
#if USE_SAM7X_USART0
-extern SerialDriver COM1;
+extern SerialDriver SD1;
#endif
#if USE_SAM7X_USART1
-extern SerialDriver COM2;
+extern SerialDriver SD2;
#endif
#ifdef __cplusplus
diff --git a/os/io/platforms/LPC214x/lpc214x_ssp.c b/os/io/platforms/LPC214x/lpc214x_ssp.c
index fb7b70183..af9915395 100644
--- a/os/io/platforms/LPC214x/lpc214x_ssp.c
+++ b/os/io/platforms/LPC214x/lpc214x_ssp.c
@@ -44,7 +44,7 @@ void sspAcquireBus(void) {
#if LPC214x_SSP_USE_MUTEX
chSemWait(&me);
#endif
- palClearPad(IOPORT_A, 20);
+ palClearPad(IOPORT1, 20);
}
/**
@@ -54,7 +54,7 @@ void sspAcquireBus(void) {
*/
void sspReleaseBus(void) {
- palClearPad(IOPORT_A, 20);
+ palClearPad(IOPORT1, 20);
#if LPC214x_SSP_USE_MUTEX
chSemSignal(&me);
#endif
diff --git a/os/io/platforms/LPC214x/pal_lld.h b/os/io/platforms/LPC214x/pal_lld.h
index 50e0ff4a5..4547abc61 100644
--- a/os/io/platforms/LPC214x/pal_lld.h
+++ b/os/io/platforms/LPC214x/pal_lld.h
@@ -93,12 +93,12 @@ typedef FIO * ioportid_t;
/**
* @brief FIO port 0 identifier.
*/
-#define IOPORT_A FIO0Base
+#define IOPORT1 FIO0Base
/**
* @brief FIO port 1 identifier.
*/
-#define IOPORT_B FIO1Base
+#define IOPORT2 FIO1Base
/*===========================================================================*/
/* Implementation, some of the following macros could be implemented as */
diff --git a/os/io/platforms/LPC214x/serial_lld.c b/os/io/platforms/LPC214x/serial_lld.c
index 09884a3fe..b97d42185 100644
--- a/os/io/platforms/LPC214x/serial_lld.c
+++ b/os/io/platforms/LPC214x/serial_lld.c
@@ -32,12 +32,12 @@
#if USE_LPC214x_UART0 || defined(__DOXYGEN__)
/** @brief UART0 serial driver identifier.*/
-SerialDriver COM1;
+SerialDriver SD1;
#endif
#if USE_LPC214x_UART1 || defined(__DOXYGEN__)
/** @brief UART1 serial driver identifier.*/
-SerialDriver COM2;
+SerialDriver SD2;
#endif
/** @brief Driver default configuration.*/
@@ -199,13 +199,13 @@ static void preload(UART *u, SerialDriver *sdp) {
static void notify1(void) {
#if UART_FIFO_PRELOAD > 0
- preload(U0Base, &COM1);
+ preload(U0Base, &SD1);
#else
UART *u = U0Base;
if (u->UART_LSR & LSR_THRE) {
chSysLockFromIsr();
- u->UART_THR = chOQGetI(&COM1.sd_oqueue);
+ u->UART_THR = chOQGetI(&SD1.sd_oqueue);
chSysUnlockFromIsr();
}
u->UART_IER |= IER_THRE;
@@ -217,12 +217,12 @@ static void notify1(void) {
static void notify2(void) {
#if UART_FIFO_PRELOAD > 0
- preload(U1Base, &COM2);
+ preload(U1Base, &SD2);
#else
UART *u = U1Base;
if (u->UART_LSR & LSR_THRE)
- u->UART_THR = chOQGetI(&COM2.sd_oqueue);
+ u->UART_THR = chOQGetI(&SD2.sd_oqueue);
u->UART_IER |= IER_THRE;
#endif
}
@@ -237,7 +237,7 @@ CH_IRQ_HANDLER(UART0IrqHandler) {
CH_IRQ_PROLOGUE();
- serve_interrupt(U0Base, &COM1);
+ serve_interrupt(U0Base, &SD1);
VICVectAddr = 0;
CH_IRQ_EPILOGUE();
@@ -249,7 +249,7 @@ CH_IRQ_HANDLER(UART1IrqHandler) {
CH_IRQ_PROLOGUE();
- serve_interrupt(U1Base, &COM2);
+ serve_interrupt(U1Base, &SD2);
VICVectAddr = 0;
CH_IRQ_EPILOGUE();
@@ -267,11 +267,11 @@ CH_IRQ_HANDLER(UART1IrqHandler) {
void sd_lld_init(void) {
#if USE_LPC214x_UART0
- sdObjectInit(&COM1, NULL, notify1);
+ sdObjectInit(&SD1, NULL, notify1);
SetVICVector(UART0IrqHandler, LPC214x_UART1_PRIORITY, SOURCE_UART0);
#endif
#if USE_LPC214x_UART1
- sdObjectInit(&COM2, NULL, notify2);
+ sdObjectInit(&SD2, NULL, notify2);
SetVICVector(UART1IrqHandler, LPC214x_UART2_PRIORITY, SOURCE_UART1);
#endif
}
@@ -290,7 +290,7 @@ void sd_lld_start(SerialDriver *sdp, const SerialDriverConfig *config) {
config = &default_config;
#if USE_LPC214x_UART1
- if (&COM1 == sdp) {
+ if (&SD1 == sdp) {
PCONP = (PCONP & PCALL) | PCUART0;
uart_init(U0Base, config);
VICIntEnable = INTMASK(SOURCE_UART0);
@@ -298,7 +298,7 @@ void sd_lld_start(SerialDriver *sdp, const SerialDriverConfig *config) {
}
#endif
#if USE_LPC214x_UART2
- if (&COM2 == sdp) {
+ if (&SD2 == sdp) {
PCONP = (PCONP & PCALL) | PCUART1;
uart_init(U1Base, config);
VICIntEnable = INTMASK(SOURCE_UART1);
@@ -317,7 +317,7 @@ void sd_lld_start(SerialDriver *sdp, const SerialDriverConfig *config) {
void sd_lld_stop(SerialDriver *sdp) {
#if USE_LPC214x_UART1
- if (&COM1 == sdp) {
+ if (&SD1 == sdp) {
uart_deinit(U0Base);
PCONP = (PCONP & PCALL) & ~PCUART0;
VICIntEnClear = INTMASK(SOURCE_UART0);
@@ -325,7 +325,7 @@ void sd_lld_stop(SerialDriver *sdp) {
}
#endif
#if USE_LPC214x_UART2
- if (&COM2 == sdp) {
+ if (&SD2 == sdp) {
uart_deinit(U1Base);
PCONP = (PCONP & PCALL) & ~PCUART1;
VICIntEnClear = INTMASK(SOURCE_UART1);
diff --git a/os/io/platforms/LPC214x/serial_lld.h b/os/io/platforms/LPC214x/serial_lld.h
index b543d844c..d4bc6d01d 100644
--- a/os/io/platforms/LPC214x/serial_lld.h
+++ b/os/io/platforms/LPC214x/serial_lld.h
@@ -156,10 +156,10 @@ typedef struct {
/** @cond never*/
#if USE_LPC214x_UART0
-extern SerialDriver COM1;
+extern SerialDriver SD1;
#endif
#if USE_LPC214x_UART1
-extern SerialDriver COM2;
+extern SerialDriver SD2;
#endif
#ifdef __cplusplus
diff --git a/os/io/platforms/MSP430/pal_lld.c b/os/io/platforms/MSP430/pal_lld.c
index 885a58dbc..227853a12 100644
--- a/os/io/platforms/MSP430/pal_lld.c
+++ b/os/io/platforms/MSP430/pal_lld.c
@@ -38,43 +38,43 @@
void _pal_lld_init(const MSP430DIOConfig *config) {
#if defined(__MSP430_HAS_PORT1__) || defined(__MSP430_HAS_PORT1_R__)
- IOPORT_A->iop_full.ie.reg_p = 0;
- IOPORT_A->iop_full.ifg.reg_p = 0;
- IOPORT_A->iop_full.sel.reg_p = 0;
- IOPORT_A->iop_common.out = config->P1Data.out;
- IOPORT_A->iop_common.dir = config->P1Data.dir;
+ IOPORT1->iop_full.ie.reg_p = 0;
+ IOPORT1->iop_full.ifg.reg_p = 0;
+ IOPORT1->iop_full.sel.reg_p = 0;
+ IOPORT1->iop_common.out = config->P1Data.out;
+ IOPORT1->iop_common.dir = config->P1Data.dir;
#endif
#if defined(__MSP430_HAS_PORT2__) || defined(__MSP430_HAS_PORT2_R__)
- IOPORT_B->iop_full.ie.reg_p = 0;
- IOPORT_B->iop_full.ifg.reg_p = 0;
- IOPORT_B->iop_full.sel.reg_p = 0;
- IOPORT_B->iop_common.out = config->P2Data.out;
- IOPORT_B->iop_common.dir = config->P2Data.dir;
+ IOPORT2->iop_full.ie.reg_p = 0;
+ IOPORT2->iop_full.ifg.reg_p = 0;
+ IOPORT2->iop_full.sel.reg_p = 0;
+ IOPORT2->iop_common.out = config->P2Data.out;
+ IOPORT2->iop_common.dir = config->P2Data.dir;
#endif
#if defined(__MSP430_HAS_PORT3__) || defined(__MSP430_HAS_PORT3_R__)
- IOPORT_C->iop_simple.sel.reg_p = 0;
- IOPORT_C->iop_common.out = config->P3Data.out;
- IOPORT_C->iop_common.dir = config->P3Data.dir;
+ IOPORT3->iop_simple.sel.reg_p = 0;
+ IOPORT3->iop_common.out = config->P3Data.out;
+ IOPORT3->iop_common.dir = config->P3Data.dir;
#endif
#if defined(__MSP430_HAS_PORT4__) || defined(__MSP430_HAS_PORT4_R__)
- IOPORT_D->iop_simple.sel.reg_p = 0;
- IOPORT_D->iop_common.out = config->P4Data.out;
- IOPORT_D->iop_common.dir = config->P4Data.dir;
+ IOPORT4->iop_simple.sel.reg_p = 0;
+ IOPORT4->iop_common.out = config->P4Data.out;
+ IOPORT4->iop_common.dir = config->P4Data.dir;
#endif
#if defined(__MSP430_HAS_PORT5__) || defined(__MSP430_HAS_PORT5_R__)
- IOPORT_E->iop_simple.sel.reg_p = 0;
- IOPORT_E->iop_common.out = config->P5Data.out;
- IOPORT_E->iop_common.dir = config->P5Data.dir;
+ IOPORT5->iop_simple.sel.reg_p = 0;
+ IOPORT5->iop_common.out = config->P5Data.out;
+ IOPORT5->iop_common.dir = config->P5Data.dir;
#endif
#if defined(__MSP430_HAS_PORT6__) || defined(__MSP430_HAS_PORT6_R__)
- IOPORT_F->iop_simple.sel.reg_p = 0;
- IOPORT_F->iop_common.out = config->P6Data.out;
- IOPORT_F->iop_common.dir = config->P6Data.dir;
+ IOPORT6->iop_simple.sel.reg_p = 0;
+ IOPORT6->iop_common.out = config->P6Data.out;
+ IOPORT6->iop_common.dir = config->P6Data.dir;
#endif
}
diff --git a/os/io/platforms/MSP430/pal_lld.h b/os/io/platforms/MSP430/pal_lld.h
index 94407a849..91c0707c1 100644
--- a/os/io/platforms/MSP430/pal_lld.h
+++ b/os/io/platforms/MSP430/pal_lld.h
@@ -150,7 +150,7 @@ typedef union __ioport * ioportid_t;
#if defined(__MSP430_HAS_PORT1__) || \
defined(__MSP430_HAS_PORT1_R__) || \
defined(__DOXYGEN__)
-#define IOPORT_A ((ioportid_t)0x0020)
+#define IOPORT1 ((ioportid_t)0x0020)
#endif
/**
@@ -160,7 +160,7 @@ typedef union __ioport * ioportid_t;
#if defined(__MSP430_HAS_PORT2__) || \
defined(__MSP430_HAS_PORT2_R__) || \
defined(__DOXYGEN__)
-#define IOPORT_B ((ioportid_t)0x0028)
+#define IOPORT2 ((ioportid_t)0x0028)
#endif
/**
@@ -170,7 +170,7 @@ typedef union __ioport * ioportid_t;
#if defined(__MSP430_HAS_PORT3__) || \
defined(__MSP430_HAS_PORT3_R__) || \
defined(__DOXYGEN__)
-#define IOPORT_C ((ioportid_t)0x0018)
+#define IOPORT3 ((ioportid_t)0x0018)
#endif
/**
@@ -180,7 +180,7 @@ typedef union __ioport * ioportid_t;
#if defined(__MSP430_HAS_PORT4__) || \
defined(__MSP430_HAS_PORT4_R__) || \
defined(__DOXYGEN__)
-#define IOPORT_D ((ioportid_t)0x001c)
+#define IOPORT4 ((ioportid_t)0x001c)
#endif
/**
@@ -190,7 +190,7 @@ typedef union __ioport * ioportid_t;
#if defined(__MSP430_HAS_PORT5__) || \
defined(__MSP430_HAS_PORT5_R__) || \
defined(__DOXYGEN__)
-#define IOPORT_E ((ioportid_t)0x0030)
+#define IOPORT5 ((ioportid_t)0x0030)
#endif
/**
@@ -200,7 +200,7 @@ typedef union __ioport * ioportid_t;
#if defined(__MSP430_HAS_PORT6__) || \
defined(__MSP430_HAS_PORT6_R__) || \
defined(__DOXYGEN__)
-#define IOPORT_F ((ioportid_t)0x0034)
+#define IOPORT6 ((ioportid_t)0x0034)
#endif
/*===========================================================================*/
diff --git a/os/io/platforms/MSP430/serial_lld.c b/os/io/platforms/MSP430/serial_lld.c
index c62920480..1c9504097 100644
--- a/os/io/platforms/MSP430/serial_lld.c
+++ b/os/io/platforms/MSP430/serial_lld.c
@@ -33,11 +33,11 @@
#if USE_MSP430_USART0 || defined(__DOXYGEN__)
/** @brief USART0 serial driver identifier.*/
-SerialDriver COM1;
+SerialDriver SD1;
#endif
#if USE_MSP430_USART1 || defined(__DOXYGEN__)
/** @brief USART1 serial driver identifier.*/
-SerialDriver COM2;
+SerialDriver SD2;
#endif
/** @brief Driver default configuration.*/
@@ -72,7 +72,7 @@ static void notify1(void) {
if (!(U0IE & UTXIE0)) {
chSysLockFromIsr();
- U0TXBUF = (uint8_t)sdRequestDataI(&COM1);
+ U0TXBUF = (uint8_t)sdRequestDataI(&SD1);
chSysUnlockFromIsr();
U0IE |= UTXIE0;
}
@@ -113,7 +113,7 @@ void usart0_deinit(void) {
static void notify2(void) {
if (!(U1IE & UTXIE1)) {
- U1TXBUF = (uint8_t)sdRequestDataI(&COM2);
+ U1TXBUF = (uint8_t)sdRequestDataI(&SD2);
U1IE |= UTXIE1;
}
}
@@ -160,7 +160,7 @@ CH_IRQ_HANDLER(USART0TX_VECTOR) {
CH_IRQ_PROLOGUE();
chSysLockFromIsr();
- b = sdRequestDataI(&COM1);
+ b = sdRequestDataI(&SD1);
chSysUnlockFromIsr();
if (b < Q_OK)
U0IE &= ~UTXIE0;
@@ -176,9 +176,9 @@ CH_IRQ_HANDLER(USART0RX_VECTOR) {
CH_IRQ_PROLOGUE();
if ((urctl = U0RCTL) & RXERR)
- set_error(urctl, &COM1);
+ set_error(urctl, &SD1);
chSysLockFromIsr();
- sdIncomingDataI(&COM1, U0RXBUF);
+ sdIncomingDataI(&SD1, U0RXBUF);
chSysUnlockFromIsr();
CH_IRQ_EPILOGUE();
@@ -192,7 +192,7 @@ CH_IRQ_HANDLER(USART1TX_VECTOR) {
CH_IRQ_PROLOGUE();
chSysLockFromIsr();
- b = sdRequestDataI(&COM2);
+ b = sdRequestDataI(&SD2);
chSysUnlockFromIsr();
if (b < Q_OK)
U1IE &= ~UTXIE1;
@@ -208,9 +208,9 @@ CH_IRQ_HANDLER(USART1RX_VECTOR) {
CH_IRQ_PROLOGUE();
if ((urctl = U1RCTL) & RXERR)
- set_error(urctl, &COM2);
+ set_error(urctl, &SD2);
chSysLockFromIsr();
- sdIncomingDataI(&COM2, U1RXBUF);
+ sdIncomingDataI(&SD2, U1RXBUF);
chSysUnlockFromIsr();
CH_IRQ_EPILOGUE();
@@ -227,13 +227,13 @@ CH_IRQ_HANDLER(USART1RX_VECTOR) {
void sd_lld_init(void) {
#if USE_MSP430_USART0
- sdObjectInit(&COM1, NULL, notify1);
+ sdObjectInit(&SD1, NULL, notify1);
/* I/O pins for USART0.*/
P3SEL |= BV(4) + BV(5);
#endif
#if USE_MSP430_USART1
- sdObjectInit(&COM2, NULL, notify2);
+ sdObjectInit(&SD2, NULL, notify2);
/* I/O pins for USART1.*/
P3SEL |= BV(6) + BV(7);
#endif
@@ -253,13 +253,13 @@ void sd_lld_start(SerialDriver *sdp, const SerialDriverConfig *config) {
config = &default_config;
#if USE_MSP430_USART0
- if (&COM1 == sdp) {
+ if (&SD1 == sdp) {
usart0_init(config);
return;
}
#endif
#if USE_MSP430_USART1
- if (&COM2 == sdp) {
+ if (&SD2 == sdp) {
usart1_init(config);
return;
}
@@ -276,13 +276,13 @@ void sd_lld_start(SerialDriver *sdp, const SerialDriverConfig *config) {
void sd_lld_stop(SerialDriver *sdp) {
#if USE_MSP430_USART0
- if (&COM1 == sdp) {
+ if (&SD1 == sdp) {
usart0_deinit();
return;
}
#endif
#if USE_MSP430_USART1
- if (&COM2 == sdp) {
+ if (&SD2 == sdp) {
usart1_deinit();
return;
}
diff --git a/os/io/platforms/MSP430/serial_lld.h b/os/io/platforms/MSP430/serial_lld.h
index d57cc3771..255376b83 100644
--- a/os/io/platforms/MSP430/serial_lld.h
+++ b/os/io/platforms/MSP430/serial_lld.h
@@ -141,10 +141,10 @@ typedef struct {
/** @cond never*/
#if USE_MSP430_USART0
-extern SerialDriver COM1;
+extern SerialDriver SD1;
#endif
#if USE_MSP430_USART1
-extern SerialDriver COM2;
+extern SerialDriver SD2;
#endif
#ifdef __cplusplus
diff --git a/os/io/platforms/STM32F103/pal_lld.c b/os/io/platforms/STM32F103/pal_lld.c
index f2fad1360..c50efadc0 100644
--- a/os/io/platforms/STM32F103/pal_lld.c
+++ b/os/io/platforms/STM32F103/pal_lld.c
@@ -72,30 +72,30 @@ void _pal_lld_init(const STM32GPIOConfig *config) {
RCC->APB2RSTR = APB2_RST_MASK;
RCC->APB2RSTR = 0;
- IOPORT_A->ODR = config->PAData.odr;
- IOPORT_A->CRH = config->PAData.crh;
- IOPORT_A->CRL = config->PAData.crl;
- IOPORT_B->ODR = config->PBData.odr;
- IOPORT_B->CRH = config->PBData.crh;
- IOPORT_B->CRL = config->PBData.crl;
- IOPORT_C->ODR = config->PCData.odr;
- IOPORT_C->CRH = config->PCData.crh;
- IOPORT_C->CRL = config->PCData.crl;
- IOPORT_D->ODR = config->PDData.odr;
- IOPORT_D->CRH = config->PDData.crh;
- IOPORT_D->CRL = config->PDData.crl;
+ IOPORT1->ODR = config->PAData.odr;
+ IOPORT1->CRH = config->PAData.crh;
+ IOPORT1->CRL = config->PAData.crl;
+ IOPORT2->ODR = config->PBData.odr;
+ IOPORT2->CRH = config->PBData.crh;
+ IOPORT2->CRL = config->PBData.crl;
+ IOPORT3->ODR = config->PCData.odr;
+ IOPORT3->CRH = config->PCData.crh;
+ IOPORT3->CRL = config->PCData.crl;
+ IOPORT4->ODR = config->PDData.odr;
+ IOPORT4->CRH = config->PDData.crh;
+ IOPORT4->CRL = config->PDData.crl;
#if !defined(STM32F10X_LD) || defined(__DOXYGEN__)
- IOPORT_E->ODR = config->PEData.odr;
- IOPORT_E->CRH = config->PEData.crh;
- IOPORT_E->CRL = config->PEData.crl;
+ IOPORT5->ODR = config->PEData.odr;
+ IOPORT5->CRH = config->PEData.crh;
+ IOPORT5->CRL = config->PEData.crl;
#endif
#if defined(STM32F10X_HD) || defined(__DOXYGEN__)
- IOPORT_F->ODR = config->PFData.odr;
- IOPORT_F->CRH = config->PFData.crh;
- IOPORT_F->CRL = config->PFData.crl;
- IOPORT_G->ODR = config->PGData.odr;
- IOPORT_G->CRH = config->PGData.crh;
- IOPORT_G->CRL = config->PGData.crl;
+ IOPORT6->ODR = config->PFData.odr;
+ IOPORT6->CRH = config->PFData.crh;
+ IOPORT6->CRL = config->PFData.crl;
+ IOPORT7->ODR = config->PGData.odr;
+ IOPORT7->CRH = config->PGData.crh;
+ IOPORT7->CRL = config->PGData.crl;
#endif
}
diff --git a/os/io/platforms/STM32F103/pal_lld.h b/os/io/platforms/STM32F103/pal_lld.h
index 3a0811ac2..c1c65f85f 100644
--- a/os/io/platforms/STM32F103/pal_lld.h
+++ b/os/io/platforms/STM32F103/pal_lld.h
@@ -116,40 +116,40 @@ typedef GPIO_TypeDef * ioportid_t;
/**
* @brief GPIO port A identifier.
*/
-#define IOPORT_A GPIOA
+#define IOPORT1 GPIOA
/**
* @brief GPIO port B identifier.
*/
-#define IOPORT_B GPIOB
+#define IOPORT2 GPIOB
/**
* @brief GPIO port C identifier.
*/
-#define IOPORT_C GPIOC
+#define IOPORT3 GPIOC
/**
* @brief GPIO port D identifier.
*/
-#define IOPORT_D GPIOD
+#define IOPORT4 GPIOD
/**
* @brief GPIO port E identifier.
*/
#if !defined(STM32F10X_LD) || defined(__DOXYGEN__)
-#define IOPORT_E GPIOE
+#define IOPORT5 GPIOE
#endif
/**
* @brief GPIO port F identifier.
*/
#if defined(STM32F10X_HD) || defined(__DOXYGEN__)
-#define IOPORT_F GPIOF
+#define IOPORT6 GPIOF
/**
* @brief GPIO port G identifier.
*/
-#define IOPORT_G GPIOG
+#define IOPORT7 GPIOG
#endif
/*===========================================================================*/
diff --git a/os/io/platforms/STM32F103/serial_lld.c b/os/io/platforms/STM32F103/serial_lld.c
index 09849605c..2a727dc43 100644
--- a/os/io/platforms/STM32F103/serial_lld.c
+++ b/os/io/platforms/STM32F103/serial_lld.c
@@ -32,17 +32,17 @@
#if USE_STM32_USART1 || defined(__DOXYGEN__)
/** @brief USART1 serial driver identifier.*/
-SerialDriver COM1;
+SerialDriver SD1;
#endif
#if USE_STM32_USART2 || defined(__DOXYGEN__)
/** @brief USART2 serial driver identifier.*/
-SerialDriver COM2;
+SerialDriver SD2;
#endif
#if USE_STM32_USART3 || defined(__DOXYGEN__)
/** @brief USART3 serial driver identifier.*/
-SerialDriver COM3;
+SerialDriver SD3;
#endif
/** @brief Driver default configuration.*/
@@ -174,7 +174,7 @@ CH_IRQ_HANDLER(VectorD4) {
CH_IRQ_PROLOGUE();
- serve_interrupt(USART1, &COM1);
+ serve_interrupt(USART1, &SD1);
CH_IRQ_EPILOGUE();
}
@@ -185,7 +185,7 @@ CH_IRQ_HANDLER(VectorD8) {
CH_IRQ_PROLOGUE();
- serve_interrupt(USART2, &COM2);
+ serve_interrupt(USART2, &SD2);
CH_IRQ_EPILOGUE();
}
@@ -196,7 +196,7 @@ CH_IRQ_HANDLER(VectorDC) {
CH_IRQ_PROLOGUE();
- serve_interrupt(USART3, &COM3);
+ serve_interrupt(USART3, &SD3);
CH_IRQ_EPILOGUE();
}
@@ -212,17 +212,17 @@ CH_IRQ_HANDLER(VectorDC) {
void sd_lld_init(void) {
#if USE_STM32_USART1
- sdObjectInit(&COM1, NULL, notify1);
+ sdObjectInit(&SD1, NULL, notify1);
GPIOA->CRH = (GPIOA->CRH & 0xFFFFF00F) | 0x000004B0;
#endif
#if USE_STM32_USART2
- sdObjectInit(&COM2, NULL, notify2);
+ sdObjectInit(&SD2, NULL, notify2);
GPIOA->CRL = (GPIOA->CRL & 0xFFFF00FF) | 0x00004B00;
#endif
#if USE_STM32_USART3
- sdObjectInit(&COM3, NULL, notify3);
+ sdObjectInit(&SD3, NULL, notify3);
GPIOB->CRH = (GPIOB->CRH & 0xFFFF00FF) | 0x00004B00;
#endif
}
@@ -241,7 +241,7 @@ void sd_lld_start(SerialDriver *sdp, const SerialDriverConfig *config) {
config = &default_config;
#if USE_STM32_USART1
- if (&COM1 == sdp) {
+ if (&SD1 == sdp) {
RCC->APB2ENR |= RCC_APB2ENR_USART1EN;
usart_init(USART1, config);
NVICEnableVector(USART1_IRQn, STM32_USART1_PRIORITY);
@@ -249,7 +249,7 @@ void sd_lld_start(SerialDriver *sdp, const SerialDriverConfig *config) {
}
#endif
#if USE_STM32_USART2
- if (&COM2 == sdp) {
+ if (&SD2 == sdp) {
RCC->APB1ENR |= RCC_APB1ENR_USART2EN;
usart_init(USART2, config);
NVICEnableVector(USART2_IRQn, STM32_USART2_PRIORITY);
@@ -257,7 +257,7 @@ void sd_lld_start(SerialDriver *sdp, const SerialDriverConfig *config) {
}
#endif
#if USE_STM32_USART3
- if (&COM3 == sdp) {
+ if (&SD3 == sdp) {
RCC->APB1ENR |= RCC_APB1ENR_USART3EN;
usart_init(USART3, config);
NVICEnableVector(USART3_IRQn, STM32_USART3_PRIORITY);
@@ -276,7 +276,7 @@ void sd_lld_start(SerialDriver *sdp, const SerialDriverConfig *config) {
void sd_lld_stop(SerialDriver *sdp) {
#if USE_STM32_USART1
- if (&COM1 == sdp) {
+ if (&SD1 == sdp) {
usart_deinit(USART1);
RCC->APB2ENR &= ~RCC_APB2ENR_USART1EN;
NVICDisableVector(USART1_IRQn);
@@ -284,7 +284,7 @@ void sd_lld_stop(SerialDriver *sdp) {
}
#endif
#if USE_STM32_USART2
- if (&COM2 == sdp) {
+ if (&SD2 == sdp) {
usart_deinit(USART2);
RCC->APB1ENR &= ~RCC_APB1ENR_USART2EN;
NVICDisableVector(USART2_IRQn);
@@ -292,7 +292,7 @@ void sd_lld_stop(SerialDriver *sdp) {
}
#endif
#if USE_STM32_USART3
- if (&COM3 == sdp) {
+ if (&SD3 == sdp) {
usart_deinit(USART3);
RCC->APB1ENR &= ~RCC_APB1ENR_USART3EN;
NVICDisableVector(USART3_IRQn);
diff --git a/os/io/platforms/STM32F103/serial_lld.h b/os/io/platforms/STM32F103/serial_lld.h
index 5460d4a57..a623eb308 100644
--- a/os/io/platforms/STM32F103/serial_lld.h
+++ b/os/io/platforms/STM32F103/serial_lld.h
@@ -181,13 +181,13 @@ typedef struct {
/** @cond never*/
#if USE_STM32_USART1
-extern SerialDriver COM1;
+extern SerialDriver SD1;
#endif
#if USE_STM32_USART2
-extern SerialDriver COM2;
+extern SerialDriver SD2;
#endif
#if USE_STM32_USART3
-extern SerialDriver COM3;
+extern SerialDriver SD3;
#endif
#ifdef __cplusplus