Skip to content

Commit

Permalink
at32: add abilty to specify uart af
Browse files Browse the repository at this point in the history
  • Loading branch information
bkleiner committed Sep 26, 2024
1 parent 9923c30 commit 302eff2
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/main/drivers/serial_uart_at32f43x.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ static uartDevice_t uart1 =
.dev = USART1,
.rx = IO_TAG(UART1_RX_PIN),
.tx = IO_TAG(UART1_TX_PIN),
#ifdef UART1_AF
.af = CONCAT(GPIO_MUX_, UART1_AF),
#else
.af = GPIO_MUX_7,
#endif
#ifdef UART1_AHB1_PERIPHERALS
.rcc_ahb1 = UART1_AHB1_PERIPHERALS,
#endif
Expand All @@ -75,7 +79,11 @@ static uartDevice_t uart2 =
.dev = USART2,
.rx = IO_TAG(UART2_RX_PIN),
.tx = IO_TAG(UART2_TX_PIN),
#ifdef UART2_AF
.af = CONCAT(GPIO_MUX_, UART2_AF),
#else
.af = GPIO_MUX_7,
#endif
#ifdef UART2_AHB1_PERIPHERALS
.rcc_ahb1 = UART2_AHB1_PERIPHERALS,
#endif
Expand All @@ -96,7 +104,11 @@ static uartDevice_t uart3 =
.dev = USART3,
.rx = IO_TAG(UART3_RX_PIN),
.tx = IO_TAG(UART3_TX_PIN),
#ifdef UART3_AF
.af = CONCAT(GPIO_MUX_, UART3_AF),
#else
.af = GPIO_MUX_7,
#endif
#ifdef UART3_AHB1_PERIPHERALS
.rcc_ahb1 = UART3_AHB1_PERIPHERALS,
#endif
Expand All @@ -117,7 +129,11 @@ static uartDevice_t uart4 =
.dev = UART4,
.rx = IO_TAG(UART4_RX_PIN),
.tx = IO_TAG(UART4_TX_PIN),
#ifdef UART4_AF
.af = CONCAT(GPIO_MUX_, UART4_AF),
#else
.af = GPIO_MUX_8,
#endif
#ifdef UART4_AHB1_PERIPHERALS
.rcc_ahb1 = UART4_AHB1_PERIPHERALS,
#endif
Expand All @@ -138,7 +154,11 @@ static uartDevice_t uart5 =
.dev = UART5,
.rx = IO_TAG(UART5_RX_PIN),
.tx = IO_TAG(UART5_TX_PIN),
#ifdef UART5_AF
.af = CONCAT(GPIO_MUX_, UART5_AF),
#else
.af = GPIO_MUX_8,
#endif
#ifdef UART5_AHB1_PERIPHERALS
.rcc_ahb1 = UART5_AHB1_PERIPHERALS,
#endif
Expand All @@ -159,7 +179,11 @@ static uartDevice_t uart6 =
.dev = USART6,
.rx = IO_TAG(UART6_RX_PIN),
.tx = IO_TAG(UART6_TX_PIN),
#ifdef UART6_AF
.af = CONCAT(GPIO_MUX_, UART6_AF),
#else
.af = GPIO_MUX_8,
#endif
#ifdef UART6_AHB1_PERIPHERALS
.rcc_ahb1 = UART6_AHB1_PERIPHERALS,
#endif
Expand All @@ -180,7 +204,11 @@ static uartDevice_t uart7 =
.dev = UART7,
.rx = IO_TAG(UART7_RX_PIN),
.tx = IO_TAG(UART7_TX_PIN),
#ifdef UART7_AF
.af = CONCAT(GPIO_MUX_, UART7_AF),
#else
.af = GPIO_MUX_8,
#endif
.rcc_apb1 = RCC_APB1(UART7),
.irq = UART7_IRQn,
.irqPriority = NVIC_PRIO_SERIALUART,
Expand All @@ -198,7 +226,11 @@ static uartDevice_t uart8 =
.dev = UART8,
.rx = IO_TAG(UART8_RX_PIN),
.tx = IO_TAG(UART8_TX_PIN),
#ifdef UART8_AF
.af = CONCAT(GPIO_MUX_, UART8_AF),
#else
.af = GPIO_MUX_8,
#endif
.rcc_apb1 = RCC_APB1(UART8),
.irq = UART8_IRQn,
.irqPriority = NVIC_PRIO_SERIALUART,
Expand Down

0 comments on commit 302eff2

Please sign in to comment.