config: esp32: configurable UART FIFO thresholds

The existing configuration of the ESP32 UART FIFO thresholds
was fixed, leading to inefficiencies in handling
Modbus RTU packages exceeding this size.
This commit introduces two new Kconfig options,
allowing users to adjust the esp32 fifo thresholds as needed.
fixes #74311

Signed-off-by: Omer Gozderesi <omer.gozderesi@enda.com>

config: esp32:  configurable UART FIFO thresholds

The existing configuration of the ESP32 UART FIFO thresholds
was fixed, leading to inefficiencies in handling
Modbus RTU packages exceeding this size.
This commit introduces two new Kconfig options,
allowing users to adjust the esp32 fifo thresholds as needed.
fixes #74311
Signed-off-by: Omer Gozderesi <omer.gozderesi@enda.com>
This commit is contained in:
Omer Gozderesi 2024-06-14 14:55:09 +03:00 committed by Anas Nashif
commit 1fc97561ed
2 changed files with 18 additions and 2 deletions

View file

@ -27,3 +27,19 @@ config SERIAL_ESP32_USB
USB host. The USB stack is built into the chip and accessed
by the firmware through a simplified API similar to a "normal"
UART peripheral.
config UART_ESP32_TX_FIFO_THRESH
hex "ESP32 UART TX FIFO Threshold"
depends on UART_ESP32
default 0x1
range 1 127
help
Configure the TX FIFO threshold for ESP32 UART driver.
config UART_ESP32_RX_FIFO_THRESH
hex "ESP32 UART RX FIFO Threshold"
depends on UART_ESP32
default 0x16
range 1 127
help
Configure the RX FIFO threshold for ESP32 UART driver.

View file

@ -116,8 +116,8 @@ struct uart_esp32_data {
};
#define UART_FIFO_LIMIT (UART_LL_FIFO_DEF_LEN)
#define UART_TX_FIFO_THRESH 0x1
#define UART_RX_FIFO_THRESH 0x16
#define UART_TX_FIFO_THRESH (CONFIG_UART_ESP32_TX_FIFO_THRESH)
#define UART_RX_FIFO_THRESH (CONFIG_UART_ESP32_RX_FIFO_THRESH)
#if CONFIG_UART_INTERRUPT_DRIVEN || CONFIG_UART_ASYNC_API
static void uart_esp32_isr(void *arg);