From c63f51dcb31bc0aadb5343e3c182c50244f1c41b Mon Sep 17 00:00:00 2001 From: morris Date: Tue, 13 May 2025 14:43:29 +0800 Subject: [PATCH 1/2] refactor(drivers)!: remove unnecessary io_loop_back and pull up/down config option --- .../include/driver/ana_cmpr.h | 3 -- .../dvp/src/esp_cam_ctlr_dvp_cam.c | 1 - .../isp_dvp/src/esp_cam_ctlr_isp_dvp.c | 1 - .../test_apps/dac/main/test_dac.c | 1 - .../include/esp_private/gpio.h | 4 +-- components/esp_driver_i2c/i2c_common.c | 1 - components/esp_driver_i2c/i2c_master.c | 1 - components/esp_driver_i2c/i2c_slave.c | 1 - components/esp_driver_i2c/i2c_slave_v2.c | 1 - components/esp_driver_i2s/i2s_common.c | 1 - .../test_apps/i2s/main/test_i2s.c | 1 - components/esp_driver_ledc/src/ledc.c | 1 - .../test_apps/ledc/main/test_ledc.c | 1 - .../include/driver/mcpwm_cap.h | 4 --- .../include/driver/mcpwm_fault.h | 3 -- .../include/driver/mcpwm_gen.h | 4 --- .../include/driver/mcpwm_sync.h | 3 -- components/esp_driver_mcpwm/src/mcpwm_cap.c | 16 --------- components/esp_driver_mcpwm/src/mcpwm_fault.c | 17 --------- components/esp_driver_mcpwm/src/mcpwm_gen.c | 9 ----- .../esp_driver_mcpwm/src/mcpwm_private.h | 1 - components/esp_driver_mcpwm/src/mcpwm_sync.c | 17 --------- .../test_apps/mcpwm/main/test_mcpwm_cap.c | 2 -- .../test_apps/mcpwm/main/test_mcpwm_fault.c | 1 - .../test_apps/mcpwm/main/test_mcpwm_gen.c | 3 -- .../test_apps/mcpwm/main/test_mcpwm_iram.c | 1 - .../test_apps/mcpwm/main/test_mcpwm_oper.c | 1 - .../test_apps/mcpwm/main/test_mcpwm_sync.c | 1 - .../include/driver/parlio_rx.h | 2 -- .../include/driver/parlio_tx.h | 1 - .../esp_driver_parlio/src/parlio_priv.h | 1 - components/esp_driver_parlio/src/parlio_rx.c | 24 ------------- components/esp_driver_parlio/src/parlio_tx.c | 22 ------------ .../test_apps/parlio/main/test_parlio_rx.c | 1 - .../include/driver/pulse_cnt.h | 14 +++----- components/esp_driver_pcnt/src/pulse_cnt.c | 36 ------------------- .../esp_driver_rmt/include/driver/rmt_rx.h | 1 - .../esp_driver_rmt/include/driver/rmt_tx.h | 2 -- components/esp_driver_rmt/src/rmt_rx.c | 7 ---- components/esp_driver_rmt/src/rmt_tx.c | 9 ----- components/esp_driver_sdio/src/sdio_slave.c | 1 - .../esp_driver_sdm/include/driver/sdm.h | 1 - components/esp_driver_sdm/src/sdm.c | 5 --- components/esp_driver_sdmmc/Kconfig | 2 +- .../sdmmc_tests/sdmmc_test_begin_end_sd.c | 1 - components/esp_driver_twai/twai_private.h | 1 - docs/en/api-reference/peripherals/mcpwm.rst | 1 - .../zh_CN/api-reference/peripherals/mcpwm.rst | 1 - .../mcpwm_bldc_hall_control_example_main.c | 6 ++-- .../main/mcpwm_capture_hc_sr04.c | 4 +-- .../mcpwm_sync/main/mcpwm_sync_example_main.c | 3 +- .../rmt/onewire/main/onewire_example_main.c | 4 +++ 52 files changed, 19 insertions(+), 232 deletions(-) diff --git a/components/esp_driver_ana_cmpr/include/driver/ana_cmpr.h b/components/esp_driver_ana_cmpr/include/driver/ana_cmpr.h index 878272855a..649c526838 100644 --- a/components/esp_driver_ana_cmpr/include/driver/ana_cmpr.h +++ b/components/esp_driver_ana_cmpr/include/driver/ana_cmpr.h @@ -29,9 +29,6 @@ typedef struct { ana_cmpr_cross_type_t cross_type; /*!< The crossing types that can trigger interrupt */ int intr_priority; /*!< The interrupt priority, range 1~3. If set to 0, the driver will automatically select a relative low priority (1,2,3) */ - struct { - uint32_t io_loop_back: 1; /*!< Deprecated. For debug/test, a signal output from other peripheral can work as comparator input. */ - } flags; /*!< Analog comparator driver flags */ } ana_cmpr_config_t; /** diff --git a/components/esp_driver_cam/dvp/src/esp_cam_ctlr_dvp_cam.c b/components/esp_driver_cam/dvp/src/esp_cam_ctlr_dvp_cam.c index 508bb61350..5e867279f5 100644 --- a/components/esp_driver_cam/dvp/src/esp_cam_ctlr_dvp_cam.c +++ b/components/esp_driver_cam/dvp/src/esp_cam_ctlr_dvp_cam.c @@ -7,7 +7,6 @@ #include #include #include "esp_memory_utils.h" -#include "hal/gpio_ll.h" #include "hal/cam_ll.h" #include "hal/color_hal.h" #include "driver/gpio.h" diff --git a/components/esp_driver_cam/isp_dvp/src/esp_cam_ctlr_isp_dvp.c b/components/esp_driver_cam/isp_dvp/src/esp_cam_ctlr_isp_dvp.c index 19c972e66a..31ff7fe060 100644 --- a/components/esp_driver_cam/isp_dvp/src/esp_cam_ctlr_isp_dvp.c +++ b/components/esp_driver_cam/isp_dvp/src/esp_cam_ctlr_isp_dvp.c @@ -15,7 +15,6 @@ #include "driver/isp_types.h" #include "driver/gpio.h" #include "hal/isp_hal.h" -#include "hal/gpio_hal.h" #include "hal/isp_ll.h" #include "hal/mipi_csi_brg_ll.h" #include "hal/mipi_csi_ll.h" diff --git a/components/esp_driver_dac/test_apps/dac/main/test_dac.c b/components/esp_driver_dac/test_apps/dac/main/test_dac.c index d172ac30b0..ad41491a51 100644 --- a/components/esp_driver_dac/test_apps/dac/main/test_dac.c +++ b/components/esp_driver_dac/test_apps/dac/main/test_dac.c @@ -19,7 +19,6 @@ #include "esp_private/i2s_platform.h" // Following headers are used to test the conversion frequency #include "soc/i2s_periph.h" -#include "hal/gpio_hal.h" #include "driver/pulse_cnt.h" #include "soc/pcnt_periph.h" #elif CONFIG_IDF_TARGET_ESP32S2 diff --git a/components/esp_driver_gpio/include/esp_private/gpio.h b/components/esp_driver_gpio/include/esp_private/gpio.h index aaecf65840..66dd4092aa 100644 --- a/components/esp_driver_gpio/include/esp_private/gpio.h +++ b/components/esp_driver_gpio/include/esp_private/gpio.h @@ -7,9 +7,9 @@ #pragma once #include "sdkconfig.h" -#include - +#include "esp_types.h" #include "soc/soc_caps.h" +#include "soc/io_mux_reg.h" #include "driver/gpio.h" #ifdef __cplusplus diff --git a/components/esp_driver_i2c/i2c_common.c b/components/esp_driver_i2c/i2c_common.c index c8da8c554d..35c47c6dc5 100644 --- a/components/esp_driver_i2c/i2c_common.c +++ b/components/esp_driver_i2c/i2c_common.c @@ -18,7 +18,6 @@ #include "esp_pm.h" #include "freertos/FreeRTOS.h" #include "hal/i2c_hal.h" -#include "hal/gpio_hal.h" #include "esp_private/periph_ctrl.h" #include "esp_rom_gpio.h" #include "i2c_private.h" diff --git a/components/esp_driver_i2c/i2c_master.c b/components/esp_driver_i2c/i2c_master.c index 729ae7369e..36863b2bc0 100644 --- a/components/esp_driver_i2c/i2c_master.c +++ b/components/esp_driver_i2c/i2c_master.c @@ -30,7 +30,6 @@ #include "clk_ctrl_os.h" #include "hal/i2c_types.h" #include "hal/i2c_hal.h" -#include "hal/gpio_hal.h" #include "esp_memory_utils.h" #include "freertos/idf_additions.h" diff --git a/components/esp_driver_i2c/i2c_slave.c b/components/esp_driver_i2c/i2c_slave.c index a0ed0996c7..2d030049d8 100644 --- a/components/esp_driver_i2c/i2c_slave.c +++ b/components/esp_driver_i2c/i2c_slave.c @@ -17,7 +17,6 @@ #include "soc/i2c_periph.h" #include "esp_rom_gpio.h" #include "driver/gpio.h" -#include "hal/gpio_ll.h" #include "clk_ctrl_os.h" #include "esp_private/esp_clk.h" #include "driver/i2c_slave.h" diff --git a/components/esp_driver_i2c/i2c_slave_v2.c b/components/esp_driver_i2c/i2c_slave_v2.c index 017a2454d7..fde957129c 100644 --- a/components/esp_driver_i2c/i2c_slave_v2.c +++ b/components/esp_driver_i2c/i2c_slave_v2.c @@ -12,7 +12,6 @@ #include "esp_attr.h" #include "esp_rom_gpio.h" #include "driver/gpio.h" -#include "hal/gpio_ll.h" #include "esp_err.h" #include "freertos/FreeRTOS.h" #include "freertos/semphr.h" diff --git a/components/esp_driver_i2s/i2s_common.c b/components/esp_driver_i2s/i2s_common.c index 05637081d0..cbd12c70d6 100644 --- a/components/esp_driver_i2s/i2s_common.c +++ b/components/esp_driver_i2s/i2s_common.c @@ -23,7 +23,6 @@ #include "soc/i2s_periph.h" #include "soc/soc_caps.h" -#include "hal/gpio_hal.h" #include "hal/i2s_hal.h" #include "hal/hal_utils.h" #include "hal/dma_types.h" diff --git a/components/esp_driver_i2s/test_apps/i2s/main/test_i2s.c b/components/esp_driver_i2s/test_apps/i2s/main/test_i2s.c index e696369997..926d7cba85 100644 --- a/components/esp_driver_i2s/test_apps/i2s/main/test_i2s.c +++ b/components/esp_driver_i2s/test_apps/i2s/main/test_i2s.c @@ -13,7 +13,6 @@ #include "freertos/semphr.h" #include "sdkconfig.h" #include "driver/gpio.h" -#include "hal/gpio_hal.h" #include "hal/dma_types.h" #include "esp_private/gpio.h" #include "esp_err.h" diff --git a/components/esp_driver_ledc/src/ledc.c b/components/esp_driver_ledc/src/ledc.c index 904e708d36..d69a8434ed 100644 --- a/components/esp_driver_ledc/src/ledc.c +++ b/components/esp_driver_ledc/src/ledc.c @@ -16,7 +16,6 @@ #include "esp_clk_tree.h" #include "soc/soc_caps.h" #include "hal/ledc_hal.h" -#include "hal/gpio_hal.h" #include "driver/ledc.h" #include "esp_rom_gpio.h" #include "clk_ctrl_os.h" diff --git a/components/esp_driver_ledc/test_apps/ledc/main/test_ledc.c b/components/esp_driver_ledc/test_apps/ledc/main/test_ledc.c index 226232911d..0c38ae8425 100644 --- a/components/esp_driver_ledc/test_apps/ledc/main/test_ledc.c +++ b/components/esp_driver_ledc/test_apps/ledc/main/test_ledc.c @@ -14,7 +14,6 @@ #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "unity.h" -#include "hal/gpio_ll.h" #include "soc/gpio_periph.h" #include "soc/io_mux_reg.h" #include "esp_system.h" diff --git a/components/esp_driver_mcpwm/include/driver/mcpwm_cap.h b/components/esp_driver_mcpwm/include/driver/mcpwm_cap.h index a56d903bc3..cea95622d8 100644 --- a/components/esp_driver_mcpwm/include/driver/mcpwm_cap.h +++ b/components/esp_driver_mcpwm/include/driver/mcpwm_cap.h @@ -146,11 +146,7 @@ typedef struct { struct extra_capture_channel_flags { uint32_t pos_edge: 1; /*!< Whether to capture on positive edge */ uint32_t neg_edge: 1; /*!< Whether to capture on negative edge */ - uint32_t pull_up: 1; /*!< Whether to pull up internally */ - uint32_t pull_down: 1; /*!< Whether to pull down internally */ uint32_t invert_cap_signal: 1; /*!< Invert the input capture signal */ - uint32_t io_loop_back: 1; /*!< For debug/test, the signal output from the GPIO will be fed to the input path as well */ - uint32_t keep_io_conf_at_exit: 1 __attribute__((deprecated)); /*!< Deprecated. Driver won't change the GPIO configuration in deinilization. */ } flags; /*!< Extra configuration flags for capture channel */ } mcpwm_capture_channel_config_t; diff --git a/components/esp_driver_mcpwm/include/driver/mcpwm_fault.h b/components/esp_driver_mcpwm/include/driver/mcpwm_fault.h index ae289b58cd..5ab70c6dca 100644 --- a/components/esp_driver_mcpwm/include/driver/mcpwm_fault.h +++ b/components/esp_driver_mcpwm/include/driver/mcpwm_fault.h @@ -26,9 +26,6 @@ typedef struct { int gpio_num; /*!< GPIO used by the fault signal */ struct { uint32_t active_level: 1; /*!< On which level the fault signal is treated as active */ - uint32_t io_loop_back: 1; /*!< For debug/test, the signal output from the GPIO will be fed to the input path as well */ - uint32_t pull_up: 1; /*!< Whether to pull up internally */ - uint32_t pull_down: 1; /*!< Whether to pull down internally */ } flags; /*!< Extra configuration flags for GPIO fault */ } mcpwm_gpio_fault_config_t; diff --git a/components/esp_driver_mcpwm/include/driver/mcpwm_gen.h b/components/esp_driver_mcpwm/include/driver/mcpwm_gen.h index 1924c83b68..dd3cf089c3 100644 --- a/components/esp_driver_mcpwm/include/driver/mcpwm_gen.h +++ b/components/esp_driver_mcpwm/include/driver/mcpwm_gen.h @@ -23,10 +23,6 @@ typedef struct { int gen_gpio_num; /*!< The GPIO number used to output the PWM signal */ struct { uint32_t invert_pwm: 1; /*!< Whether to invert the PWM signal (done by GPIO matrix) */ - uint32_t io_loop_back: 1; /*!< For debug/test, the signal output from the GPIO will be fed to the input path as well */ - uint32_t io_od_mode: 1; /*!< Configure the GPIO as open-drain mode */ - uint32_t pull_up: 1; /*!< Whether to pull up internally */ - uint32_t pull_down: 1; /*!< Whether to pull down internally */ } flags; /*!< Extra configuration flags for generator */ } mcpwm_generator_config_t; diff --git a/components/esp_driver_mcpwm/include/driver/mcpwm_sync.h b/components/esp_driver_mcpwm/include/driver/mcpwm_sync.h index ac4c8e204b..5158a3fd7e 100644 --- a/components/esp_driver_mcpwm/include/driver/mcpwm_sync.h +++ b/components/esp_driver_mcpwm/include/driver/mcpwm_sync.h @@ -48,9 +48,6 @@ typedef struct { int gpio_num; /*!< GPIO used by sync source */ struct { uint32_t active_neg: 1; /*!< Whether the sync signal is active on negedge, by default, the sync signal's posedge is treated as active */ - uint32_t io_loop_back: 1; /*!< For debug/test, the signal output from the GPIO will be fed to the input path as well */ - uint32_t pull_up: 1; /*!< Whether to pull up internally */ - uint32_t pull_down: 1; /*!< Whether to pull down internally */ } flags; /*!< Extra configuration flags for GPIO sync source */ } mcpwm_gpio_sync_src_config_t; diff --git a/components/esp_driver_mcpwm/src/mcpwm_cap.c b/components/esp_driver_mcpwm/src/mcpwm_cap.c index c46e919fb6..0943fc4d5f 100644 --- a/components/esp_driver_mcpwm/src/mcpwm_cap.c +++ b/components/esp_driver_mcpwm/src/mcpwm_cap.c @@ -11,7 +11,6 @@ #include "driver/mcpwm_cap.h" #include "driver/gpio.h" #include "esp_private/gpio.h" -#include "hal/gpio_ll.h" static void mcpwm_capture_default_isr(void *args); @@ -289,21 +288,6 @@ esp_err_t mcpwm_new_capture_channel(mcpwm_cap_timer_handle_t cap_timer, const mc gpio_func_sel(config->gpio_num, PIN_FUNC_GPIO); gpio_input_enable(config->gpio_num); esp_rom_gpio_connect_in_signal(config->gpio_num, mcpwm_periph_signals.groups[group->group_id].captures[cap_chan_id].cap_sig, 0); - if (config->flags.pull_down) { - gpio_pulldown_en(config->gpio_num); - } else { - gpio_pulldown_dis(config->gpio_num); - } - if (config->flags.pull_up) { - gpio_pullup_en(config->gpio_num); - } else { - gpio_pullup_dis(config->gpio_num); - } - - // deprecated, to be removed in in esp-idf v6.0 - if (config->flags.io_loop_back) { - gpio_ll_output_enable(&GPIO, config->gpio_num); - } } cap_chan->gpio_num = config->gpio_num; diff --git a/components/esp_driver_mcpwm/src/mcpwm_fault.c b/components/esp_driver_mcpwm/src/mcpwm_fault.c index 0afeb85fa8..6ff5a64b71 100644 --- a/components/esp_driver_mcpwm/src/mcpwm_fault.c +++ b/components/esp_driver_mcpwm/src/mcpwm_fault.c @@ -6,7 +6,6 @@ #include "mcpwm_private.h" #include "esp_memory_utils.h" -#include "hal/gpio_hal.h" #include "driver/mcpwm_fault.h" #include "driver/gpio.h" #include "esp_private/gpio.h" @@ -96,22 +95,6 @@ esp_err_t mcpwm_new_gpio_fault(const mcpwm_gpio_fault_config_t *config, mcpwm_fa gpio_input_enable(config->gpio_num); esp_rom_gpio_connect_in_signal(config->gpio_num, mcpwm_periph_signals.groups[group_id].gpio_faults[fault_id].fault_sig, 0); - if (config->flags.pull_down) { - gpio_pulldown_en(config->gpio_num); - } else { - gpio_pulldown_dis(config->gpio_num); - } - if (config->flags.pull_up) { - gpio_pullup_en(config->gpio_num); - } else { - gpio_pullup_dis(config->gpio_num); - } - - // deprecated, to be removed in in esp-idf v6.0 - if (config->flags.io_loop_back) { - gpio_ll_output_enable(&GPIO, config->gpio_num); - } - // set fault detection polarity // different gpio faults share the same config register, using a group level spin lock portENTER_CRITICAL(&group->spinlock); diff --git a/components/esp_driver_mcpwm/src/mcpwm_gen.c b/components/esp_driver_mcpwm/src/mcpwm_gen.c index 01c7f9ffbe..3c82f2c612 100644 --- a/components/esp_driver_mcpwm/src/mcpwm_gen.c +++ b/components/esp_driver_mcpwm/src/mcpwm_gen.c @@ -5,7 +5,6 @@ */ #include "mcpwm_private.h" -#include "hal/gpio_hal.h" #include "driver/gpio.h" #include "driver/mcpwm_gen.h" #include "esp_private/esp_gpio_reserve.h" @@ -82,14 +81,6 @@ esp_err_t mcpwm_new_generator(mcpwm_oper_handle_t oper, const mcpwm_generator_co mcpwm_periph_signals.groups[group->group_id].operators[oper_id].generators[gen_id].pwm_sig, config->flags.invert_pwm, 0); - // deprecated, to be removed in in esp-idf v6.0 - if (config->flags.io_loop_back) { - gpio_ll_input_enable(&GPIO, config->gen_gpio_num); - } - if (config->flags.io_od_mode) { - gpio_ll_od_enable(&GPIO, config->gen_gpio_num); - } - // fill in other generator members gen->gen_gpio_num = config->gen_gpio_num; gen->spinlock = (portMUX_TYPE)portMUX_INITIALIZER_UNLOCKED; diff --git a/components/esp_driver_mcpwm/src/mcpwm_private.h b/components/esp_driver_mcpwm/src/mcpwm_private.h index 6871184965..1df2088491 100644 --- a/components/esp_driver_mcpwm/src/mcpwm_private.h +++ b/components/esp_driver_mcpwm/src/mcpwm_private.h @@ -25,7 +25,6 @@ #include "esp_intr_alloc.h" #include "esp_heap_caps.h" #include "esp_pm.h" -#include "soc/io_mux_reg.h" #include "soc/mcpwm_periph.h" #include "hal/mcpwm_hal.h" #include "hal/mcpwm_ll.h" diff --git a/components/esp_driver_mcpwm/src/mcpwm_sync.c b/components/esp_driver_mcpwm/src/mcpwm_sync.c index 92f295cadf..c51a4392bb 100644 --- a/components/esp_driver_mcpwm/src/mcpwm_sync.c +++ b/components/esp_driver_mcpwm/src/mcpwm_sync.c @@ -5,7 +5,6 @@ */ #include "mcpwm_private.h" -#include "hal/gpio_hal.h" #include "driver/mcpwm_sync.h" #include "driver/gpio.h" #include "esp_private/gpio.h" @@ -176,22 +175,6 @@ esp_err_t mcpwm_new_gpio_sync_src(const mcpwm_gpio_sync_src_config_t *config, mc esp_rom_gpio_connect_in_signal(config->gpio_num, mcpwm_periph_signals.groups[group_id].gpio_synchros[sync_id].sync_sig, 0); - if (config->flags.pull_down) { - gpio_pulldown_en(config->gpio_num); - } else { - gpio_pulldown_dis(config->gpio_num); - } - if (config->flags.pull_up) { - gpio_pullup_en(config->gpio_num); - } else { - gpio_pullup_dis(config->gpio_num); - } - - // deprecated, to be removed in in esp-idf v6.0 - if (config->flags.io_loop_back) { - gpio_ll_output_enable(&GPIO, config->gpio_num); - } - // different ext sync share the same config register, using a group level spin lock portENTER_CRITICAL(&group->spinlock); mcpwm_ll_invert_gpio_sync_input(group->hal.dev, sync_id, config->flags.active_neg); diff --git a/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_cap.c b/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_cap.c index 8c01654f4f..d711edad1e 100644 --- a/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_cap.c +++ b/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_cap.c @@ -38,7 +38,6 @@ TEST_CASE("mcpwm_capture_install_uninstall", "[mcpwm]") .gpio_num = TEST_CAP_GPIO, .prescale = 2, .flags.pos_edge = true, - .flags.pull_up = true, }; mcpwm_cap_channel_handle_t cap_channels[total_cap_timers][SOC_MCPWM_CAPTURE_CHANNELS_PER_TIMER]; for (int i = 0; i < total_cap_timers; i++) { @@ -98,7 +97,6 @@ TEST_CASE("mcpwm_capture_ext_gpio", "[mcpwm]") .prescale = 1, .flags.pos_edge = true, .flags.neg_edge = true, - .flags.pull_up = true, }; TEST_ESP_OK(mcpwm_new_capture_channel(cap_timer, &cap_chan_config, &pps_channel)); diff --git a/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_fault.c b/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_fault.c index 2dc14b34d3..f46f431c9d 100644 --- a/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_fault.c +++ b/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_fault.c @@ -72,7 +72,6 @@ TEST_CASE("mcpwm_gpio_fault_event_callbacks", "[mcpwm]") .group_id = 0, .gpio_num = fault_gpio, .flags.active_level = true, // active on high level - .flags.pull_down = true, }; TEST_ESP_OK(mcpwm_new_gpio_fault(&gpio_fault_config, &fault)); diff --git a/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_gen.c b/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_gen.c index 1182f74e7d..445031599f 100644 --- a/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_gen.c +++ b/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_gen.c @@ -1018,8 +1018,6 @@ TEST_CASE("mcpwm_generator_action_on_fault_trigger_event", "[mcpwm]") mcpwm_gpio_fault_config_t gpio_trigger_config = { .group_id = 0, .flags.active_level = 1, - .flags.pull_down = 1, - .flags.pull_up = 0, }; for (int i = 0 ; i < 3; i++) { gpio_trigger_config.gpio_num = fault_gpio_num[i]; @@ -1253,7 +1251,6 @@ TEST_CASE("mcpwm_generator_action_on_gpio_sync_trigger_event", "[mcpwm]") mcpwm_gpio_sync_src_config_t gpio_sync_config = { .group_id = 0, .gpio_num = sync_gpio, - .flags.pull_down = true, // internally pull down }; TEST_ESP_OK(mcpwm_new_gpio_sync_src(&gpio_sync_config, &gpio_sync)); diff --git a/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_iram.c b/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_iram.c index 24744463ba..131f9ae258 100644 --- a/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_iram.c +++ b/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_iram.c @@ -63,7 +63,6 @@ TEST_CASE("mcpwm_capture_iram_safe", "[mcpwm]") .prescale = 1, .flags.pos_edge = true, .flags.neg_edge = true, - .flags.pull_up = true, }; TEST_ESP_OK(mcpwm_new_capture_channel(cap_timer, &cap_chan_config, &pps_channel)); diff --git a/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_oper.c b/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_oper.c index ce2523d7fb..a86c7067d0 100644 --- a/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_oper.c +++ b/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_oper.c @@ -167,7 +167,6 @@ TEST_CASE("mcpwm_operator_brake_on_gpio_fault", "[mcpwm]") mcpwm_gpio_fault_config_t gpio_fault_config = { .group_id = 0, .flags.active_level = 1, - .flags.pull_down = true, }; mcpwm_fault_handle_t gpio_cbc_fault = NULL; mcpwm_fault_handle_t gpio_ost_fault = NULL; diff --git a/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_sync.c b/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_sync.c index d8bc8e4aaf..33e51cbe77 100644 --- a/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_sync.c +++ b/components/esp_driver_mcpwm/test_apps/mcpwm/main/test_mcpwm_sync.c @@ -137,7 +137,6 @@ TEST_CASE("mcpwm_gpio_sync_timer_phase_lock", "[mcpwm]") mcpwm_gpio_sync_src_config_t gpio_sync_config = { .group_id = 0, .gpio_num = gpio_num, - .flags.pull_down = true, // internally pull down }; TEST_ESP_OK(mcpwm_new_gpio_sync_src(&gpio_sync_config, &gpio_sync_src)); // put the GPIO into initial state diff --git a/components/esp_driver_parlio/include/driver/parlio_rx.h b/components/esp_driver_parlio/include/driver/parlio_rx.h index 9774d871b4..022bd6578c 100644 --- a/components/esp_driver_parlio/include/driver/parlio_rx.h +++ b/components/esp_driver_parlio/include/driver/parlio_rx.h @@ -39,8 +39,6 @@ typedef struct { uint32_t clk_gate_en : 1; /*!< Enable RX clock gating, only available when the clock direction is output(not supported on ESP32-C6) the output clock will be controlled by the valid gpio, i.e. high level of valid gpio to enable the clock output, low to disable */ - uint32_t io_loop_back: 1; /*!< For debug/test, the signal output from the GPIO will be fed to the input path as well */ - uint32_t io_no_init: 1 __attribute__((deprecated)); /*!< Deprecated. Driver won't change the GPIO configuration in inilization. */ uint32_t allow_pd: 1; /*!< Set to allow power down. When this flag set, the driver will backup/restore the PARLIO registers before/after entering/exist sleep mode. By this approach, the system can power off PARLIO's power domain. This can save power, but at the expense of more RAM being consumed. */ diff --git a/components/esp_driver_parlio/include/driver/parlio_tx.h b/components/esp_driver_parlio/include/driver/parlio_tx.h index 933d8b81a9..1e5ac6e9b5 100644 --- a/components/esp_driver_parlio/include/driver/parlio_tx.h +++ b/components/esp_driver_parlio/include/driver/parlio_tx.h @@ -41,7 +41,6 @@ typedef struct { uint32_t clk_gate_en: 1; /*!< Enable TX clock gating, the output clock will be controlled by the MSB bit of the data bus, i.e. by data_gpio_nums[PARLIO_TX_UNIT_MAX_DATA_WIDTH-1]. High level to enable the clock output, low to disable */ - uint32_t io_loop_back: 1; /*!< For debug/test, the signal output from the GPIO will be fed to the input path as well */ uint32_t allow_pd: 1; /*!< Set to allow power down. When this flag set, the driver will backup/restore the PARLIO registers before/after entering/exist sleep mode. By this approach, the system can power off PARLIO's power domain. This can save power, but at the expense of more RAM being consumed. */ diff --git a/components/esp_driver_parlio/src/parlio_priv.h b/components/esp_driver_parlio/src/parlio_priv.h index 0533633829..a44515f1a9 100644 --- a/components/esp_driver_parlio/src/parlio_priv.h +++ b/components/esp_driver_parlio/src/parlio_priv.h @@ -28,7 +28,6 @@ #include "freertos/idf_additions.h" #include "soc/soc_caps.h" #include "soc/gdma_channel.h" -#include "soc/io_mux_reg.h" #include "soc/parlio_periph.h" #include "hal/parlio_types.h" #include "hal/parlio_hal.h" diff --git a/components/esp_driver_parlio/src/parlio_rx.c b/components/esp_driver_parlio/src/parlio_rx.c index c06027101e..de86eb6f47 100644 --- a/components/esp_driver_parlio/src/parlio_rx.c +++ b/components/esp_driver_parlio/src/parlio_rx.c @@ -246,12 +246,6 @@ static esp_err_t parlio_rx_unit_set_gpio(parlio_rx_unit_handle_t rx_unit, const ESP_RETURN_ON_FALSE(config->clk_in_gpio_num >= 0, ESP_ERR_INVALID_ARG, TAG, "clk_in_gpio_num must be set while the clock input from external"); /* Connect the clock in signal to the GPIO matrix if it is set */ gpio_input_enable(config->clk_in_gpio_num); - - // deprecated, to be removed in in esp-idf v6.0 - if (config->flags.io_loop_back) { - gpio_output_enable(config->clk_in_gpio_num); - } - esp_rom_gpio_connect_in_signal(config->clk_in_gpio_num, parlio_periph_signals.groups[group_id].rx_units[unit_id].clk_in_sig, false); } @@ -260,12 +254,6 @@ static esp_err_t parlio_rx_unit_set_gpio(parlio_rx_unit_handle_t rx_unit, const if (config->clk_out_gpio_num >= 0) { #if SOC_PARLIO_RX_CLK_SUPPORT_OUTPUT gpio_func_sel(config->clk_out_gpio_num, PIN_FUNC_GPIO); - - // deprecated, to be removed in in esp-idf v6.0 - if (config->flags.io_loop_back) { - gpio_input_enable(config->clk_out_gpio_num); - } - // connect the signal to the GPIO by matrix, it will also enable the output path properly esp_rom_gpio_connect_out_signal(config->clk_out_gpio_num, parlio_periph_signals.groups[group_id].rx_units[unit_id].clk_out_sig, false, false); @@ -277,12 +265,6 @@ static esp_err_t parlio_rx_unit_set_gpio(parlio_rx_unit_handle_t rx_unit, const /* Initialize the valid GPIO as input */ if (config->valid_gpio_num >= 0) { gpio_input_enable(config->valid_gpio_num); - - // deprecated, to be removed in in esp-idf v6.0 - if (config->flags.io_loop_back) { - gpio_output_enable(config->valid_gpio_num); - } - /* Not connect the signal here, the signal is lazy connected until the delimiter takes effect */ } @@ -291,12 +273,6 @@ static esp_err_t parlio_rx_unit_set_gpio(parlio_rx_unit_handle_t rx_unit, const /* Loop the data_gpio_nums to connect data and valid signals via GPIO matrix */ if (config->data_gpio_nums[i] >= 0) { gpio_input_enable(config->data_gpio_nums[i]); - - // deprecated, to be removed in in esp-idf v6.0 - if (config->flags.io_loop_back) { - gpio_output_enable(config->data_gpio_nums[i]); - } - esp_rom_gpio_connect_in_signal(config->data_gpio_nums[i], parlio_periph_signals.groups[group_id].rx_units[unit_id].data_sigs[i], false); } else { diff --git a/components/esp_driver_parlio/src/parlio_tx.c b/components/esp_driver_parlio/src/parlio_tx.c index ed3a1a5f2f..5b3ff50272 100644 --- a/components/esp_driver_parlio/src/parlio_tx.c +++ b/components/esp_driver_parlio/src/parlio_tx.c @@ -87,12 +87,6 @@ static esp_err_t parlio_tx_unit_configure_gpio(parlio_tx_unit_t *tx_unit, const for (size_t i = 0; i < config->data_width; i++) { if (config->data_gpio_nums[i] >= 0) { gpio_func_sel(config->data_gpio_nums[i], PIN_FUNC_GPIO); - - // deprecated, to be removed in in esp-idf v6.0 - if (config->flags.io_loop_back) { - gpio_input_enable(config->data_gpio_nums[i]); - } - // connect the signal to the GPIO by matrix, it will also enable the output path properly esp_rom_gpio_connect_out_signal(config->data_gpio_nums[i], parlio_periph_signals.groups[group_id].tx_units[unit_id].data_sigs[i], false, false); @@ -102,10 +96,6 @@ static esp_err_t parlio_tx_unit_configure_gpio(parlio_tx_unit_t *tx_unit, const if (config->valid_gpio_num >= 0) { gpio_func_sel(config->valid_gpio_num, PIN_FUNC_GPIO); - // deprecated, to be removed in in esp-idf v6.0 - if (config->flags.io_loop_back) { - gpio_input_enable(config->valid_gpio_num); - } #if !PARLIO_LL_TX_DATA_LINE_AS_VALID_SIG // Configure CS signal if supported // Note: the default value of CS signal is low, so we need to invert the CS to keep compatible with the default value @@ -123,24 +113,12 @@ static esp_err_t parlio_tx_unit_configure_gpio(parlio_tx_unit_t *tx_unit, const } if (config->clk_out_gpio_num >= 0) { gpio_func_sel(config->clk_out_gpio_num, PIN_FUNC_GPIO); - - // deprecated, to be removed in in esp-idf v6.0 - if (config->flags.io_loop_back) { - gpio_input_enable(config->clk_out_gpio_num); - } - // connect the signal to the GPIO by matrix, it will also enable the output path properly esp_rom_gpio_connect_out_signal(config->clk_out_gpio_num, parlio_periph_signals.groups[group_id].tx_units[unit_id].clk_out_sig, false, false); } if (config->clk_in_gpio_num >= 0) { gpio_input_enable(config->clk_in_gpio_num); - - // deprecated, to be removed in in esp-idf v6.0 - if (config->flags.io_loop_back) { - gpio_output_enable(config->clk_in_gpio_num); - } - esp_rom_gpio_connect_in_signal(config->clk_in_gpio_num, parlio_periph_signals.groups[group_id].tx_units[unit_id].clk_in_sig, false); } diff --git a/components/esp_driver_parlio/test_apps/parlio/main/test_parlio_rx.c b/components/esp_driver_parlio/test_apps/parlio/main/test_parlio_rx.c index cc454aa7b4..e7238656bf 100644 --- a/components/esp_driver_parlio/test_apps/parlio/main/test_parlio_rx.c +++ b/components/esp_driver_parlio/test_apps/parlio/main/test_parlio_rx.c @@ -16,7 +16,6 @@ #include "driver/i2s_tdm.h" #include "driver/spi_master.h" #include "driver/gpio.h" -#include "hal/gpio_hal.h" #include "hal/cache_hal.h" #include "hal/cache_ll.h" #include "soc/soc_caps.h" diff --git a/components/esp_driver_pcnt/include/driver/pulse_cnt.h b/components/esp_driver_pcnt/include/driver/pulse_cnt.h index 53673b483a..98accc1be3 100644 --- a/components/esp_driver_pcnt/include/driver/pulse_cnt.h +++ b/components/esp_driver_pcnt/include/driver/pulse_cnt.h @@ -76,16 +76,13 @@ typedef struct { * @brief PCNT channel configuration */ typedef struct { - int edge_gpio_num; /*!< GPIO number used by the edge signal, input mode with pull up enabled. Set to -1 if unused */ - int level_gpio_num; /*!< GPIO number used by the level signal, input mode with pull up enabled. Set to -1 if unused */ + int edge_gpio_num; /*!< GPIO number used by the edge signal. Set to -1 if unused */ + int level_gpio_num; /*!< GPIO number used by the level signal. Set to -1 if unused */ struct { uint32_t invert_edge_input: 1; /*!< Invert the input edge signal */ uint32_t invert_level_input: 1; /*!< Invert the input level signal */ uint32_t virt_edge_io_level: 1; /*!< Virtual edge IO level, 0: low, 1: high. Only valid when edge_gpio_num is set to -1 */ uint32_t virt_level_io_level: 1; /*!< Virtual level IO level, 0: low, 1: high. Only valid when level_gpio_num is set to -1 */ - uint32_t io_loop_back: 1; /*!< For debug/test, the signal output from the GPIO will be fed to the input path as well. - Note that this flag is deprecated, will be removed in IDF v6.0. - Instead, you can configure the output mode by calling gpio_config() first, and then do PCNT channel configuration. Necessary configurations for the IO to be used as the PCNT input will be appended. */ } flags; /*!< Channel config flags */ } pcnt_chan_config_t; @@ -147,12 +144,9 @@ esp_err_t pcnt_unit_set_glitch_filter(pcnt_unit_handle_t unit, const pcnt_glitch * @brief PCNT clear signal configuration */ typedef struct { - int clear_signal_gpio_num; /*!< GPIO number used by the clear signal, the default active level is high, input mode with pull down enabled */ + int clear_signal_gpio_num; /*!< GPIO number used by the clear signal, the default active level is high */ struct { - uint32_t invert_clear_signal: 1; /*!< Invert the clear input signal and set input mode with pull up */ - uint32_t io_loop_back: 1; /*!< For debug/test, the signal output from the GPIO will be fed to the input path as well. - Note that this flag is deprecated, will be removed in IDF v6.0. - Instead, you can configure the output mode by calling gpio_config() first, and then do PCNT channel configuration. Necessary configurations for the IO to be used as the PCNT input will be appended. */ + uint32_t invert_clear_signal: 1; /*!< Invert the clear input signal */ } flags; /*!< clear signal config flags */ } pcnt_clear_signal_config_t; diff --git a/components/esp_driver_pcnt/src/pulse_cnt.c b/components/esp_driver_pcnt/src/pulse_cnt.c index f9cc421ff2..c266e96587 100644 --- a/components/esp_driver_pcnt/src/pulse_cnt.c +++ b/components/esp_driver_pcnt/src/pulse_cnt.c @@ -25,13 +25,11 @@ #include "soc/gpio_pins.h" #include "hal/pcnt_hal.h" #include "hal/pcnt_ll.h" -#include "hal/gpio_hal.h" #include "esp_private/esp_clk.h" #include "esp_private/periph_ctrl.h" #include "esp_private/sleep_retention.h" #include "driver/gpio.h" #include "esp_private/gpio.h" -#include "hal/gpio_ll.h" // for io_loop_back flag only #include "driver/pulse_cnt.h" #include "esp_memory_utils.h" @@ -324,8 +322,6 @@ esp_err_t pcnt_del_unit(pcnt_unit_handle_t unit) if (unit->clear_signal_gpio_num >= 0) { uint32_t clear_signal_idx = pcnt_periph_signals.groups[group_id].units[unit_id].clear_sig; esp_rom_gpio_connect_in_signal(GPIO_MATRIX_CONST_ZERO_INPUT, clear_signal_idx, 0); - gpio_pullup_dis(unit->clear_signal_gpio_num); - gpio_pulldown_dis(unit->clear_signal_gpio_num); } #endif // SOC_PCNT_SUPPORT_CLEAR_SIGNAL @@ -348,27 +344,13 @@ esp_err_t pcnt_unit_set_clear_signal(pcnt_unit_handle_t unit, const pcnt_clear_s int io_num = config->clear_signal_gpio_num; ESP_RETURN_ON_FALSE(GPIO_IS_VALID_GPIO(io_num), ESP_ERR_INVALID_ARG, TAG, "gpio num is invalid"); - if (!config->flags.invert_clear_signal) { - gpio_pulldown_en(io_num); - gpio_pullup_dis(io_num); - } else { - gpio_pullup_en(io_num); - gpio_pulldown_dis(io_num); - } gpio_func_sel(io_num, PIN_FUNC_GPIO); gpio_input_enable(io_num); esp_rom_gpio_connect_in_signal(io_num, clear_signal_idx, config->flags.invert_clear_signal); unit->clear_signal_gpio_num = config->clear_signal_gpio_num; - - // io_loop_back is a deprecated flag, workaround for compatibility - if (config->flags.io_loop_back) { - gpio_ll_output_enable(&GPIO, io_num); - } } else { ESP_RETURN_ON_FALSE(unit->clear_signal_gpio_num >= 0, ESP_ERR_INVALID_STATE, TAG, "clear signal not set yet"); esp_rom_gpio_connect_in_signal(GPIO_MATRIX_CONST_ZERO_INPUT, clear_signal_idx, 0); - gpio_pullup_dis(unit->clear_signal_gpio_num); - gpio_pulldown_dis(unit->clear_signal_gpio_num); unit->clear_signal_gpio_num = -1; } return ESP_OK; @@ -785,18 +767,11 @@ esp_err_t pcnt_new_channel(pcnt_unit_handle_t unit, const pcnt_chan_config_t *co // GPIO configuration if (config->edge_gpio_num >= 0) { - gpio_pullup_en(config->edge_gpio_num); - gpio_pulldown_dis(config->edge_gpio_num); gpio_func_sel(config->edge_gpio_num, PIN_FUNC_GPIO); gpio_input_enable(config->edge_gpio_num); esp_rom_gpio_connect_in_signal(config->edge_gpio_num, pcnt_periph_signals.groups[group_id].units[unit_id].channels[channel_id].pulse_sig, config->flags.invert_edge_input); - - // io_loop_back is a deprecated flag, workaround for compatibility - if (config->flags.io_loop_back) { - gpio_ll_output_enable(&GPIO, config->edge_gpio_num); - } } else { // using virtual IO esp_rom_gpio_connect_in_signal(config->flags.virt_edge_io_level ? GPIO_MATRIX_CONST_ONE_INPUT : GPIO_MATRIX_CONST_ZERO_INPUT, @@ -805,18 +780,11 @@ esp_err_t pcnt_new_channel(pcnt_unit_handle_t unit, const pcnt_chan_config_t *co } if (config->level_gpio_num >= 0) { - gpio_pullup_en(config->level_gpio_num); - gpio_pulldown_dis(config->level_gpio_num); gpio_func_sel(config->level_gpio_num, PIN_FUNC_GPIO); gpio_input_enable(config->level_gpio_num); esp_rom_gpio_connect_in_signal(config->level_gpio_num, pcnt_periph_signals.groups[group_id].units[unit_id].channels[channel_id].control_sig, config->flags.invert_level_input); - - // io_loop_back is a deprecated flag, workaround for compatibility - if (config->flags.io_loop_back) { - gpio_ll_output_enable(&GPIO, config->level_gpio_num); - } } else { // using virtual IO esp_rom_gpio_connect_in_signal(config->flags.virt_level_io_level ? GPIO_MATRIX_CONST_ONE_INPUT : GPIO_MATRIX_CONST_ZERO_INPUT, @@ -856,15 +824,11 @@ esp_err_t pcnt_del_channel(pcnt_channel_handle_t chan) esp_rom_gpio_connect_in_signal(GPIO_MATRIX_CONST_ONE_INPUT, pcnt_periph_signals.groups[group_id].units[unit_id].channels[channel_id].control_sig, 0); - gpio_pullup_dis(chan->level_gpio_num); - gpio_pulldown_dis(chan->level_gpio_num); } if (chan->edge_gpio_num >= 0) { esp_rom_gpio_connect_in_signal(GPIO_MATRIX_CONST_ONE_INPUT, pcnt_periph_signals.groups[group_id].units[unit_id].channels[channel_id].pulse_sig, 0); - gpio_pullup_dis(chan->edge_gpio_num); - gpio_pulldown_dis(chan->edge_gpio_num); } free(chan); diff --git a/components/esp_driver_rmt/include/driver/rmt_rx.h b/components/esp_driver_rmt/include/driver/rmt_rx.h index dab00bd96d..71f7a35235 100644 --- a/components/esp_driver_rmt/include/driver/rmt_rx.h +++ b/components/esp_driver_rmt/include/driver/rmt_rx.h @@ -41,7 +41,6 @@ typedef struct { struct { uint32_t invert_in: 1; /*!< Whether to invert the incoming RMT channel signal */ uint32_t with_dma: 1; /*!< If set, the driver will allocate an RMT channel with DMA capability */ - uint32_t io_loop_back: 1; /*!< For debug/test, the signal output from the GPIO will be fed to the input path as well */ uint32_t allow_pd: 1; /*!< If set, driver allows the power domain to be powered off when system enters sleep mode. This can save power, but at the expense of more RAM being consumed to save register context. */ } flags; /*!< RX channel config flags */ diff --git a/components/esp_driver_rmt/include/driver/rmt_tx.h b/components/esp_driver_rmt/include/driver/rmt_tx.h index aae80b7567..ebbd87ce22 100644 --- a/components/esp_driver_rmt/include/driver/rmt_tx.h +++ b/components/esp_driver_rmt/include/driver/rmt_tx.h @@ -42,8 +42,6 @@ typedef struct { struct { uint32_t invert_out: 1; /*!< Whether to invert the RMT channel signal before output to GPIO pad */ uint32_t with_dma: 1; /*!< If set, the driver will allocate an RMT channel with DMA capability */ - uint32_t io_loop_back: 1; /*!< The signal output from the GPIO will be fed to the input path as well */ - uint32_t io_od_mode: 1; /*!< Configure the GPIO as open-drain mode */ uint32_t allow_pd: 1; /*!< If set, driver allows the power domain to be powered off when system enters sleep mode. This can save power, but at the expense of more RAM being consumed to save register context. */ } flags; /*!< TX channel config flags */ diff --git a/components/esp_driver_rmt/src/rmt_rx.c b/components/esp_driver_rmt/src/rmt_rx.c index 31e481d3fb..6a4999ef7f 100644 --- a/components/esp_driver_rmt/src/rmt_rx.c +++ b/components/esp_driver_rmt/src/rmt_rx.c @@ -8,7 +8,6 @@ #include "esp_cache.h" #include "esp_rom_gpio.h" #include "soc/rmt_periph.h" -#include "hal/gpio_hal.h" #include "driver/gpio.h" #include "driver/rmt_rx.h" #include "rmt_private.h" @@ -294,17 +293,11 @@ esp_err_t rmt_new_rx_channel(const rmt_rx_channel_config_t *config, rmt_channel_ // GPIO Matrix/MUX configuration gpio_func_sel(config->gpio_num, PIN_FUNC_GPIO); gpio_input_enable(config->gpio_num); - gpio_pullup_en(config->gpio_num); esp_rom_gpio_connect_in_signal(config->gpio_num, rmt_periph_signals.groups[group_id].channels[channel_id + RMT_RX_CHANNEL_OFFSET_IN_GROUP].rx_sig, config->flags.invert_in); rx_channel->base.gpio_num = config->gpio_num; - // deprecated, to be removed in in esp-idf v6.0 - if (config->flags.io_loop_back) { - gpio_ll_output_enable(&GPIO, config->gpio_num); - } - // initialize other members of rx channel portMUX_INITIALIZE(&rx_channel->base.spinlock); atomic_init(&rx_channel->base.fsm, RMT_FSM_INIT); diff --git a/components/esp_driver_rmt/src/rmt_tx.c b/components/esp_driver_rmt/src/rmt_tx.c index cec8bc4c22..59be997ea5 100644 --- a/components/esp_driver_rmt/src/rmt_tx.c +++ b/components/esp_driver_rmt/src/rmt_tx.c @@ -7,7 +7,6 @@ #include "esp_rom_gpio.h" #include "esp_memory_utils.h" #include "soc/rtc.h" -#include "hal/gpio_hal.h" #include "esp_cache.h" #include "driver/gpio.h" #include "driver/rmt_tx.h" @@ -349,14 +348,6 @@ esp_err_t rmt_new_tx_channel(const rmt_tx_channel_config_t *config, rmt_channel_ config->flags.invert_out, false); tx_channel->base.gpio_num = config->gpio_num; - // deprecated, to be removed in in esp-idf v6.0 - if (config->flags.io_loop_back) { - gpio_ll_input_enable(&GPIO, config->gpio_num); - } - if (config->flags.io_od_mode) { - gpio_ll_od_enable(&GPIO, config->gpio_num); - } - portMUX_INITIALIZE(&tx_channel->base.spinlock); atomic_init(&tx_channel->base.fsm, RMT_FSM_INIT); tx_channel->base.hw_mem_base = &RMTMEM.channels[channel_id + RMT_TX_CHANNEL_OFFSET_IN_GROUP].symbols[0]; diff --git a/components/esp_driver_sdio/src/sdio_slave.c b/components/esp_driver_sdio/src/sdio_slave.c index c1256b069e..3767568463 100644 --- a/components/esp_driver_sdio/src/sdio_slave.c +++ b/components/esp_driver_sdio/src/sdio_slave.c @@ -85,7 +85,6 @@ The driver of FIFOs works as below: #include "esp_intr_alloc.h" #include "esp_log.h" #include "hal/sdio_slave_hal.h" -#include "hal/gpio_hal.h" #include "freertos/FreeRTOS.h" #include "freertos/semphr.h" #include "esp_private/periph_ctrl.h" diff --git a/components/esp_driver_sdm/include/driver/sdm.h b/components/esp_driver_sdm/include/driver/sdm.h index 52f270c191..3da5f04121 100644 --- a/components/esp_driver_sdm/include/driver/sdm.h +++ b/components/esp_driver_sdm/include/driver/sdm.h @@ -28,7 +28,6 @@ typedef struct { uint32_t sample_rate_hz; /*!< Over sample rate in Hz, it determines the frequency of the carrier pulses */ struct { uint32_t invert_out: 1; /*!< Whether to invert the output signal */ - uint32_t io_loop_back: 1; /*!< For debug/test, the signal output from the GPIO will be fed to the input path as well */ } flags; /*!< Extra flags */ } sdm_config_t; diff --git a/components/esp_driver_sdm/src/sdm.c b/components/esp_driver_sdm/src/sdm.c index 6db4d4c244..57c36a89e0 100644 --- a/components/esp_driver_sdm/src/sdm.c +++ b/components/esp_driver_sdm/src/sdm.c @@ -22,7 +22,6 @@ #include "esp_clk_tree.h" #include "driver/gpio.h" #include "driver/sdm.h" -#include "hal/gpio_hal.h" #include "hal/sdm_hal.h" #include "hal/sdm_ll.h" #include "hal/hal_utils.h" @@ -233,10 +232,6 @@ esp_err_t sdm_new_channel(const sdm_config_t *config, sdm_channel_handle_t *ret_ ESP_GOTO_ON_ERROR(io_mux_set_clock_source((soc_module_clk_t)(group->clk_src)), err, TAG, "set IO MUX clock source failed"); gpio_func_sel(config->gpio_num, PIN_FUNC_GPIO); - // deprecated, to be removed in in esp-idf v6.0 - if (config->flags.io_loop_back) { - gpio_input_enable(config->gpio_num); - } // connect the signal to the GPIO by matrix, it will also enable the output path properly esp_rom_gpio_connect_out_signal(config->gpio_num, sigma_delta_periph_signals.channels[chan_id].sd_sig, config->flags.invert_out, false); chan->gpio_num = config->gpio_num; diff --git a/components/esp_driver_sdmmc/Kconfig b/components/esp_driver_sdmmc/Kconfig index 06b3f2833c..da1b000128 100644 --- a/components/esp_driver_sdmmc/Kconfig +++ b/components/esp_driver_sdmmc/Kconfig @@ -1,4 +1,4 @@ -menu "ESP-Driver: SD Host SDMMC Controller Configurations" +menu "ESP-Driver:SD Host SDMMC Controller Configurations" depends on SOC_SDMMC_HOST_SUPPORTED diff --git a/components/esp_driver_sdmmc/test_apps/sdmmc/components/sdmmc_tests/sdmmc_test_begin_end_sd.c b/components/esp_driver_sdmmc/test_apps/sdmmc/components/sdmmc_tests/sdmmc_test_begin_end_sd.c index 8c60dc6c87..1beb632b48 100644 --- a/components/esp_driver_sdmmc/test_apps/sdmmc/components/sdmmc_tests/sdmmc_test_begin_end_sd.c +++ b/components/esp_driver_sdmmc/test_apps/sdmmc/components/sdmmc_tests/sdmmc_test_begin_end_sd.c @@ -14,7 +14,6 @@ #include "sd_protocol_defs.h" #include "sdmmc_cmd.h" #include "sdmmc_test_begin_end_sd.h" -#include "hal/gpio_hal.h" #include "sd_pwr_ctrl.h" #include "sd_pwr_ctrl_by_on_chip_ldo.h" diff --git a/components/esp_driver_twai/twai_private.h b/components/esp_driver_twai/twai_private.h index df36474a49..539e1c56a1 100644 --- a/components/esp_driver_twai/twai_private.h +++ b/components/esp_driver_twai/twai_private.h @@ -26,7 +26,6 @@ #include "esp_err.h" #include "soc/soc_caps.h" #include "soc/twai_periph.h" -#include "soc/io_mux_reg.h" #include "hal/twai_hal.h" #include "esp_intr_alloc.h" #include "esp_heap_caps.h" diff --git a/docs/en/api-reference/peripherals/mcpwm.rst b/docs/en/api-reference/peripherals/mcpwm.rst index 386ef93136..d39ecf2480 100644 --- a/docs/en/api-reference/peripherals/mcpwm.rst +++ b/docs/en/api-reference/peripherals/mcpwm.rst @@ -879,7 +879,6 @@ Sync Timers by GPIO mcpwm_gpio_sync_src_config_t gpio_sync_config = { .group_id = 0, // GPIO fault should be in the same group of the above timers .gpio_num = EXAMPLE_SYNC_GPIO, - .flags.pull_down = true, .flags.active_neg = false, // By default, a posedge pulse can trigger a sync event }; ESP_ERROR_CHECK(mcpwm_new_gpio_sync_src(&gpio_sync_config, &gpio_sync_source)); diff --git a/docs/zh_CN/api-reference/peripherals/mcpwm.rst b/docs/zh_CN/api-reference/peripherals/mcpwm.rst index 83df7c595c..445b1d00e1 100644 --- a/docs/zh_CN/api-reference/peripherals/mcpwm.rst +++ b/docs/zh_CN/api-reference/peripherals/mcpwm.rst @@ -879,7 +879,6 @@ MCPWM 定时器接收到同步信号后,定时器将强制进入一个预定 mcpwm_gpio_sync_src_config_t gpio_sync_config = { .group_id = 0, // GPIO 故障应与以上定时器位于同一组中 .gpio_num = EXAMPLE_SYNC_GPIO, - .flags.pull_down = true, .flags.active_neg = false, // 默认情况下,一个上升沿脉冲可以触发一个同步事件 }; ESP_ERROR_CHECK(mcpwm_new_gpio_sync_src(&gpio_sync_config, &gpio_sync_source)); diff --git a/examples/peripherals/mcpwm/mcpwm_bldc_hall_control/main/mcpwm_bldc_hall_control_example_main.c b/examples/peripherals/mcpwm/mcpwm_bldc_hall_control/main/mcpwm_bldc_hall_control_example_main.c index a0726322f3..6a8e187675 100644 --- a/examples/peripherals/mcpwm/mcpwm_bldc_hall_control/main/mcpwm_bldc_hall_control_example_main.c +++ b/examples/peripherals/mcpwm/mcpwm_bldc_hall_control/main/mcpwm_bldc_hall_control_example_main.c @@ -227,9 +227,10 @@ void app_main(void) .gpio_num = BLDC_DRV_FAULT_GPIO, .group_id = 0, .flags.active_level = 0, // low level means fault, refer to DRV8302 datasheet - .flags.pull_up = true, // internally pull up }; ESP_ERROR_CHECK(mcpwm_new_gpio_fault(&gpio_fault_config, &over_cur_fault)); + // pull up the GPIO internally + ESP_ERROR_CHECK(gpio_set_pull_mode(BLDC_DRV_FAULT_GPIO, GPIO_PULLUP_ONLY)); ESP_LOGI(TAG, "Set brake mode on the fault event"); mcpwm_brake_config_t brake_config = { @@ -311,7 +312,6 @@ void app_main(void) mcpwm_cap_channel_handle_t cap_channels[3]; mcpwm_capture_channel_config_t cap_channel_config = { .prescale = 1, - .flags.pull_up = true, .flags.neg_edge = true, .flags.pos_edge = true, }; @@ -319,6 +319,8 @@ void app_main(void) for (int i = 0; i < 3; i++) { cap_channel_config.gpio_num = cap_chan_gpios[i]; ESP_ERROR_CHECK(mcpwm_new_capture_channel(cap_timer, &cap_channel_config, &cap_channels[i])); + // pull up the GPIO internally + ESP_ERROR_CHECK(gpio_set_pull_mode(cap_chan_gpios[i], GPIO_PULLUP_ONLY)); } ESP_LOGI(TAG, "Register event callback for capture channels"); diff --git a/examples/peripherals/mcpwm/mcpwm_capture_hc_sr04/main/mcpwm_capture_hc_sr04.c b/examples/peripherals/mcpwm/mcpwm_capture_hc_sr04/main/mcpwm_capture_hc_sr04.c index 10e8a55eef..6e635af2ca 100644 --- a/examples/peripherals/mcpwm/mcpwm_capture_hc_sr04/main/mcpwm_capture_hc_sr04.c +++ b/examples/peripherals/mcpwm/mcpwm_capture_hc_sr04/main/mcpwm_capture_hc_sr04.c @@ -71,10 +71,10 @@ void app_main(void) // capture on both edge .flags.neg_edge = true, .flags.pos_edge = true, - // pull up internally - .flags.pull_up = true, }; ESP_ERROR_CHECK(mcpwm_new_capture_channel(cap_timer, &cap_ch_conf, &cap_chan)); + // pull up the GPIO internally + ESP_ERROR_CHECK(gpio_set_pull_mode(HC_SR04_ECHO_GPIO, GPIO_PULLUP_ONLY)); ESP_LOGI(TAG, "Register capture callback"); TaskHandle_t cur_task = xTaskGetCurrentTaskHandle(); diff --git a/examples/peripherals/mcpwm/mcpwm_sync/main/mcpwm_sync_example_main.c b/examples/peripherals/mcpwm/mcpwm_sync/main/mcpwm_sync_example_main.c index bb7279d0f7..b9107da56d 100644 --- a/examples/peripherals/mcpwm/mcpwm_sync/main/mcpwm_sync_example_main.c +++ b/examples/peripherals/mcpwm/mcpwm_sync/main/mcpwm_sync_example_main.c @@ -39,10 +39,11 @@ static void example_setup_sync_strategy(mcpwm_timer_handle_t timers[]) mcpwm_gpio_sync_src_config_t gpio_sync_config = { .group_id = 0, // GPIO fault should be in the same group of the above timers .gpio_num = EXAMPLE_SYNC_GPIO, - .flags.pull_down = true, .flags.active_neg = false, // by default, a posedge pulse can trigger a sync event }; ESP_ERROR_CHECK(mcpwm_new_gpio_sync_src(&gpio_sync_config, &gpio_sync_source)); + // pull-down the GPIO to ensure a stable posedge pulse + ESP_ERROR_CHECK(gpio_set_pull_mode(EXAMPLE_SYNC_GPIO, GPIO_PULLDOWN_ONLY)); ESP_LOGI(TAG, "Set timers to sync on the GPIO"); mcpwm_timer_sync_phase_config_t sync_phase_config = { diff --git a/examples/peripherals/rmt/onewire/main/onewire_example_main.c b/examples/peripherals/rmt/onewire/main/onewire_example_main.c index d3c3b414b6..bfb1c44a8f 100644 --- a/examples/peripherals/rmt/onewire/main/onewire_example_main.c +++ b/examples/peripherals/rmt/onewire/main/onewire_example_main.c @@ -7,6 +7,7 @@ #include "freertos/task.h" #include "esp_log.h" #include "esp_check.h" +#include "driver/gpio.h" #include "onewire_bus.h" #include "ds18b20.h" @@ -28,6 +29,9 @@ void app_main(void) ESP_ERROR_CHECK(onewire_new_bus_rmt(&bus_config, &rmt_config, &bus)); ESP_LOGI(TAG, "1-Wire bus installed on GPIO%d", EXAMPLE_ONEWIRE_BUS_GPIO); + // in case the external device didn't have a pull-up resistor, we also enable the internal pull-up resistor + ESP_ERROR_CHECK(gpio_pullup_en(EXAMPLE_ONEWIRE_BUS_GPIO)); + int ds18b20_device_num = 0; ds18b20_device_handle_t ds18b20s[EXAMPLE_ONEWIRE_MAX_DS18B20]; onewire_device_iter_handle_t iter = NULL; From f6b8ad87fa427e34d8f6613a58c4eef89c5a15b4 Mon Sep 17 00:00:00 2001 From: morris Date: Mon, 19 May 2025 19:02:56 +0800 Subject: [PATCH 2/2] feat(docs): initial migration guide for idf 6.x --- docs/en/migration-guides/index.rst | 8 +++++ .../release-6.x/6.0/index.rst | 9 ++++++ .../release-6.x/6.0/peripherals.rst | 31 +++++++++++++++++++ docs/zh_CN/migration-guides/index.rst | 8 +++++ .../release-6.x/6.0/index.rst | 9 ++++++ .../release-6.x/6.0/peripherals.rst | 31 +++++++++++++++++++ 6 files changed, 96 insertions(+) create mode 100644 docs/en/migration-guides/release-6.x/6.0/index.rst create mode 100644 docs/en/migration-guides/release-6.x/6.0/peripherals.rst create mode 100644 docs/zh_CN/migration-guides/release-6.x/6.0/index.rst create mode 100644 docs/zh_CN/migration-guides/release-6.x/6.0/peripherals.rst diff --git a/docs/en/migration-guides/index.rst b/docs/en/migration-guides/index.rst index abf4d932c9..4089158940 100644 --- a/docs/en/migration-guides/index.rst +++ b/docs/en/migration-guides/index.rst @@ -15,3 +15,11 @@ ESP-IDF 5.x Migration Guide release-5.x/5.3/index release-5.x/5.4/index release-5.x/5.5/index + +ESP-IDF 6.x Migration Guide +=========================== + +.. toctree:: + :maxdepth: 1 + + release-6.x/6.0/index diff --git a/docs/en/migration-guides/release-6.x/6.0/index.rst b/docs/en/migration-guides/release-6.x/6.0/index.rst new file mode 100644 index 0000000000..0dcafc4a75 --- /dev/null +++ b/docs/en/migration-guides/release-6.x/6.0/index.rst @@ -0,0 +1,9 @@ +Migration from 5.5 to 6.0 +------------------------- + +:link_to_translation:`zh_CN:[中文]` + +.. toctree:: + :maxdepth: 1 + + peripherals diff --git a/docs/en/migration-guides/release-6.x/6.0/peripherals.rst b/docs/en/migration-guides/release-6.x/6.0/peripherals.rst new file mode 100644 index 0000000000..cd22dbf252 --- /dev/null +++ b/docs/en/migration-guides/release-6.x/6.0/peripherals.rst @@ -0,0 +1,31 @@ +Peripherals +=========== + +:link_to_translation:`zh_CN:[中文]` + +Common Changes +-------------- + +All drivers' ``io_loop_back`` configuration have been removed +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Different driver objects can share the same GPIO number, enabling more complex functionalities. For example, you can bind the TX and RX channels of the RMT peripheral to the same GPIO to simulate 1-Wire bus read and write timing. In previous versions, you needed to configure the ``io_loop_back`` setting in the driver to achieve this "loopback" functionality. Now, this configuration has been removed. Simply configuring the same GPIO number in different drivers will achieve the same functionality. + +RMT +--- + +The ``io_od_mode`` member in the :cpp:type:`rmt_tx_channel_config_t` configuration structure has been removed. If you want to use open-drain mode, you need to manually call the :func:`gpio_od_enable` function. + +MCPWM +----- + +The ``io_od_mode`` member in the :cpp:type:`mcpwm_generator_config_t` configuration structure has been removed. If you want to use open-drain mode, you need to manually call the :func:`gpio_od_enable` function. + +The ``pull_up`` and ``pull_down`` members have been removed from the following configuration structures. You need to manually call the :func:`gpio_set_pull_mode` function to configure the pull-up and pull-down resistors for the IO: + +.. list:: + + - :cpp:type:`mcpwm_generator_config_t` + - :cpp:type:`mcpwm_gpio_fault_config_t` + - :cpp:type:`mcpwm_gpio_sync_src_config_t` + - :cpp:type:`mcpwm_capture_channel_config_t` diff --git a/docs/zh_CN/migration-guides/index.rst b/docs/zh_CN/migration-guides/index.rst index 4d522eeea1..21890dec0b 100644 --- a/docs/zh_CN/migration-guides/index.rst +++ b/docs/zh_CN/migration-guides/index.rst @@ -15,3 +15,11 @@ release-5.x/5.3/index release-5.x/5.4/index release-5.x/5.5/index + +迁移到 ESP-IDF 6.x +------------------- + +.. toctree:: + :maxdepth: 1 + + release-6.x/6.0/index diff --git a/docs/zh_CN/migration-guides/release-6.x/6.0/index.rst b/docs/zh_CN/migration-guides/release-6.x/6.0/index.rst new file mode 100644 index 0000000000..cc9e64f701 --- /dev/null +++ b/docs/zh_CN/migration-guides/release-6.x/6.0/index.rst @@ -0,0 +1,9 @@ +从 5.5 迁移到 6.0 +----------------- + +:link_to_translation:`en:[English]` + +.. toctree:: + :maxdepth: 1 + + peripherals diff --git a/docs/zh_CN/migration-guides/release-6.x/6.0/peripherals.rst b/docs/zh_CN/migration-guides/release-6.x/6.0/peripherals.rst new file mode 100644 index 0000000000..57e134d630 --- /dev/null +++ b/docs/zh_CN/migration-guides/release-6.x/6.0/peripherals.rst @@ -0,0 +1,31 @@ +外设驱动 +======== + +:link_to_translation:`en:[English]` + +公共变化 +-------- + +所有驱动的 ``io_loop_back`` 配置已被移除 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +不同的驱动对象可以共享同一个 GPIO 编号,联合起来可以实现更加复杂的功能。比如将 RMT 外设的 TX 通道和 RX 通道绑定在同一个 GPIO 上,进而模拟单总线的读写时序。在以前的版本中,你需要在驱动的配置中额外设置 ``io_loop_back`` 来实现这种“回环”功能,现在,这个配置已经被移除。不同的驱动只需要在配置中设置相同的 GPIO 编号就能实现这个功能。 + +RMT +--- + +:cpp:type:`rmt_tx_channel_config_t` 配置结构体中的 ``io_od_mode`` 已经被移除。如果想要使用开漏模式,你需要手动调用 GPIO 驱动中的 :func:`gpio_od_enable` 函数。 + +MCPWM +----- + +:cpp:type:`mcpwm_generator_config_t` 配置结构体中的 ``io_od_mode`` 已经被移除。如果想要使用开漏模式,你需要手动调用 GPIO 驱动中的 :func:`gpio_od_enable` 函数。 + +以下配置结构体中的 ``pull_up`` 和 ``pull_down`` 成员已经被移除,你需要手动调用 GPIO 驱动中的 :func:`gpio_set_pull_mode` 函数来配置 IO 上拉和下拉电阻: + +.. list:: + + - :cpp:type:`mcpwm_generator_config_t` + - :cpp:type:`mcpwm_gpio_fault_config_t` + - :cpp:type:`mcpwm_gpio_sync_src_config_t` + - :cpp:type:`mcpwm_capture_channel_config_t`