feat(uart): add glitch filter functionality for UART

Closes https://github.com/espressif/esp-idf/issues/17847
This commit is contained in:
Song Ruo Jing
2026-01-23 11:36:32 +08:00
parent 77aa76ecc4
commit 8baea2e4a0
24 changed files with 703 additions and 60 deletions
@@ -50,10 +50,9 @@ TEST_CASE("ledc etm event and task", "[ledc]")
TEST_ESP_OK(esp_etm_channel_enable(etm_channel_a));
// use UART auto baud rate detection feature to count the PWM pulse count
uart_bitrate_detect_config_t conf = {
.rx_io_num = PULSE_IO,
.source_clk = UART_SCLK_DEFAULT,
};
uart_bitrate_detect_config_t conf = {};
conf.rx_io_num = PULSE_IO;
conf.source_clk = UART_SCLK_DEFAULT;
uart_bitrate_res_t res = {};
uart_detect_bitrate_start(UART_NUM_1, &conf);
@@ -37,10 +37,9 @@ ledc_timer_config_t create_default_timer_config(void)
// use UART auto baud rate detection feature to test the waveform of LEDC
int wave_count(int last_time)
{
uart_bitrate_detect_config_t conf = {
.rx_io_num = PULSE_IO,
.source_clk = UART_SCLK_DEFAULT,
};
uart_bitrate_detect_config_t conf = {};
conf.rx_io_num = PULSE_IO;
conf.source_clk = UART_SCLK_DEFAULT;
uart_bitrate_res_t res = {};
uart_detect_bitrate_start(UART_NUM_1, &conf);
vTaskDelay(pdMS_TO_TICKS(last_time));