mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 11:26:12 +08:00
stm32: serial Allow configuring Rx DMA buffer size
This commit is contained in:
@@ -6165,6 +6165,19 @@ if STM32_SERIALDRIVER
|
|||||||
|
|
||||||
comment "Serial Driver Configuration"
|
comment "Serial Driver Configuration"
|
||||||
|
|
||||||
|
config STM32_SERIAL_RXDMA_BUFFER_SIZE
|
||||||
|
int "Rx DMA buffer size"
|
||||||
|
default 32
|
||||||
|
range 32 4096
|
||||||
|
depends on USART1_RXDMA || USART2_RXDMA || USART3_RXDMA || UART4_RXDMA || UART5_RXDMA || USART6_RXDMA || UART7_RXDMA || UART8_RXDMA
|
||||||
|
---help---
|
||||||
|
The DMA buffer size when using RX DMA to emulate a FIFO.
|
||||||
|
|
||||||
|
When streaming data, the generic serial layer will be called
|
||||||
|
every time the FIFO receives half or this number of bytes.
|
||||||
|
|
||||||
|
Value given here will be rounded up to next multiple of 4 bytes.
|
||||||
|
|
||||||
config SERIAL_DISABLE_REORDERING
|
config SERIAL_DISABLE_REORDERING
|
||||||
bool "Disable reordering of ttySx devices."
|
bool "Disable reordering of ttySx devices."
|
||||||
depends on STM32_USART1 || STM32_USART2 || STM32_USART3 || STM32_UART4 || STM32_UART5 || STM32_USART6 || STM32_UART7 || STM32_UART8
|
depends on STM32_USART1 || STM32_USART2 || STM32_USART3 || STM32_UART4 || STM32_UART5 || STM32_USART6 || STM32_UART7 || STM32_UART8
|
||||||
|
|||||||
@@ -182,8 +182,12 @@
|
|||||||
* When streaming data, the generic serial layer will be called
|
* When streaming data, the generic serial layer will be called
|
||||||
* every time the FIFO receives half this number of bytes.
|
* every time the FIFO receives half this number of bytes.
|
||||||
*/
|
*/
|
||||||
|
# if !defined(CONFIG_STM32_SERIAL_RXDMA_BUFFER_SIZE)
|
||||||
# define RXDMA_BUFFER_SIZE 32
|
# define CONFIG_STM32_SERIAL_RXDMA_BUFFER_SIZE 32
|
||||||
|
# endif
|
||||||
|
# define RXDMA_MUTIPLE 4
|
||||||
|
# define RXDMA_BUFFER_SIZE ((CONFIG_STM32_SERIAL_RXDMA_BUFFER_SIZE \
|
||||||
|
+ RXDMA_MUTIPLE) & ~RXDMA_MUTIPLE)
|
||||||
|
|
||||||
/* DMA priority */
|
/* DMA priority */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user