aboutsummaryrefslogtreecommitdiffstats
path: root/os/io/platforms/MSP430
diff options
context:
space:
mode:
Diffstat (limited to 'os/io/platforms/MSP430')
-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
4 files changed, 46 insertions, 46 deletions
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