Merge pull request #5163 from cndabai/stm32g

修复stm32g系列不同芯片串口中断不匹配
This commit is contained in:
guo 2021-10-14 09:58:13 +08:00 committed by GitHub
commit 61e993d656
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 80 additions and 9 deletions

View File

@ -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 */