Skip to content

Commit

Permalink
add misssing usart 6 pin config info (#58)
Browse files Browse the repository at this point in the history
* add misssing  usart 6 pin config info

* 对齐空格
  • Loading branch information
shanggl authored Jun 7, 2023
1 parent f8d2aed commit efc7b28
Showing 1 changed file with 44 additions and 6 deletions.
50 changes: 44 additions & 6 deletions src/main/drivers/serial_uart_at32f43x.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@
#ifndef UART5_RX_DMA_CHANNEL
#define UART5_RX_DMA_CHANNEL NULL
#endif
#ifndef UART6_TX_DMA_CHANNEL
#define UART6_TX_DMA_CHANNEL NULL
#endif
#ifndef UART6_RX_DMA_CHANNEL
#define UART6_RX_DMA_CHANNEL NULL
#endif
#ifndef UART7_TX_DMA_CHANNEL
#define UART7_TX_DMA_CHANNEL NULL
#endif
Expand Down Expand Up @@ -216,14 +222,14 @@ const uartHardware_t uartHardware[UARTDEV_COUNT] = {
.rxPins = {
{ DEFIO_TAG_E(PB5), GPIO_MUX_8 },
{ DEFIO_TAG_E(PB8), GPIO_MUX_8 },
{ DEFIO_TAG_E(PD2), GPIO_MUX_8 },
{ DEFIO_TAG_E(PE11), GPIO_MUX_8 },
{ DEFIO_TAG_E(PD2), GPIO_MUX_8 },
{ DEFIO_TAG_E(PE11), GPIO_MUX_8 },
},
.txPins = {
{ DEFIO_TAG_E(PB6), GPIO_MUX_8 },
{ DEFIO_TAG_E(PB9), GPIO_MUX_8 },
{ DEFIO_TAG_E(PC12), GPIO_MUX_8 },
{ DEFIO_TAG_E(PE10), GPIO_MUX_8 },
{ DEFIO_TAG_E(PB6), GPIO_MUX_8 },
{ DEFIO_TAG_E(PB9), GPIO_MUX_8 },
{ DEFIO_TAG_E(PC12), GPIO_MUX_8 },
{ DEFIO_TAG_E(PE10), GPIO_MUX_8 },
},
.rcc = RCC_APB1(UART5),
.irqn = UART5_IRQn,
Expand All @@ -235,6 +241,38 @@ const uartHardware_t uartHardware[UARTDEV_COUNT] = {
.rxBufferSize = sizeof(uart5RxBuffer),
},
#endif
#ifdef USE_UART6
{
.device = UARTDEV_6,
.reg = USART6,
#ifdef USE_DMA
.rxDMAMuxId = DMAMUX_DMAREQ_ID_USART6_RX,
.rxDMAResource = (dmaResource_t *)UART6_RX_DMA_CHANNEL,
.txDMAMuxId = DMAMUX_DMAREQ_ID_USART6_RX,
.txDMAResource = (dmaResource_t *)UART6_TX_DMA_CHANNEL,
#endif
.rxPins = {
{ DEFIO_TAG_E(PA5), GPIO_MUX_8 },
{ DEFIO_TAG_E(PA12), GPIO_MUX_8 },
{ DEFIO_TAG_E(PC7), GPIO_MUX_8 },
{ DEFIO_TAG_E(PG9), GPIO_MUX_8 },
},
.txPins = {
{ DEFIO_TAG_E(PA4), GPIO_MUX_8 },
{ DEFIO_TAG_E(PA11), GPIO_MUX_8 },
{ DEFIO_TAG_E(PC6), GPIO_MUX_8 },
{ DEFIO_TAG_E(PG4), GPIO_MUX_8 },
},
.rcc = RCC_APB2(USART6),
.irqn = USART6_IRQn,
.txPriority = NVIC_PRIO_SERIALUART6_TXDMA,
.rxPriority = NVIC_PRIO_SERIALUART6,
.txBuffer = uart6TxBuffer,
.rxBuffer = uart6RxBuffer,
.txBufferSize = sizeof(uart6TxBuffer),
.rxBufferSize = sizeof(uart6RxBuffer),
},
#endif

#ifdef USE_UART7
{
Expand Down

0 comments on commit efc7b28

Please sign in to comment.