From 37ef1ba88c42b15909ee84286ecc0d9bd5560506 Mon Sep 17 00:00:00 2001 From: Yuqiang Wang <2053731441@qq.com> Date: Mon, 2 Oct 2023 16:28:46 +0800 Subject: [PATCH] [bsp/stm32] Optimize the kconfig structure of ART-PI board about serial port (#8101) --- bsp/stm32/stm32h750-artpi/board/Kconfig | 78 +++++++++++++++++++++---- bsp/stm32/stm32h750-artpi/board/board.h | 5 -- 2 files changed, 66 insertions(+), 17 deletions(-) diff --git a/bsp/stm32/stm32h750-artpi/board/Kconfig b/bsp/stm32/stm32h750-artpi/board/Kconfig index f23010945e..1d488c446f 100644 --- a/bsp/stm32/stm32h750-artpi/board/Kconfig +++ b/bsp/stm32/stm32h750-artpi/board/Kconfig @@ -147,31 +147,85 @@ menu "On-chip Peripheral Drivers" select RT_USING_SERIAL select RT_SERIAL_USING_DMA if BSP_USING_UART - config BSP_USING_UART1 + menuconfig BSP_USING_UART1 bool "Enable UART1" default n + if BSP_USING_UART1 + config BSP_UART1_RX_USING_DMA + bool "Enable UART1 RX DMA" + depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA + default n - config BSP_UART1_RX_USING_DMA - bool "Enable UART1 RX DMA" - depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA - default n + config BSP_UART1_TX_USING_DMA + bool "Enable UART1 TX DMA" + depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA + default n - config BSP_UART1_TX_USING_DMA - bool "Enable UART1 TX DMA" - depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA - default n + config BSP_UART1_RX_BUFSIZE + int "Set UART1 RX buffer size" + range 64 65535 + depends on BSP_USING_UART1 + default 256 - config BSP_USING_UART3 + config BSP_UART1_TX_BUFSIZE + int "Set UART1 TX buffer size" + range 0 65535 + depends on BSP_USING_UART1 + default 0 + + endif + + menuconfig BSP_USING_UART3 bool "Enable UART3" default n + if BSP_USING_UART3 + config BSP_UART3_RX_BUFSIZE + int "Set UART3 RX buffer size" + range 64 65535 + depends on BSP_USING_UART3 + default 256 - config BSP_USING_UART4 + config BSP_UART3_TX_BUFSIZE + int "Set UART3 TX buffer size" + range 0 65535 + depends on BSP_USING_UART3 + default 0 + endif + + menuconfig BSP_USING_UART4 bool "Enable UART4" default n + if BSP_USING_UART4 + config BSP_UART4_RX_BUFSIZE + int "Set UART4 RX buffer size" + range 64 65535 + depends on BSP_USING_UART4 + default 256 - config BSP_USING_UART6 + config BSP_UART4_TX_BUFSIZE + int "Set UART4 TX buffer size" + range 0 65535 + depends on BSP_USING_UART4 + default 0 + endif + + menuconfig BSP_USING_UART6 bool "Enable UART6" default n + if BSP_USING_UART6 + config BSP_UART6_RX_BUFSIZE + int "Set UART6 RX buffer size" + range 64 65535 + depends on BSP_USING_UART6 + default 256 + + config BSP_UART6_TX_BUFSIZE + int "Set UART6 TX buffer size" + range 0 65535 + depends on BSP_USING_UART6 + default 0 + + endif endif menuconfig BSP_USING_SPI diff --git a/bsp/stm32/stm32h750-artpi/board/board.h b/bsp/stm32/stm32h750-artpi/board/board.h index 4da884ef76..7a253d3132 100644 --- a/bsp/stm32/stm32h750-artpi/board/board.h +++ b/bsp/stm32/stm32h750-artpi/board/board.h @@ -66,11 +66,6 @@ extern "C" { * */ -#define BSP_UART3_RX_BUFSIZE 256 -#define BSP_UART3_TX_BUFSIZE 256 -#define BSP_UART4_RX_BUFSIZE 256 -#define BSP_UART4_TX_BUFSIZE 256 - #define STM32_FLASH_START_ADRESS ROM_START #define STM32_FLASH_SIZE ROM_SIZE #define STM32_FLASH_END_ADDRESS ROM_END