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