summaryrefslogtreecommitdiff
path: root/bsp/stm32
diff options
context:
space:
mode:
Diffstat (limited to 'bsp/stm32')
-rw-r--r--bsp/stm32/libraries/HAL_Drivers/config/g0/uart_config.h89
1 files changed, 80 insertions, 9 deletions
diff --git a/bsp/stm32/libraries/HAL_Drivers/config/g0/uart_config.h b/bsp/stm32/libraries/HAL_Drivers/config/g0/uart_config.h
index 3cbb77eefd..fd8cdab194 100644
--- a/bsp/stm32/libraries/HAL_Drivers/config/g0/uart_config.h
+++ b/bsp/stm32/libraries/HAL_Drivers/config/g0/uart_config.h
@@ -13,6 +13,10 @@
#include <rtthread.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#if defined(BSP_USING_LPUART1)
#ifndef LPUART1_CONFIG
#define LPUART1_CONFIG \
@@ -61,12 +65,21 @@
#if defined(BSP_USING_UART2)
#ifndef UART2_CONFIG
+#if defined(STM32G0B1xx) || defined(STM32G0C1xx)
+#define UART2_CONFIG \
+ { \
+ .name = "uart2", \
+ .Instance = USART2, \
+ .irq_type = USART2_LPUART2_IRQn , \
+ }
+#else
#define UART2_CONFIG \
{ \
.name = "uart2", \
.Instance = USART2, \
.irq_type = USART2_IRQn, \
}
+#endif /* defined(STM32G0B1xx) || defined(STM32G0C1xx) */
#endif /* UART2_CONFIG */
#endif /* BSP_USING_UART2 */
@@ -84,21 +97,42 @@
#if defined(BSP_USING_UART3)
#ifndef UART3_CONFIG
-#ifndef SOC_SERIES_STM32G0
+#if defined(STM32G0B1xx) || defined(STM32G0C1xx)
#define UART3_CONFIG \
{ \
.name = "uart3", \
.Instance = USART3, \
- .irq_type = USART3_IRQn, \
+ .irq_type = USART3_4_5_6_LPUART1_IRQn, \
}
-#else
+#elif defined(STM32G070xx)
+#define UART3_CONFIG \
+ { \
+ .name = "uart3", \
+ .Instance = USART3, \
+ .irq_type = USART3_4_IRQn, \
+ }
+#elif defined(STM32G071xx) || defined(STM32G081xx)
#define UART3_CONFIG \
{ \
.name = "uart3", \
.Instance = USART3, \
.irq_type = USART3_4_LPUART1_IRQn, \
}
-#endif /* SOC_SERIES_STM32G0 */
+#elif defined(STM32G0B0xx)
+#define UART3_CONFIG \
+ { \
+ .name = "uart3", \
+ .Instance = USART3, \
+ .irq_type = USART3_4_5_6_IRQn, \
+ }
+#else
+#define UART3_CONFIG \
+ { \
+ .name = "uart3", \
+ .Instance = USART3, \
+ .irq_type = USART3_IRQn, \
+ }
+#endif /* defined(STM32G0B1xx) || defined(STM32G0C1xx) */
#endif /* UART3_CONFIG */
#endif /* BSP_USING_UART3 */
@@ -116,22 +150,43 @@
#if defined(BSP_USING_UART4)
#ifndef UART4_CONFIG
-#ifndef SOC_SERIES_STM32G0
+#if defined(STM32G0B1xx) || defined(STM32G0C1xx)
#define UART4_CONFIG \
{ \
.name = "uart4", \
- .Instance = UART4, \
- .irq_type = UART4_IRQn, \
+ .Instance = USART4, \
+ .irq_type = USART3_4_5_6_LPUART1_IRQn, \
}
-#else
+#elif defined(STM32G070xx)
+#define UART4_CONFIG \
+ { \
+ .name = "uart4", \
+ .Instance = USART4, \
+ .irq_type = USART3_4_IRQn, \
+ }
+#elif defined(STM32G071xx) || defined(STM32G081xx)
#define UART4_CONFIG \
{ \
.name = "uart4", \
.Instance = USART4, \
.irq_type = USART3_4_LPUART1_IRQn, \
}
+#elif defined(STM32G0B0xx)
+#define UART4_CONFIG \
+ { \
+ .name = "uart4", \
+ .Instance = USART4, \
+ .irq_type = USART3_4_5_6_IRQn, \
+ }
+#else
+#define UART4_CONFIG \
+ { \
+ .name = "uart4", \
+ .Instance = USART4, \
+ .irq_type = USART4_IRQn, \
+ }
+#endif /* defined(STM32G0B1xx) || defined(STM32G0C1xx) */
#endif /* UART4_CONFIG */
-#endif /* SOC_SERIES_STM32G0 */
#endif /* BSP_USING_UART4 */
#if defined(BSP_UART4_RX_USING_DMA)
@@ -148,12 +203,28 @@
#if defined(BSP_USING_UART5)
#ifndef UART5_CONFIG
+#if defined(STM32G0B1xx) || defined(STM32G0C1xx)
+#define UART5_CONFIG \
+ { \
+ .name = "uart5", \
+ .Instance = UART5, \
+ .irq_type = USART3_4_5_6_LPUART1_IRQn, \
+ }
+#elif defined(STM32G0B0xx)
+#define UART5_CONFIG \
+ { \
+ .name = "uart5", \
+ .Instance = UART5, \
+ .irq_type = USART3_4_5_6_IRQn, \
+ }
+#else
#define UART5_CONFIG \
{ \
.name = "uart5", \
.Instance = UART5, \
.irq_type = UART5_IRQn, \
}
+#endif /* defined(STM32G0B1xx) || defined(STM32G0C1xx) */
#endif /* UART5_CONFIG */
#endif /* BSP_USING_UART5 */