From efc7b2800b43994f52f4c148c0a03aebcbf64244 Mon Sep 17 00:00:00 2001 From: EMSR Date: Wed, 7 Jun 2023 10:36:18 +0800 Subject: [PATCH] add misssing usart 6 pin config info (#58) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add misssing usart 6 pin config info * 对齐空格 --- src/main/drivers/serial_uart_at32f43x.c | 50 ++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/src/main/drivers/serial_uart_at32f43x.c b/src/main/drivers/serial_uart_at32f43x.c index 22f6eb66e..83942fd12 100644 --- a/src/main/drivers/serial_uart_at32f43x.c +++ b/src/main/drivers/serial_uart_at32f43x.c @@ -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 @@ -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, @@ -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 {