From b79cf6d8ebd10a3c7e9f391a6385454b16586859 Mon Sep 17 00:00:00 2001 From: morris Date: Tue, 18 Nov 2025 18:56:46 +0800 Subject: [PATCH 1/3] feat(gpio): support glitch filter on esp32s31 --- .../src/gpio_flex_glitch_filter.c | 2 +- .../include/hal/gpio_glitch_filter_ll.h | 1 + .../include/hal/gpio_glitch_filter_ll.h | 1 + .../include/hal/gpio_glitch_filter_ll.h | 1 + .../include/hal/gpio_glitch_filter_ll.h | 1 + .../include/hal/gpio_glitch_filter_ll.h | 1 + .../include/hal/gpio_glitch_filter_ll.h | 1 + .../include/hal/gpio_glitch_filter_ll.h | 62 +++++++++++++++++++ .../soc/esp32c5/ld/esp32c5.peripherals.ld | 1 - .../esp32c5/register/soc/gpio_ext_struct.h | 1 - .../soc/esp32c6/ld/esp32c6.peripherals.ld | 1 - .../esp32c6/register/soc/gpio_ext_struct.h | 1 - .../soc/esp32h2/ld/esp32h2.peripherals.ld | 1 - .../esp32h2/register/soc/gpio_ext_struct.h | 1 - .../soc/esp32h21/ld/esp32h21.peripherals.ld | 1 - .../esp32h21/register/soc/gpio_ext_struct.h | 1 - .../soc/esp32h4/ld/esp32h4.peripherals.ld | 1 - .../esp32h4/register/soc/gpio_ext_struct.h | 1 - .../soc/esp32p4/ld/esp32p4.peripherals.ld | 1 - .../register/hw_ver1/soc/gpio_ext_struct.h | 1 - .../register/hw_ver3/soc/gpio_ext_struct.h | 1 - .../esp32s31/include/soc/Kconfig.soc_caps.in | 8 +++ .../soc/esp32s31/include/soc/soc_caps.h | 4 +- .../soc/esp32s31/ld/esp32s31.peripherals.ld | 1 - .../esp32s31/register/soc/gpio_ext_struct.h | 1 - 25 files changed, 79 insertions(+), 18 deletions(-) create mode 100644 components/esp_hal_gpio/esp32s31/include/hal/gpio_glitch_filter_ll.h diff --git a/components/esp_driver_gpio/src/gpio_flex_glitch_filter.c b/components/esp_driver_gpio/src/gpio_flex_glitch_filter.c index d7ba3efa02..a97134172a 100644 --- a/components/esp_driver_gpio/src/gpio_flex_glitch_filter.c +++ b/components/esp_driver_gpio/src/gpio_flex_glitch_filter.c @@ -35,7 +35,7 @@ struct gpio_flex_glitch_filter_t { }; static gpio_flex_glitch_filter_group_t s_gpio_glitch_filter_group = { - .hw = &GLITCH_FILTER, + .hw = GPIO_LL_GLITCH_FILTER_GET_HW(), .spinlock = portMUX_INITIALIZER_UNLOCKED, }; diff --git a/components/esp_hal_gpio/esp32c5/include/hal/gpio_glitch_filter_ll.h b/components/esp_hal_gpio/esp32c5/include/hal/gpio_glitch_filter_ll.h index d70c2364e9..53cebeeaab 100644 --- a/components/esp_hal_gpio/esp32c5/include/hal/gpio_glitch_filter_ll.h +++ b/components/esp_hal_gpio/esp32c5/include/hal/gpio_glitch_filter_ll.h @@ -17,6 +17,7 @@ #include "soc/gpio_ext_struct.h" #include "soc/gpio_ext_reg.h" +#define GPIO_LL_GLITCH_FILTER_GET_HW() ((gpio_glitch_filter_dev_t *)(void *)&GPIO_EXT.glitch_filter) #define GPIO_LL_GLITCH_FILTER_MAX_WINDOW (GPIO_EXT_FILTER_CH0_WINDOW_WIDTH_V + 1) #ifdef __cplusplus diff --git a/components/esp_hal_gpio/esp32c6/include/hal/gpio_glitch_filter_ll.h b/components/esp_hal_gpio/esp32c6/include/hal/gpio_glitch_filter_ll.h index 7f8f238736..eb6c66dacf 100644 --- a/components/esp_hal_gpio/esp32c6/include/hal/gpio_glitch_filter_ll.h +++ b/components/esp_hal_gpio/esp32c6/include/hal/gpio_glitch_filter_ll.h @@ -17,6 +17,7 @@ #include "soc/gpio_ext_struct.h" #include "soc/gpio_ext_reg.h" +#define GPIO_LL_GLITCH_FILTER_GET_HW() ((gpio_glitch_filter_dev_t *)(void *)&GPIO_EXT.glitch_filter) // the max window size is expected to be 64, but due to a hardware issue, we need to limit it to 63 #define GPIO_LL_GLITCH_FILTER_MAX_WINDOW GPIO_EXT_FILTER_CH0_WINDOW_WIDTH_V diff --git a/components/esp_hal_gpio/esp32h2/include/hal/gpio_glitch_filter_ll.h b/components/esp_hal_gpio/esp32h2/include/hal/gpio_glitch_filter_ll.h index c81d1b0c1c..96126f2db2 100644 --- a/components/esp_hal_gpio/esp32h2/include/hal/gpio_glitch_filter_ll.h +++ b/components/esp_hal_gpio/esp32h2/include/hal/gpio_glitch_filter_ll.h @@ -17,6 +17,7 @@ #include "soc/gpio_ext_struct.h" #include "soc/gpio_ext_reg.h" +#define GPIO_LL_GLITCH_FILTER_GET_HW() ((gpio_glitch_filter_dev_t *)(void *)&GPIO_EXT.glitch_filter) // the max window size is expected to be 64, but due to a hardware issue, we need to limit it to 63 #define GPIO_LL_GLITCH_FILTER_MAX_WINDOW GPIO_EXT_FILTER_CH0_WINDOW_WIDTH_V diff --git a/components/esp_hal_gpio/esp32h21/include/hal/gpio_glitch_filter_ll.h b/components/esp_hal_gpio/esp32h21/include/hal/gpio_glitch_filter_ll.h index 4f53a17d85..33f8f08f9a 100644 --- a/components/esp_hal_gpio/esp32h21/include/hal/gpio_glitch_filter_ll.h +++ b/components/esp_hal_gpio/esp32h21/include/hal/gpio_glitch_filter_ll.h @@ -11,6 +11,7 @@ #include "soc/gpio_ext_struct.h" #include "soc/gpio_ext_reg.h" +#define GPIO_LL_GLITCH_FILTER_GET_HW() ((gpio_glitch_filter_dev_t *)(void *)&GPIO_EXT.glitch_filter) #define GPIO_LL_GLITCH_FILTER_MAX_WINDOW (GPIO_EXT_FILTER_CH0_WINDOW_WIDTH_V + 1) #ifdef __cplusplus diff --git a/components/esp_hal_gpio/esp32h4/include/hal/gpio_glitch_filter_ll.h b/components/esp_hal_gpio/esp32h4/include/hal/gpio_glitch_filter_ll.h index 7383e8c3d9..e606a67a9a 100644 --- a/components/esp_hal_gpio/esp32h4/include/hal/gpio_glitch_filter_ll.h +++ b/components/esp_hal_gpio/esp32h4/include/hal/gpio_glitch_filter_ll.h @@ -11,6 +11,7 @@ #include "soc/gpio_ext_struct.h" #include "soc/gpio_ext_reg.h" +#define GPIO_LL_GLITCH_FILTER_GET_HW() ((gpio_glitch_filter_dev_t *)(void *)&GPIO_EXT.ext_glitch_filter) #define GPIO_LL_GLITCH_FILTER_MAX_WINDOW (GPIO_EXT_FILTER_CH0_WINDOW_WIDTH_V + 1) #ifdef __cplusplus diff --git a/components/esp_hal_gpio/esp32p4/include/hal/gpio_glitch_filter_ll.h b/components/esp_hal_gpio/esp32p4/include/hal/gpio_glitch_filter_ll.h index cc95ba7320..1b1e11f376 100644 --- a/components/esp_hal_gpio/esp32p4/include/hal/gpio_glitch_filter_ll.h +++ b/components/esp_hal_gpio/esp32p4/include/hal/gpio_glitch_filter_ll.h @@ -11,6 +11,7 @@ #include "soc/gpio_ext_struct.h" #include "soc/gpio_ext_reg.h" +#define GPIO_LL_GLITCH_FILTER_GET_HW() ((gpio_glitch_filter_dev_t *)(void *)&GPIO_EXT.glitch_filter) #define GPIO_LL_GLITCH_FILTER_MAX_WINDOW (GPIO_EXT_FILTER_CH0_WINDOW_WIDTH_V + 1) #ifdef __cplusplus diff --git a/components/esp_hal_gpio/esp32s31/include/hal/gpio_glitch_filter_ll.h b/components/esp_hal_gpio/esp32s31/include/hal/gpio_glitch_filter_ll.h new file mode 100644 index 0000000000..4cfc1e4925 --- /dev/null +++ b/components/esp_hal_gpio/esp32s31/include/hal/gpio_glitch_filter_ll.h @@ -0,0 +1,62 @@ +/* + * SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include +#include "hal/assert.h" +#include "soc/gpio_ext_struct.h" +#include "soc/gpio_ext_reg.h" + +#define GPIO_LL_GLITCH_FILTER_GET_HW() ((gpio_glitch_filter_dev_t *)(void *)&GPIO_EXT.glitch_filter) +#define GPIO_LL_GLITCH_FILTER_MAX_WINDOW (GPIO_EXT_FILTER_CH0_WINDOW_WIDTH_V + 1) + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enable GPIO glitch filter + * + * @param hw Glitch filter register base address + * @param filter_idx Glitch filter index + * @param enable True to enable, false to disable + */ +static inline void gpio_ll_glitch_filter_enable(gpio_glitch_filter_dev_t *hw, uint32_t filter_idx, bool enable) +{ + hw->glitch_filter_chn[filter_idx].filter_chn_en = enable; +} + +/** + * @brief Set the input GPIO for the glitch filter + * + * @param hw Glitch filter register base address + * @param filter_idx Glitch filter index + * @param gpio_num GPIO number + */ +static inline void gpio_ll_glitch_filter_set_gpio(gpio_glitch_filter_dev_t *hw, uint32_t filter_idx, uint32_t gpio_num) +{ + hw->glitch_filter_chn[filter_idx].filter_chn_input_io_num = gpio_num; +} + +/** + * @brief Set the coefficient of the glitch filter window + * + * @param hw Glitch filter register base address + * @param filter_idx Glitch filter index + * @param window_width Window width, in IOMUX clock ticks + * @param window_threshold Window threshold, in IOMUX clock ticks + */ +static inline void gpio_ll_glitch_filter_set_window_coeff(gpio_glitch_filter_dev_t *hw, uint32_t filter_idx, uint32_t window_width, uint32_t window_thres) +{ + HAL_ASSERT(window_thres <= window_width); + hw->glitch_filter_chn[filter_idx].filter_chn_window_width = window_width - 1; + hw->glitch_filter_chn[filter_idx].filter_chn_window_thres = window_thres - 1; +} + +#ifdef __cplusplus +} +#endif diff --git a/components/soc/esp32c5/ld/esp32c5.peripherals.ld b/components/soc/esp32c5/ld/esp32c5.peripherals.ld index 1339fa56e1..24734c783d 100644 --- a/components/soc/esp32c5/ld/esp32c5.peripherals.ld +++ b/components/soc/esp32c5/ld/esp32c5.peripherals.ld @@ -47,7 +47,6 @@ PROVIDE ( IO_MUX = 0x60090000 ); PROVIDE ( GPIO = 0x60091000 ); PROVIDE ( GPIO_EXT = 0x60091e00 ); PROVIDE ( SDM = 0x60091e00 ); -PROVIDE ( GLITCH_FILTER = 0x60091ed8 ); PROVIDE ( GPIO_ETM = 0x60091f18 ); PROVIDE ( MEM_MONITOR = 0x60092000 ); PROVIDE ( PAU = 0x60093000 ); diff --git a/components/soc/esp32c5/register/soc/gpio_ext_struct.h b/components/soc/esp32c5/register/soc/gpio_ext_struct.h index 5b754035b4..d7720e63c4 100644 --- a/components/soc/esp32c5/register/soc/gpio_ext_struct.h +++ b/components/soc/esp32c5/register/soc/gpio_ext_struct.h @@ -416,7 +416,6 @@ typedef struct { } gpio_ext_dev_t; extern gpio_sd_dev_t SDM; -extern gpio_glitch_filter_dev_t GLITCH_FILTER; extern gpio_etm_dev_t GPIO_ETM; extern gpio_ext_dev_t GPIO_EXT; diff --git a/components/soc/esp32c6/ld/esp32c6.peripherals.ld b/components/soc/esp32c6/ld/esp32c6.peripherals.ld index b70099597d..caad419859 100644 --- a/components/soc/esp32c6/ld/esp32c6.peripherals.ld +++ b/components/soc/esp32c6/ld/esp32c6.peripherals.ld @@ -48,7 +48,6 @@ PROVIDE ( IO_MUX = 0x60090000 ); PROVIDE ( GPIO = 0x60091000 ); PROVIDE ( GPIO_EXT = 0x60091f00 ); PROVIDE ( SDM = 0x60091f00 ); -PROVIDE ( GLITCH_FILTER = 0x60091f30 ); PROVIDE ( GPIO_ETM = 0x60091f60 ); PROVIDE ( MEM_MONITOR = 0x60092000 ); diff --git a/components/soc/esp32c6/register/soc/gpio_ext_struct.h b/components/soc/esp32c6/register/soc/gpio_ext_struct.h index 16a651de96..5d066f6c70 100644 --- a/components/soc/esp32c6/register/soc/gpio_ext_struct.h +++ b/components/soc/esp32c6/register/soc/gpio_ext_struct.h @@ -201,7 +201,6 @@ typedef struct gpio_ext_dev_t { } gpio_ext_dev_t; extern gpio_sd_dev_t SDM; -extern gpio_glitch_filter_dev_t GLITCH_FILTER; extern gpio_etm_dev_t GPIO_ETM; extern gpio_ext_dev_t GPIO_EXT; diff --git a/components/soc/esp32h2/ld/esp32h2.peripherals.ld b/components/soc/esp32h2/ld/esp32h2.peripherals.ld index 498ee30e0d..2aa249c964 100644 --- a/components/soc/esp32h2/ld/esp32h2.peripherals.ld +++ b/components/soc/esp32h2/ld/esp32h2.peripherals.ld @@ -45,7 +45,6 @@ PROVIDE ( IO_MUX = 0x60090000 ); PROVIDE ( GPIO = 0x60091000 ); PROVIDE ( GPIO_EXT = 0x60091f00 ); PROVIDE ( SDM = 0x60091f00 ); -PROVIDE ( GLITCH_FILTER = 0x60091f30 ); PROVIDE ( GPIO_ETM = 0x60091f60 ); PROVIDE ( MEM_ACS_MONITOR = 0x60092000 ); diff --git a/components/soc/esp32h2/register/soc/gpio_ext_struct.h b/components/soc/esp32h2/register/soc/gpio_ext_struct.h index ea20bc8d6d..5ff803b3fc 100644 --- a/components/soc/esp32h2/register/soc/gpio_ext_struct.h +++ b/components/soc/esp32h2/register/soc/gpio_ext_struct.h @@ -306,7 +306,6 @@ typedef struct { } gpio_ext_dev_t; extern gpio_sd_dev_t SDM; -extern gpio_glitch_filter_dev_t GLITCH_FILTER; extern gpio_etm_dev_t GPIO_ETM; extern gpio_ext_dev_t GPIO_EXT; diff --git a/components/soc/esp32h21/ld/esp32h21.peripherals.ld b/components/soc/esp32h21/ld/esp32h21.peripherals.ld index f4be0e9fe1..08b2d4cd82 100644 --- a/components/soc/esp32h21/ld/esp32h21.peripherals.ld +++ b/components/soc/esp32h21/ld/esp32h21.peripherals.ld @@ -40,7 +40,6 @@ PROVIDE ( IO_MUX = 0x60090000 ); PROVIDE ( GPIO = 0x60091000 ); PROVIDE ( GPIO_EXT = 0x60091E00 ); PROVIDE ( SDM = 0x60091E04 ); -PROVIDE ( GLITCH_FILTER = 0x60091ED8 ); PROVIDE ( GPIO_ETM = 0x60091F18 ); PROVIDE ( MEM_MONITOR = 0x60092000 ); PROVIDE ( PAU = 0x60093000 ); diff --git a/components/soc/esp32h21/register/soc/gpio_ext_struct.h b/components/soc/esp32h21/register/soc/gpio_ext_struct.h index e1567e8fe5..5a82543aae 100644 --- a/components/soc/esp32h21/register/soc/gpio_ext_struct.h +++ b/components/soc/esp32h21/register/soc/gpio_ext_struct.h @@ -592,7 +592,6 @@ typedef struct { } gpio_ext_dev_t; extern gpio_sd_dev_t SDM; -extern gpio_glitch_filter_dev_t GLITCH_FILTER; extern gpio_etm_dev_t GPIO_ETM; extern gpio_ext_dev_t GPIO_EXT; diff --git a/components/soc/esp32h4/ld/esp32h4.peripherals.ld b/components/soc/esp32h4/ld/esp32h4.peripherals.ld index 3e06879a0d..da609b7621 100644 --- a/components/soc/esp32h4/ld/esp32h4.peripherals.ld +++ b/components/soc/esp32h4/ld/esp32h4.peripherals.ld @@ -46,7 +46,6 @@ PROVIDE ( IO_MUX = 0x60092000 ); PROVIDE ( GPIO = 0x60093000 ); PROVIDE ( GPIO_EXT = 0x60093E00 ); PROVIDE ( SDM = 0x60093E00 ); -PROVIDE ( GLITCH_FILTER = 0x60093ED8 ); PROVIDE ( GPIO_ETM = 0x60093F18 ); PROVIDE ( PCR = 0x60094000 ); PROVIDE ( SPIMEM0 = 0x60098000 ); diff --git a/components/soc/esp32h4/register/soc/gpio_ext_struct.h b/components/soc/esp32h4/register/soc/gpio_ext_struct.h index a968f9349c..7664547a8f 100644 --- a/components/soc/esp32h4/register/soc/gpio_ext_struct.h +++ b/components/soc/esp32h4/register/soc/gpio_ext_struct.h @@ -271,7 +271,6 @@ typedef struct { } gpio_ext_dev_t; extern gpio_sd_dev_t SDM; -extern gpio_glitch_filter_dev_t GLITCH_FILTER; extern gpio_etm_dev_t GPIO_ETM; extern gpio_ext_dev_t GPIO_EXT; diff --git a/components/soc/esp32p4/ld/esp32p4.peripherals.ld b/components/soc/esp32p4/ld/esp32p4.peripherals.ld index 180e506225..db01398913 100644 --- a/components/soc/esp32p4/ld/esp32p4.peripherals.ld +++ b/components/soc/esp32p4/ld/esp32p4.peripherals.ld @@ -63,7 +63,6 @@ PROVIDE ( ECDSA = 0x50096000 ); PROVIDE ( GPIO = 0x500E0000 ); PROVIDE ( GPIO_EXT = 0x500E0F00 ); PROVIDE ( SDM = 0x500E0F00 ); -PROVIDE ( GLITCH_FILTER = 0x500E0F30 ); PROVIDE ( GPIO_ETM = 0x500E0F60 ); PROVIDE ( IO_MUX = 0x500E1000 ); PROVIDE ( MSPI_IOMUX = 0x500E1200 ); diff --git a/components/soc/esp32p4/register/hw_ver1/soc/gpio_ext_struct.h b/components/soc/esp32p4/register/hw_ver1/soc/gpio_ext_struct.h index 8a79e802f5..e5fb6ea364 100644 --- a/components/soc/esp32p4/register/hw_ver1/soc/gpio_ext_struct.h +++ b/components/soc/esp32p4/register/hw_ver1/soc/gpio_ext_struct.h @@ -181,7 +181,6 @@ typedef struct { } gpio_ext_dev_t; extern gpio_sd_dev_t SDM; -extern gpio_glitch_filter_dev_t GLITCH_FILTER; extern gpio_etm_dev_t GPIO_ETM; extern gpio_ext_dev_t GPIO_EXT; diff --git a/components/soc/esp32p4/register/hw_ver3/soc/gpio_ext_struct.h b/components/soc/esp32p4/register/hw_ver3/soc/gpio_ext_struct.h index 8a79e802f5..e5fb6ea364 100644 --- a/components/soc/esp32p4/register/hw_ver3/soc/gpio_ext_struct.h +++ b/components/soc/esp32p4/register/hw_ver3/soc/gpio_ext_struct.h @@ -181,7 +181,6 @@ typedef struct { } gpio_ext_dev_t; extern gpio_sd_dev_t SDM; -extern gpio_glitch_filter_dev_t GLITCH_FILTER; extern gpio_etm_dev_t GPIO_ETM; extern gpio_ext_dev_t GPIO_EXT; diff --git a/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in b/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in index 4170e280cd..93b4c18673 100644 --- a/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in @@ -255,6 +255,14 @@ config SOC_GPIO_PIN_COUNT int default 62 +config SOC_GPIO_SUPPORT_PIN_GLITCH_FILTER + bool + default y + +config SOC_GPIO_FLEX_GLITCH_FILTER_NUM + int + default 8 + config SOC_GPIO_SUPPORT_PIN_HYS_FILTER bool default y diff --git a/components/soc/esp32s31/include/soc/soc_caps.h b/components/soc/esp32s31/include/soc/soc_caps.h index 42d450710f..0b5020d795 100644 --- a/components/soc/esp32s31/include/soc/soc_caps.h +++ b/components/soc/esp32s31/include/soc/soc_caps.h @@ -158,8 +158,8 @@ // ESP32-S31 has 1 GPIO peripheral #define SOC_GPIO_PORT 1U #define SOC_GPIO_PIN_COUNT 62 -// #define SOC_GPIO_SUPPORT_PIN_GLITCH_FILTER 1 // TODO: [ESP32S31] IDF-14781 -// #define SOC_GPIO_FLEX_GLITCH_FILTER_NUM 8 // TODO: [ESP32S31] IDF-14781 +#define SOC_GPIO_SUPPORT_PIN_GLITCH_FILTER 1 +#define SOC_GPIO_FLEX_GLITCH_FILTER_NUM 8 #define SOC_GPIO_SUPPORT_PIN_HYS_FILTER 1 // GPIO peripheral has the ETM extension diff --git a/components/soc/esp32s31/ld/esp32s31.peripherals.ld b/components/soc/esp32s31/ld/esp32s31.peripherals.ld index c97ee08b38..6f0fb49cbf 100644 --- a/components/soc/esp32s31/ld/esp32s31.peripherals.ld +++ b/components/soc/esp32s31/ld/esp32s31.peripherals.ld @@ -73,7 +73,6 @@ PROVIDE ( IO_MUX = 0x20582000 ); PROVIDE ( GPIO = 0x20583000 ); PROVIDE ( GPIO_EXT = 0x20583E00 ); PROVIDE ( SDM = 0x20583E04 ); -PROVIDE ( GLITCH_FILTER = 0x20583E08 ); PROVIDE ( GPIO_ETM = 0x20583F18 ); PROVIDE ( MSPI_IOMUX = 0x20584000 ); PROVIDE ( HP_SYSTEM = 0x20586000 ); diff --git a/components/soc/esp32s31/register/soc/gpio_ext_struct.h b/components/soc/esp32s31/register/soc/gpio_ext_struct.h index a9ac8bc271..6476fa8fc6 100644 --- a/components/soc/esp32s31/register/soc/gpio_ext_struct.h +++ b/components/soc/esp32s31/register/soc/gpio_ext_struct.h @@ -242,7 +242,6 @@ typedef struct { } gpio_ext_dev_t; extern gpio_sd_dev_t SDM; -extern gpio_glitch_filter_dev_t GLITCH_FILTER; extern gpio_etm_dev_t GPIO_ETM; extern gpio_ext_dev_t GPIO_EXT; From 572e732aca9026f2494c93b6d1665d956e64097f Mon Sep 17 00:00:00 2001 From: morris Date: Wed, 8 Apr 2026 14:46:29 +0800 Subject: [PATCH 2/3] refactor(gpio): derive ETM registers from GPIO_EXT Use GPIO_EXT.etm as the ETM register base and remove standalone GPIO_ETM symbols to avoid manual offset address maintenance errors across targets. --- components/esp_driver_gpio/src/gpio_etm.c | 2 +- components/esp_hal_gpio/esp32c5/include/hal/gpio_etm_ll.h | 2 ++ components/esp_hal_gpio/esp32c6/include/hal/gpio_etm_ll.h | 2 ++ components/esp_hal_gpio/esp32c61/include/hal/gpio_etm_ll.h | 2 ++ components/esp_hal_gpio/esp32h2/include/hal/gpio_etm_ll.h | 2 ++ components/esp_hal_gpio/esp32h21/include/hal/gpio_etm_ll.h | 2 ++ components/esp_hal_gpio/esp32h4/include/hal/gpio_etm_ll.h | 2 ++ components/esp_hal_gpio/esp32p4/include/hal/gpio_etm_ll.h | 2 ++ components/esp_hal_gpio/esp32s31/include/hal/gpio_etm_ll.h | 2 ++ components/soc/esp32c5/ld/esp32c5.peripherals.ld | 1 - components/soc/esp32c5/register/soc/gpio_ext_struct.h | 1 - components/soc/esp32c6/ld/esp32c6.peripherals.ld | 1 - components/soc/esp32c6/register/soc/gpio_ext_struct.h | 1 - components/soc/esp32c61/ld/esp32c61.peripherals.ld | 1 - components/soc/esp32c61/register/soc/gpio_ext_struct.h | 1 - components/soc/esp32h2/ld/esp32h2.peripherals.ld | 1 - components/soc/esp32h2/register/soc/gpio_ext_struct.h | 1 - components/soc/esp32h21/ld/esp32h21.peripherals.ld | 1 - components/soc/esp32h21/register/soc/gpio_ext_struct.h | 1 - components/soc/esp32h4/ld/esp32h4.peripherals.ld | 1 - components/soc/esp32h4/register/soc/gpio_ext_struct.h | 1 - components/soc/esp32p4/ld/esp32p4.peripherals.ld | 1 - components/soc/esp32p4/register/hw_ver1/soc/gpio_ext_struct.h | 1 - components/soc/esp32p4/register/hw_ver3/soc/gpio_ext_struct.h | 1 - components/soc/esp32s31/ld/esp32s31.peripherals.ld | 1 - components/soc/esp32s31/register/soc/gpio_ext_struct.h | 1 - 26 files changed, 17 insertions(+), 18 deletions(-) diff --git a/components/esp_driver_gpio/src/gpio_etm.c b/components/esp_driver_gpio/src/gpio_etm.c index ad4f117bb0..d19d03248d 100644 --- a/components/esp_driver_gpio/src/gpio_etm.c +++ b/components/esp_driver_gpio/src/gpio_etm.c @@ -52,7 +52,7 @@ struct gpio_etm_task_t { }; static gpio_etm_group_t s_gpio_etm_group = { - .dev = &GPIO_ETM, + .dev = GPIO_LL_ETM_GET_HW(), .spinlock = portMUX_INITIALIZER_UNLOCKED, }; diff --git a/components/esp_hal_gpio/esp32c5/include/hal/gpio_etm_ll.h b/components/esp_hal_gpio/esp32c5/include/hal/gpio_etm_ll.h index 0e85a7f2aa..2e48c1a009 100644 --- a/components/esp_hal_gpio/esp32c5/include/hal/gpio_etm_ll.h +++ b/components/esp_hal_gpio/esp32c5/include/hal/gpio_etm_ll.h @@ -22,6 +22,8 @@ #define GPIO_LL_ETM_TASK_ID_CLR(ch) (GPIO_TASK_CH0_CLEAR + (ch)) #define GPIO_LL_ETM_TASK_ID_TOG(ch) (GPIO_TASK_CH0_TOGGLE + (ch)) +#define GPIO_LL_ETM_GET_HW() ((gpio_etm_dev_t *)(void *)&GPIO_EXT.etm) + #ifdef __cplusplus extern "C" { #endif diff --git a/components/esp_hal_gpio/esp32c6/include/hal/gpio_etm_ll.h b/components/esp_hal_gpio/esp32c6/include/hal/gpio_etm_ll.h index 1608eff713..c2ff53aa67 100644 --- a/components/esp_hal_gpio/esp32c6/include/hal/gpio_etm_ll.h +++ b/components/esp_hal_gpio/esp32c6/include/hal/gpio_etm_ll.h @@ -22,6 +22,8 @@ #define GPIO_LL_ETM_TASK_ID_CLR(ch) (GPIO_TASK_CH0_CLEAR + (ch)) #define GPIO_LL_ETM_TASK_ID_TOG(ch) (GPIO_TASK_CH0_TOGGLE + (ch)) +#define GPIO_LL_ETM_GET_HW() ((gpio_etm_dev_t *)(void *)&GPIO_EXT.etm) + #ifdef __cplusplus extern "C" { #endif diff --git a/components/esp_hal_gpio/esp32c61/include/hal/gpio_etm_ll.h b/components/esp_hal_gpio/esp32c61/include/hal/gpio_etm_ll.h index 0e85a7f2aa..2e48c1a009 100644 --- a/components/esp_hal_gpio/esp32c61/include/hal/gpio_etm_ll.h +++ b/components/esp_hal_gpio/esp32c61/include/hal/gpio_etm_ll.h @@ -22,6 +22,8 @@ #define GPIO_LL_ETM_TASK_ID_CLR(ch) (GPIO_TASK_CH0_CLEAR + (ch)) #define GPIO_LL_ETM_TASK_ID_TOG(ch) (GPIO_TASK_CH0_TOGGLE + (ch)) +#define GPIO_LL_ETM_GET_HW() ((gpio_etm_dev_t *)(void *)&GPIO_EXT.etm) + #ifdef __cplusplus extern "C" { #endif diff --git a/components/esp_hal_gpio/esp32h2/include/hal/gpio_etm_ll.h b/components/esp_hal_gpio/esp32h2/include/hal/gpio_etm_ll.h index 44077aff54..c4628a0787 100644 --- a/components/esp_hal_gpio/esp32h2/include/hal/gpio_etm_ll.h +++ b/components/esp_hal_gpio/esp32h2/include/hal/gpio_etm_ll.h @@ -22,6 +22,8 @@ #define GPIO_LL_ETM_TASK_ID_CLR(ch) (GPIO_TASK_CH0_CLEAR + (ch)) #define GPIO_LL_ETM_TASK_ID_TOG(ch) (GPIO_TASK_CH0_TOGGLE + (ch)) +#define GPIO_LL_ETM_GET_HW() ((gpio_etm_dev_t *)(void *)&GPIO_EXT.etm) + #ifdef __cplusplus extern "C" { #endif diff --git a/components/esp_hal_gpio/esp32h21/include/hal/gpio_etm_ll.h b/components/esp_hal_gpio/esp32h21/include/hal/gpio_etm_ll.h index 4885ee3e16..e5f6706fb3 100644 --- a/components/esp_hal_gpio/esp32h21/include/hal/gpio_etm_ll.h +++ b/components/esp_hal_gpio/esp32h21/include/hal/gpio_etm_ll.h @@ -22,6 +22,8 @@ #define GPIO_LL_ETM_TASK_ID_CLR(ch) (GPIO_TASK_CH0_CLEAR + (ch)) #define GPIO_LL_ETM_TASK_ID_TOG(ch) (GPIO_TASK_CH0_TOGGLE + (ch)) +#define GPIO_LL_ETM_GET_HW() ((gpio_etm_dev_t *)(void *)&GPIO_EXT.etm) + #ifdef __cplusplus extern "C" { #endif diff --git a/components/esp_hal_gpio/esp32h4/include/hal/gpio_etm_ll.h b/components/esp_hal_gpio/esp32h4/include/hal/gpio_etm_ll.h index 6b4162225a..cdc8dc91e1 100644 --- a/components/esp_hal_gpio/esp32h4/include/hal/gpio_etm_ll.h +++ b/components/esp_hal_gpio/esp32h4/include/hal/gpio_etm_ll.h @@ -22,6 +22,8 @@ #define GPIO_LL_ETM_TASK_ID_CLR(ch) (GPIO_TASK_CH0_CLEAR + (ch)) #define GPIO_LL_ETM_TASK_ID_TOG(ch) (GPIO_TASK_CH0_TOGGLE + (ch)) +#define GPIO_LL_ETM_GET_HW() ((gpio_etm_dev_t *)(void *)&GPIO_EXT.etm) + #ifdef __cplusplus extern "C" { #endif diff --git a/components/esp_hal_gpio/esp32p4/include/hal/gpio_etm_ll.h b/components/esp_hal_gpio/esp32p4/include/hal/gpio_etm_ll.h index 44077aff54..c4628a0787 100644 --- a/components/esp_hal_gpio/esp32p4/include/hal/gpio_etm_ll.h +++ b/components/esp_hal_gpio/esp32p4/include/hal/gpio_etm_ll.h @@ -22,6 +22,8 @@ #define GPIO_LL_ETM_TASK_ID_CLR(ch) (GPIO_TASK_CH0_CLEAR + (ch)) #define GPIO_LL_ETM_TASK_ID_TOG(ch) (GPIO_TASK_CH0_TOGGLE + (ch)) +#define GPIO_LL_ETM_GET_HW() ((gpio_etm_dev_t *)(void *)&GPIO_EXT.etm) + #ifdef __cplusplus extern "C" { #endif diff --git a/components/esp_hal_gpio/esp32s31/include/hal/gpio_etm_ll.h b/components/esp_hal_gpio/esp32s31/include/hal/gpio_etm_ll.h index d753142d09..fe6922570b 100644 --- a/components/esp_hal_gpio/esp32s31/include/hal/gpio_etm_ll.h +++ b/components/esp_hal_gpio/esp32s31/include/hal/gpio_etm_ll.h @@ -22,6 +22,8 @@ #define GPIO_LL_ETM_TASK_ID_CLR(ch) (GPIO_TASK_CH0_CLEAR + (ch)) #define GPIO_LL_ETM_TASK_ID_TOG(ch) (GPIO_TASK_CH0_TOGGLE + (ch)) +#define GPIO_LL_ETM_GET_HW() ((gpio_etm_dev_t *)(void *)&GPIO_EXT.etm) + #ifdef __cplusplus extern "C" { #endif diff --git a/components/soc/esp32c5/ld/esp32c5.peripherals.ld b/components/soc/esp32c5/ld/esp32c5.peripherals.ld index 24734c783d..7fd257efe0 100644 --- a/components/soc/esp32c5/ld/esp32c5.peripherals.ld +++ b/components/soc/esp32c5/ld/esp32c5.peripherals.ld @@ -47,7 +47,6 @@ PROVIDE ( IO_MUX = 0x60090000 ); PROVIDE ( GPIO = 0x60091000 ); PROVIDE ( GPIO_EXT = 0x60091e00 ); PROVIDE ( SDM = 0x60091e00 ); -PROVIDE ( GPIO_ETM = 0x60091f18 ); PROVIDE ( MEM_MONITOR = 0x60092000 ); PROVIDE ( PAU = 0x60093000 ); PROVIDE ( HP_SYSTEM = 0x60095000 ); diff --git a/components/soc/esp32c5/register/soc/gpio_ext_struct.h b/components/soc/esp32c5/register/soc/gpio_ext_struct.h index d7720e63c4..d3887ef2ee 100644 --- a/components/soc/esp32c5/register/soc/gpio_ext_struct.h +++ b/components/soc/esp32c5/register/soc/gpio_ext_struct.h @@ -416,7 +416,6 @@ typedef struct { } gpio_ext_dev_t; extern gpio_sd_dev_t SDM; -extern gpio_etm_dev_t GPIO_ETM; extern gpio_ext_dev_t GPIO_EXT; #ifndef __cplusplus diff --git a/components/soc/esp32c6/ld/esp32c6.peripherals.ld b/components/soc/esp32c6/ld/esp32c6.peripherals.ld index caad419859..a2bbc81658 100644 --- a/components/soc/esp32c6/ld/esp32c6.peripherals.ld +++ b/components/soc/esp32c6/ld/esp32c6.peripherals.ld @@ -48,7 +48,6 @@ PROVIDE ( IO_MUX = 0x60090000 ); PROVIDE ( GPIO = 0x60091000 ); PROVIDE ( GPIO_EXT = 0x60091f00 ); PROVIDE ( SDM = 0x60091f00 ); -PROVIDE ( GPIO_ETM = 0x60091f60 ); PROVIDE ( MEM_MONITOR = 0x60092000 ); PROVIDE ( PAU = 0x60093000 ); diff --git a/components/soc/esp32c6/register/soc/gpio_ext_struct.h b/components/soc/esp32c6/register/soc/gpio_ext_struct.h index 5d066f6c70..c5a2cb09c7 100644 --- a/components/soc/esp32c6/register/soc/gpio_ext_struct.h +++ b/components/soc/esp32c6/register/soc/gpio_ext_struct.h @@ -201,7 +201,6 @@ typedef struct gpio_ext_dev_t { } gpio_ext_dev_t; extern gpio_sd_dev_t SDM; -extern gpio_etm_dev_t GPIO_ETM; extern gpio_ext_dev_t GPIO_EXT; #ifndef __cplusplus diff --git a/components/soc/esp32c61/ld/esp32c61.peripherals.ld b/components/soc/esp32c61/ld/esp32c61.peripherals.ld index 8f7e0dca33..dce7ad8a24 100644 --- a/components/soc/esp32c61/ld/esp32c61.peripherals.ld +++ b/components/soc/esp32c61/ld/esp32c61.peripherals.ld @@ -32,7 +32,6 @@ PROVIDE ( ECDSA = 0x6008E000 ); PROVIDE ( IO_MUX = 0x60090000 ); PROVIDE ( GPIO = 0x60091000 ); PROVIDE ( GPIO_EXT = 0x60091e00 ); -PROVIDE ( GPIO_ETM = 0x60091f18 ); PROVIDE ( MEM_MONITOR = 0x60092000 ); PROVIDE ( PAU = 0x60093000 ); PROVIDE ( HP_SYSTEM = 0x60095000 ); diff --git a/components/soc/esp32c61/register/soc/gpio_ext_struct.h b/components/soc/esp32c61/register/soc/gpio_ext_struct.h index da34fe95f9..7d07e7daaa 100644 --- a/components/soc/esp32c61/register/soc/gpio_ext_struct.h +++ b/components/soc/esp32c61/register/soc/gpio_ext_struct.h @@ -551,7 +551,6 @@ typedef struct { volatile gpio_ext_version_reg_t version; } gpio_ext_dev_t; -extern gpio_etm_dev_t GPIO_ETM; extern gpio_ext_dev_t GPIO_EXT; #ifndef __cplusplus diff --git a/components/soc/esp32h2/ld/esp32h2.peripherals.ld b/components/soc/esp32h2/ld/esp32h2.peripherals.ld index 2aa249c964..ad309d4813 100644 --- a/components/soc/esp32h2/ld/esp32h2.peripherals.ld +++ b/components/soc/esp32h2/ld/esp32h2.peripherals.ld @@ -45,7 +45,6 @@ PROVIDE ( IO_MUX = 0x60090000 ); PROVIDE ( GPIO = 0x60091000 ); PROVIDE ( GPIO_EXT = 0x60091f00 ); PROVIDE ( SDM = 0x60091f00 ); -PROVIDE ( GPIO_ETM = 0x60091f60 ); PROVIDE ( MEM_ACS_MONITOR = 0x60092000 ); PROVIDE ( PAU = 0x60093000 ); diff --git a/components/soc/esp32h2/register/soc/gpio_ext_struct.h b/components/soc/esp32h2/register/soc/gpio_ext_struct.h index 5ff803b3fc..17b5227dd2 100644 --- a/components/soc/esp32h2/register/soc/gpio_ext_struct.h +++ b/components/soc/esp32h2/register/soc/gpio_ext_struct.h @@ -306,7 +306,6 @@ typedef struct { } gpio_ext_dev_t; extern gpio_sd_dev_t SDM; -extern gpio_etm_dev_t GPIO_ETM; extern gpio_ext_dev_t GPIO_EXT; #ifndef __cplusplus diff --git a/components/soc/esp32h21/ld/esp32h21.peripherals.ld b/components/soc/esp32h21/ld/esp32h21.peripherals.ld index 08b2d4cd82..808fb0cc06 100644 --- a/components/soc/esp32h21/ld/esp32h21.peripherals.ld +++ b/components/soc/esp32h21/ld/esp32h21.peripherals.ld @@ -40,7 +40,6 @@ PROVIDE ( IO_MUX = 0x60090000 ); PROVIDE ( GPIO = 0x60091000 ); PROVIDE ( GPIO_EXT = 0x60091E00 ); PROVIDE ( SDM = 0x60091E04 ); -PROVIDE ( GPIO_ETM = 0x60091F18 ); PROVIDE ( MEM_MONITOR = 0x60092000 ); PROVIDE ( PAU = 0x60093000 ); PROVIDE ( HP_SYSTEM = 0x60095000 ); diff --git a/components/soc/esp32h21/register/soc/gpio_ext_struct.h b/components/soc/esp32h21/register/soc/gpio_ext_struct.h index 5a82543aae..29ae36bccc 100644 --- a/components/soc/esp32h21/register/soc/gpio_ext_struct.h +++ b/components/soc/esp32h21/register/soc/gpio_ext_struct.h @@ -592,7 +592,6 @@ typedef struct { } gpio_ext_dev_t; extern gpio_sd_dev_t SDM; -extern gpio_etm_dev_t GPIO_ETM; extern gpio_ext_dev_t GPIO_EXT; #ifndef __cplusplus diff --git a/components/soc/esp32h4/ld/esp32h4.peripherals.ld b/components/soc/esp32h4/ld/esp32h4.peripherals.ld index da609b7621..b6607c4ca8 100644 --- a/components/soc/esp32h4/ld/esp32h4.peripherals.ld +++ b/components/soc/esp32h4/ld/esp32h4.peripherals.ld @@ -46,7 +46,6 @@ PROVIDE ( IO_MUX = 0x60092000 ); PROVIDE ( GPIO = 0x60093000 ); PROVIDE ( GPIO_EXT = 0x60093E00 ); PROVIDE ( SDM = 0x60093E00 ); -PROVIDE ( GPIO_ETM = 0x60093F18 ); PROVIDE ( PCR = 0x60094000 ); PROVIDE ( SPIMEM0 = 0x60098000 ); PROVIDE ( SPIMEM1 = 0x60099000 ); diff --git a/components/soc/esp32h4/register/soc/gpio_ext_struct.h b/components/soc/esp32h4/register/soc/gpio_ext_struct.h index 7664547a8f..fe99a33297 100644 --- a/components/soc/esp32h4/register/soc/gpio_ext_struct.h +++ b/components/soc/esp32h4/register/soc/gpio_ext_struct.h @@ -271,7 +271,6 @@ typedef struct { } gpio_ext_dev_t; extern gpio_sd_dev_t SDM; -extern gpio_etm_dev_t GPIO_ETM; extern gpio_ext_dev_t GPIO_EXT; #ifndef __cplusplus diff --git a/components/soc/esp32p4/ld/esp32p4.peripherals.ld b/components/soc/esp32p4/ld/esp32p4.peripherals.ld index db01398913..354331399b 100644 --- a/components/soc/esp32p4/ld/esp32p4.peripherals.ld +++ b/components/soc/esp32p4/ld/esp32p4.peripherals.ld @@ -63,7 +63,6 @@ PROVIDE ( ECDSA = 0x50096000 ); PROVIDE ( GPIO = 0x500E0000 ); PROVIDE ( GPIO_EXT = 0x500E0F00 ); PROVIDE ( SDM = 0x500E0F00 ); -PROVIDE ( GPIO_ETM = 0x500E0F60 ); PROVIDE ( IO_MUX = 0x500E1000 ); PROVIDE ( MSPI_IOMUX = 0x500E1200 ); diff --git a/components/soc/esp32p4/register/hw_ver1/soc/gpio_ext_struct.h b/components/soc/esp32p4/register/hw_ver1/soc/gpio_ext_struct.h index e5fb6ea364..0511450eae 100644 --- a/components/soc/esp32p4/register/hw_ver1/soc/gpio_ext_struct.h +++ b/components/soc/esp32p4/register/hw_ver1/soc/gpio_ext_struct.h @@ -181,7 +181,6 @@ typedef struct { } gpio_ext_dev_t; extern gpio_sd_dev_t SDM; -extern gpio_etm_dev_t GPIO_ETM; extern gpio_ext_dev_t GPIO_EXT; #ifndef __cplusplus diff --git a/components/soc/esp32p4/register/hw_ver3/soc/gpio_ext_struct.h b/components/soc/esp32p4/register/hw_ver3/soc/gpio_ext_struct.h index e5fb6ea364..0511450eae 100644 --- a/components/soc/esp32p4/register/hw_ver3/soc/gpio_ext_struct.h +++ b/components/soc/esp32p4/register/hw_ver3/soc/gpio_ext_struct.h @@ -181,7 +181,6 @@ typedef struct { } gpio_ext_dev_t; extern gpio_sd_dev_t SDM; -extern gpio_etm_dev_t GPIO_ETM; extern gpio_ext_dev_t GPIO_EXT; #ifndef __cplusplus diff --git a/components/soc/esp32s31/ld/esp32s31.peripherals.ld b/components/soc/esp32s31/ld/esp32s31.peripherals.ld index 6f0fb49cbf..0c5bb04371 100644 --- a/components/soc/esp32s31/ld/esp32s31.peripherals.ld +++ b/components/soc/esp32s31/ld/esp32s31.peripherals.ld @@ -73,7 +73,6 @@ PROVIDE ( IO_MUX = 0x20582000 ); PROVIDE ( GPIO = 0x20583000 ); PROVIDE ( GPIO_EXT = 0x20583E00 ); PROVIDE ( SDM = 0x20583E04 ); -PROVIDE ( GPIO_ETM = 0x20583F18 ); PROVIDE ( MSPI_IOMUX = 0x20584000 ); PROVIDE ( HP_SYSTEM = 0x20586000 ); PROVIDE ( HP_SYS_CLKRST = 0x20587000 ); diff --git a/components/soc/esp32s31/register/soc/gpio_ext_struct.h b/components/soc/esp32s31/register/soc/gpio_ext_struct.h index 6476fa8fc6..1d419153a6 100644 --- a/components/soc/esp32s31/register/soc/gpio_ext_struct.h +++ b/components/soc/esp32s31/register/soc/gpio_ext_struct.h @@ -242,7 +242,6 @@ typedef struct { } gpio_ext_dev_t; extern gpio_sd_dev_t SDM; -extern gpio_etm_dev_t GPIO_ETM; extern gpio_ext_dev_t GPIO_EXT; #ifndef __cplusplus From e69f2c83464aa32b7e55c93c4013bf94d933f7d6 Mon Sep 17 00:00:00 2001 From: morris Date: Wed, 8 Apr 2026 15:05:55 +0800 Subject: [PATCH 3/3] refactor(gpio): derive SDM registers from GPIO_EXT Use GPIO_EXT.sigma_delta as the SDM register base on GPIO_EXT-based targets and remove standalone SDM symbols to eliminate manual offset/address maintenance risks. --- components/esp_hal_gpio/esp32c5/include/hal/sdm_ll.h | 2 +- components/esp_hal_gpio/esp32c6/include/hal/sdm_ll.h | 2 +- components/esp_hal_gpio/esp32h2/include/hal/sdm_ll.h | 2 +- components/esp_hal_gpio/esp32h21/include/hal/sdm_ll.h | 2 +- components/esp_hal_gpio/esp32h4/include/hal/sdm_ll.h | 2 +- components/esp_hal_gpio/esp32p4/include/hal/sdm_ll.h | 2 +- components/esp_hal_gpio/esp32s31/include/hal/sdm_ll.h | 2 +- components/soc/esp32c5/ld/esp32c5.peripherals.ld | 1 - components/soc/esp32c5/register/soc/gpio_ext_struct.h | 1 - components/soc/esp32c6/ld/esp32c6.peripherals.ld | 1 - components/soc/esp32c6/register/soc/gpio_ext_struct.h | 1 - components/soc/esp32h2/ld/esp32h2.peripherals.ld | 1 - components/soc/esp32h2/register/soc/gpio_ext_struct.h | 1 - components/soc/esp32h21/ld/esp32h21.peripherals.ld | 1 - components/soc/esp32h21/register/soc/gpio_ext_struct.h | 1 - components/soc/esp32h4/ld/esp32h4.peripherals.ld | 1 - components/soc/esp32h4/register/soc/gpio_ext_struct.h | 1 - components/soc/esp32p4/ld/esp32p4.peripherals.ld | 1 - components/soc/esp32p4/register/hw_ver1/soc/gpio_ext_struct.h | 1 - components/soc/esp32p4/register/hw_ver3/soc/gpio_ext_struct.h | 1 - components/soc/esp32s31/ld/esp32s31.peripherals.ld | 1 - components/soc/esp32s31/register/soc/gpio_ext_struct.h | 1 - 22 files changed, 7 insertions(+), 22 deletions(-) diff --git a/components/esp_hal_gpio/esp32c5/include/hal/sdm_ll.h b/components/esp_hal_gpio/esp32c5/include/hal/sdm_ll.h index 3897b85632..898457bb97 100644 --- a/components/esp_hal_gpio/esp32c5/include/hal/sdm_ll.h +++ b/components/esp_hal_gpio/esp32c5/include/hal/sdm_ll.h @@ -13,7 +13,7 @@ #include "soc/gpio_ext_reg.h" // Get SDM register base address with giving group number -#define SDM_LL_GET_HW(group_id) ((group_id == 0) ? (&SDM) : NULL) +#define SDM_LL_GET_HW(group_id) ((group_id == 0) ? ((gpio_sd_dev_t *)(void *)&GPIO_EXT.sigma_delta) : NULL) #define SDM_LL_PRESCALE_MAX (GPIO_EXT_SD0_PRESCALE_V + 1) diff --git a/components/esp_hal_gpio/esp32c6/include/hal/sdm_ll.h b/components/esp_hal_gpio/esp32c6/include/hal/sdm_ll.h index caad837a05..d06cea274b 100644 --- a/components/esp_hal_gpio/esp32c6/include/hal/sdm_ll.h +++ b/components/esp_hal_gpio/esp32c6/include/hal/sdm_ll.h @@ -13,7 +13,7 @@ #include "soc/gpio_ext_reg.h" // Get SDM register base address with giving group number -#define SDM_LL_GET_HW(group_id) ((group_id == 0) ? (&SDM) : NULL) +#define SDM_LL_GET_HW(group_id) ((group_id == 0) ? ((gpio_sd_dev_t *)(void *)&GPIO_EXT.sigma_delta) : NULL) #define SDM_LL_PRESCALE_MAX (GPIO_EXT_SD0_PRESCALE_V + 1) diff --git a/components/esp_hal_gpio/esp32h2/include/hal/sdm_ll.h b/components/esp_hal_gpio/esp32h2/include/hal/sdm_ll.h index caad837a05..d06cea274b 100644 --- a/components/esp_hal_gpio/esp32h2/include/hal/sdm_ll.h +++ b/components/esp_hal_gpio/esp32h2/include/hal/sdm_ll.h @@ -13,7 +13,7 @@ #include "soc/gpio_ext_reg.h" // Get SDM register base address with giving group number -#define SDM_LL_GET_HW(group_id) ((group_id == 0) ? (&SDM) : NULL) +#define SDM_LL_GET_HW(group_id) ((group_id == 0) ? ((gpio_sd_dev_t *)(void *)&GPIO_EXT.sigma_delta) : NULL) #define SDM_LL_PRESCALE_MAX (GPIO_EXT_SD0_PRESCALE_V + 1) diff --git a/components/esp_hal_gpio/esp32h21/include/hal/sdm_ll.h b/components/esp_hal_gpio/esp32h21/include/hal/sdm_ll.h index f290291d96..af69a576ee 100644 --- a/components/esp_hal_gpio/esp32h21/include/hal/sdm_ll.h +++ b/components/esp_hal_gpio/esp32h21/include/hal/sdm_ll.h @@ -13,7 +13,7 @@ #include "soc/gpio_ext_reg.h" // Get SDM register base address with giving group number -#define SDM_LL_GET_HW(group_id) ((group_id == 0) ? (&SDM) : NULL) +#define SDM_LL_GET_HW(group_id) ((group_id == 0) ? ((gpio_sd_dev_t *)(void *)&GPIO_EXT.sigma_delta) : NULL) #define SDM_LL_PRESCALE_MAX (GPIO_EXT_SD0_PRESCALE_V + 1) diff --git a/components/esp_hal_gpio/esp32h4/include/hal/sdm_ll.h b/components/esp_hal_gpio/esp32h4/include/hal/sdm_ll.h index f290291d96..af69a576ee 100644 --- a/components/esp_hal_gpio/esp32h4/include/hal/sdm_ll.h +++ b/components/esp_hal_gpio/esp32h4/include/hal/sdm_ll.h @@ -13,7 +13,7 @@ #include "soc/gpio_ext_reg.h" // Get SDM register base address with giving group number -#define SDM_LL_GET_HW(group_id) ((group_id == 0) ? (&SDM) : NULL) +#define SDM_LL_GET_HW(group_id) ((group_id == 0) ? ((gpio_sd_dev_t *)(void *)&GPIO_EXT.sigma_delta) : NULL) #define SDM_LL_PRESCALE_MAX (GPIO_EXT_SD0_PRESCALE_V + 1) diff --git a/components/esp_hal_gpio/esp32p4/include/hal/sdm_ll.h b/components/esp_hal_gpio/esp32p4/include/hal/sdm_ll.h index caad837a05..d06cea274b 100644 --- a/components/esp_hal_gpio/esp32p4/include/hal/sdm_ll.h +++ b/components/esp_hal_gpio/esp32p4/include/hal/sdm_ll.h @@ -13,7 +13,7 @@ #include "soc/gpio_ext_reg.h" // Get SDM register base address with giving group number -#define SDM_LL_GET_HW(group_id) ((group_id == 0) ? (&SDM) : NULL) +#define SDM_LL_GET_HW(group_id) ((group_id == 0) ? ((gpio_sd_dev_t *)(void *)&GPIO_EXT.sigma_delta) : NULL) #define SDM_LL_PRESCALE_MAX (GPIO_EXT_SD0_PRESCALE_V + 1) diff --git a/components/esp_hal_gpio/esp32s31/include/hal/sdm_ll.h b/components/esp_hal_gpio/esp32s31/include/hal/sdm_ll.h index 15f7403805..a52fc6ad59 100644 --- a/components/esp_hal_gpio/esp32s31/include/hal/sdm_ll.h +++ b/components/esp_hal_gpio/esp32s31/include/hal/sdm_ll.h @@ -14,7 +14,7 @@ #include "soc/soc.h" // Get SDM register base address with giving group number -#define SDM_LL_GET_HW(group_id) ((group_id == 0) ? (&SDM) : NULL) +#define SDM_LL_GET_HW(group_id) ((group_id == 0) ? ((gpio_sd_dev_t *)(void *)&GPIO_EXT.sigma_delta) : NULL) #define SDM_LL_PRESCALE_MAX (GPIO_EXT_SD0_PRESCALE_V + 1) diff --git a/components/soc/esp32c5/ld/esp32c5.peripherals.ld b/components/soc/esp32c5/ld/esp32c5.peripherals.ld index 7fd257efe0..70438fb69a 100644 --- a/components/soc/esp32c5/ld/esp32c5.peripherals.ld +++ b/components/soc/esp32c5/ld/esp32c5.peripherals.ld @@ -46,7 +46,6 @@ PROVIDE ( ECDSA = 0x6008E000 ); PROVIDE ( IO_MUX = 0x60090000 ); PROVIDE ( GPIO = 0x60091000 ); PROVIDE ( GPIO_EXT = 0x60091e00 ); -PROVIDE ( SDM = 0x60091e00 ); PROVIDE ( MEM_MONITOR = 0x60092000 ); PROVIDE ( PAU = 0x60093000 ); PROVIDE ( HP_SYSTEM = 0x60095000 ); diff --git a/components/soc/esp32c5/register/soc/gpio_ext_struct.h b/components/soc/esp32c5/register/soc/gpio_ext_struct.h index d3887ef2ee..94676e8d9c 100644 --- a/components/soc/esp32c5/register/soc/gpio_ext_struct.h +++ b/components/soc/esp32c5/register/soc/gpio_ext_struct.h @@ -415,7 +415,6 @@ typedef struct { volatile gpio_ext_version_reg_t version; } gpio_ext_dev_t; -extern gpio_sd_dev_t SDM; extern gpio_ext_dev_t GPIO_EXT; #ifndef __cplusplus diff --git a/components/soc/esp32c6/ld/esp32c6.peripherals.ld b/components/soc/esp32c6/ld/esp32c6.peripherals.ld index a2bbc81658..bf0f9d1549 100644 --- a/components/soc/esp32c6/ld/esp32c6.peripherals.ld +++ b/components/soc/esp32c6/ld/esp32c6.peripherals.ld @@ -47,7 +47,6 @@ PROVIDE ( HMAC = 0x6008D000 ); PROVIDE ( IO_MUX = 0x60090000 ); PROVIDE ( GPIO = 0x60091000 ); PROVIDE ( GPIO_EXT = 0x60091f00 ); -PROVIDE ( SDM = 0x60091f00 ); PROVIDE ( MEM_MONITOR = 0x60092000 ); PROVIDE ( PAU = 0x60093000 ); diff --git a/components/soc/esp32c6/register/soc/gpio_ext_struct.h b/components/soc/esp32c6/register/soc/gpio_ext_struct.h index c5a2cb09c7..7f6ff0c851 100644 --- a/components/soc/esp32c6/register/soc/gpio_ext_struct.h +++ b/components/soc/esp32c6/register/soc/gpio_ext_struct.h @@ -200,7 +200,6 @@ typedef struct gpio_ext_dev_t { volatile gpio_ext_version_reg_t version; } gpio_ext_dev_t; -extern gpio_sd_dev_t SDM; extern gpio_ext_dev_t GPIO_EXT; #ifndef __cplusplus diff --git a/components/soc/esp32h2/ld/esp32h2.peripherals.ld b/components/soc/esp32h2/ld/esp32h2.peripherals.ld index ad309d4813..d94f8caea8 100644 --- a/components/soc/esp32h2/ld/esp32h2.peripherals.ld +++ b/components/soc/esp32h2/ld/esp32h2.peripherals.ld @@ -44,7 +44,6 @@ PROVIDE ( ECDSA = 0x6008E000 ); PROVIDE ( IO_MUX = 0x60090000 ); PROVIDE ( GPIO = 0x60091000 ); PROVIDE ( GPIO_EXT = 0x60091f00 ); -PROVIDE ( SDM = 0x60091f00 ); PROVIDE ( MEM_ACS_MONITOR = 0x60092000 ); PROVIDE ( PAU = 0x60093000 ); diff --git a/components/soc/esp32h2/register/soc/gpio_ext_struct.h b/components/soc/esp32h2/register/soc/gpio_ext_struct.h index 17b5227dd2..f249078a8f 100644 --- a/components/soc/esp32h2/register/soc/gpio_ext_struct.h +++ b/components/soc/esp32h2/register/soc/gpio_ext_struct.h @@ -305,7 +305,6 @@ typedef struct { volatile gpio_ext_version_reg_t version; } gpio_ext_dev_t; -extern gpio_sd_dev_t SDM; extern gpio_ext_dev_t GPIO_EXT; #ifndef __cplusplus diff --git a/components/soc/esp32h21/ld/esp32h21.peripherals.ld b/components/soc/esp32h21/ld/esp32h21.peripherals.ld index 808fb0cc06..aebd1447c2 100644 --- a/components/soc/esp32h21/ld/esp32h21.peripherals.ld +++ b/components/soc/esp32h21/ld/esp32h21.peripherals.ld @@ -39,7 +39,6 @@ PROVIDE ( ECDSA = 0x6008E000 ); PROVIDE ( IO_MUX = 0x60090000 ); PROVIDE ( GPIO = 0x60091000 ); PROVIDE ( GPIO_EXT = 0x60091E00 ); -PROVIDE ( SDM = 0x60091E04 ); PROVIDE ( MEM_MONITOR = 0x60092000 ); PROVIDE ( PAU = 0x60093000 ); PROVIDE ( HP_SYSTEM = 0x60095000 ); diff --git a/components/soc/esp32h21/register/soc/gpio_ext_struct.h b/components/soc/esp32h21/register/soc/gpio_ext_struct.h index 29ae36bccc..86f67b1e6e 100644 --- a/components/soc/esp32h21/register/soc/gpio_ext_struct.h +++ b/components/soc/esp32h21/register/soc/gpio_ext_struct.h @@ -591,7 +591,6 @@ typedef struct { volatile gpio_ext_version_reg_t version; } gpio_ext_dev_t; -extern gpio_sd_dev_t SDM; extern gpio_ext_dev_t GPIO_EXT; #ifndef __cplusplus diff --git a/components/soc/esp32h4/ld/esp32h4.peripherals.ld b/components/soc/esp32h4/ld/esp32h4.peripherals.ld index b6607c4ca8..de11ca0064 100644 --- a/components/soc/esp32h4/ld/esp32h4.peripherals.ld +++ b/components/soc/esp32h4/ld/esp32h4.peripherals.ld @@ -45,7 +45,6 @@ PROVIDE ( TIMERG1 = 0x60091000 ); PROVIDE ( IO_MUX = 0x60092000 ); PROVIDE ( GPIO = 0x60093000 ); PROVIDE ( GPIO_EXT = 0x60093E00 ); -PROVIDE ( SDM = 0x60093E00 ); PROVIDE ( PCR = 0x60094000 ); PROVIDE ( SPIMEM0 = 0x60098000 ); PROVIDE ( SPIMEM1 = 0x60099000 ); diff --git a/components/soc/esp32h4/register/soc/gpio_ext_struct.h b/components/soc/esp32h4/register/soc/gpio_ext_struct.h index fe99a33297..f1af8f8c56 100644 --- a/components/soc/esp32h4/register/soc/gpio_ext_struct.h +++ b/components/soc/esp32h4/register/soc/gpio_ext_struct.h @@ -270,7 +270,6 @@ typedef struct { volatile gpio_ext_version_reg_t ext_version; } gpio_ext_dev_t; -extern gpio_sd_dev_t SDM; extern gpio_ext_dev_t GPIO_EXT; #ifndef __cplusplus diff --git a/components/soc/esp32p4/ld/esp32p4.peripherals.ld b/components/soc/esp32p4/ld/esp32p4.peripherals.ld index 354331399b..8618952a3b 100644 --- a/components/soc/esp32p4/ld/esp32p4.peripherals.ld +++ b/components/soc/esp32p4/ld/esp32p4.peripherals.ld @@ -62,7 +62,6 @@ PROVIDE ( ECDSA = 0x50096000 ); PROVIDE ( GPIO = 0x500E0000 ); PROVIDE ( GPIO_EXT = 0x500E0F00 ); -PROVIDE ( SDM = 0x500E0F00 ); PROVIDE ( IO_MUX = 0x500E1000 ); PROVIDE ( MSPI_IOMUX = 0x500E1200 ); diff --git a/components/soc/esp32p4/register/hw_ver1/soc/gpio_ext_struct.h b/components/soc/esp32p4/register/hw_ver1/soc/gpio_ext_struct.h index 0511450eae..af6e958b0c 100644 --- a/components/soc/esp32p4/register/hw_ver1/soc/gpio_ext_struct.h +++ b/components/soc/esp32p4/register/hw_ver1/soc/gpio_ext_struct.h @@ -180,7 +180,6 @@ typedef struct { volatile gpio_ext_version_reg_t version; } gpio_ext_dev_t; -extern gpio_sd_dev_t SDM; extern gpio_ext_dev_t GPIO_EXT; #ifndef __cplusplus diff --git a/components/soc/esp32p4/register/hw_ver3/soc/gpio_ext_struct.h b/components/soc/esp32p4/register/hw_ver3/soc/gpio_ext_struct.h index 0511450eae..af6e958b0c 100644 --- a/components/soc/esp32p4/register/hw_ver3/soc/gpio_ext_struct.h +++ b/components/soc/esp32p4/register/hw_ver3/soc/gpio_ext_struct.h @@ -180,7 +180,6 @@ typedef struct { volatile gpio_ext_version_reg_t version; } gpio_ext_dev_t; -extern gpio_sd_dev_t SDM; extern gpio_ext_dev_t GPIO_EXT; #ifndef __cplusplus diff --git a/components/soc/esp32s31/ld/esp32s31.peripherals.ld b/components/soc/esp32s31/ld/esp32s31.peripherals.ld index 0c5bb04371..9e11d13ae1 100644 --- a/components/soc/esp32s31/ld/esp32s31.peripherals.ld +++ b/components/soc/esp32s31/ld/esp32s31.peripherals.ld @@ -72,7 +72,6 @@ PROVIDE ( TIMERG1 = 0x20581000 ); PROVIDE ( IO_MUX = 0x20582000 ); PROVIDE ( GPIO = 0x20583000 ); PROVIDE ( GPIO_EXT = 0x20583E00 ); -PROVIDE ( SDM = 0x20583E04 ); PROVIDE ( MSPI_IOMUX = 0x20584000 ); PROVIDE ( HP_SYSTEM = 0x20586000 ); PROVIDE ( HP_SYS_CLKRST = 0x20587000 ); diff --git a/components/soc/esp32s31/register/soc/gpio_ext_struct.h b/components/soc/esp32s31/register/soc/gpio_ext_struct.h index 1d419153a6..528355915c 100644 --- a/components/soc/esp32s31/register/soc/gpio_ext_struct.h +++ b/components/soc/esp32s31/register/soc/gpio_ext_struct.h @@ -241,7 +241,6 @@ typedef struct { volatile gpio_ext_version_reg_t version; } gpio_ext_dev_t; -extern gpio_sd_dev_t SDM; extern gpio_ext_dev_t GPIO_EXT; #ifndef __cplusplus