From 7e54886a4e3ed966591cef9ea9c9c16b671dfe24 Mon Sep 17 00:00:00 2001 From: gaoxu Date: Fri, 21 Feb 2025 10:51:47 +0800 Subject: [PATCH] feat(esp32h21): move gpio intr source to gpio_ll.h --- components/esp_driver_gpio/src/gpio.c | 8 +------- components/hal/esp32/include/hal/gpio_ll.h | 2 ++ components/hal/esp32c2/include/hal/gpio_ll.h | 2 ++ components/hal/esp32c3/include/hal/gpio_ll.h | 2 ++ components/hal/esp32c5/include/hal/gpio_ll.h | 2 ++ components/hal/esp32c6/include/hal/gpio_ll.h | 2 ++ components/hal/esp32c61/include/hal/gpio_ll.h | 2 ++ components/hal/esp32h2/include/hal/gpio_ll.h | 2 ++ components/hal/esp32h21/include/hal/gpio_ll.h | 2 ++ components/hal/esp32p4/include/hal/gpio_ll.h | 2 ++ components/hal/esp32s2/include/hal/gpio_ll.h | 2 ++ components/hal/esp32s3/include/hal/gpio_ll.h | 2 ++ 12 files changed, 23 insertions(+), 7 deletions(-) diff --git a/components/esp_driver_gpio/src/gpio.c b/components/esp_driver_gpio/src/gpio.c index b6f3c4c58f..69baf27b14 100644 --- a/components/esp_driver_gpio/src/gpio.c +++ b/components/esp_driver_gpio/src/gpio.c @@ -604,13 +604,7 @@ esp_err_t gpio_isr_register(void (*fn)(void *), void *arg, int intr_alloc_flags, { GPIO_CHECK(fn, "GPIO ISR null", ESP_ERR_INVALID_ARG); gpio_isr_alloc_t p; -#if CONFIG_IDF_TARGET_ESP32P4 //TODO: IDF-7995 - p.source = ETS_GPIO_INTR0_SOURCE; -#elif CONFIG_IDF_TARGET_ESP32H21 // TODO: IDF-11611 - p.source = ETS_GPIO_INTERRUPT_PRO_SOURCE; -#else - p.source = ETS_GPIO_INTR_SOURCE; -#endif + p.source = GPIO_LL_INTR_SOURCE0; p.intr_alloc_flags = intr_alloc_flags; #if SOC_ANA_CMPR_INTR_SHARE_WITH_GPIO p.intr_alloc_flags |= ESP_INTR_FLAG_SHARED; diff --git a/components/hal/esp32/include/hal/gpio_ll.h b/components/hal/esp32/include/hal/gpio_ll.h index 4bd509057f..930006ad49 100644 --- a/components/hal/esp32/include/hal/gpio_ll.h +++ b/components/hal/esp32/include/hal/gpio_ll.h @@ -42,6 +42,8 @@ extern const uint8_t GPIO_PIN_MUX_REG_OFFSET[SOC_GPIO_PIN_COUNT]; #define GPIO_LL_PRO_CPU_NMI_INTR_ENA (BIT(3)) #define GPIO_LL_SDIO_EXT_INTR_ENA (BIT(4)) +#define GPIO_LL_INTR_SOURCE0 ETS_GPIO_INTR_SOURCE + /** * @brief Get the configuration for an IO * diff --git a/components/hal/esp32c2/include/hal/gpio_ll.h b/components/hal/esp32c2/include/hal/gpio_ll.h index 8319374cdd..b5b915f505 100644 --- a/components/hal/esp32c2/include/hal/gpio_ll.h +++ b/components/hal/esp32c2/include/hal/gpio_ll.h @@ -33,6 +33,8 @@ extern "C" { #define GPIO_LL_PRO_CPU_INTR_ENA (BIT(0)) #define GPIO_LL_PRO_CPU_NMI_INTR_ENA (BIT(1)) +#define GPIO_LL_INTR_SOURCE0 ETS_GPIO_INTR_SOURCE + /** * @brief Get the configuration for an IO * diff --git a/components/hal/esp32c3/include/hal/gpio_ll.h b/components/hal/esp32c3/include/hal/gpio_ll.h index d7a08c9083..834f994fb3 100644 --- a/components/hal/esp32c3/include/hal/gpio_ll.h +++ b/components/hal/esp32c3/include/hal/gpio_ll.h @@ -35,6 +35,8 @@ extern "C" { #define GPIO_LL_PRO_CPU_INTR_ENA (BIT(0)) #define GPIO_LL_PRO_CPU_NMI_INTR_ENA (BIT(1)) +#define GPIO_LL_INTR_SOURCE0 ETS_GPIO_INTR_SOURCE + /** * @brief Enable pull-up on GPIO. * diff --git a/components/hal/esp32c5/include/hal/gpio_ll.h b/components/hal/esp32c5/include/hal/gpio_ll.h index f16a387abb..fd9f444aa4 100644 --- a/components/hal/esp32c5/include/hal/gpio_ll.h +++ b/components/hal/esp32c5/include/hal/gpio_ll.h @@ -37,6 +37,8 @@ extern "C" { #define GPIO_LL_PRO_CPU_INTR_ENA (BIT(0)) +#define GPIO_LL_INTR_SOURCE0 ETS_GPIO_INTR_SOURCE + /** * @brief Get the configuration for an IO * diff --git a/components/hal/esp32c6/include/hal/gpio_ll.h b/components/hal/esp32c6/include/hal/gpio_ll.h index eac9a643e1..54d39baa3b 100644 --- a/components/hal/esp32c6/include/hal/gpio_ll.h +++ b/components/hal/esp32c6/include/hal/gpio_ll.h @@ -38,6 +38,8 @@ extern "C" { #define GPIO_LL_PRO_CPU_INTR_ENA (BIT(0)) #define GPIO_LL_PRO_CPU_NMI_INTR_ENA (BIT(1)) +#define GPIO_LL_INTR_SOURCE0 ETS_GPIO_INTR_SOURCE + /** * @brief Get the configuration for an IO * diff --git a/components/hal/esp32c61/include/hal/gpio_ll.h b/components/hal/esp32c61/include/hal/gpio_ll.h index 1ebc0c5856..d8c3603db8 100644 --- a/components/hal/esp32c61/include/hal/gpio_ll.h +++ b/components/hal/esp32c61/include/hal/gpio_ll.h @@ -38,6 +38,8 @@ extern "C" { #define GPIO_LL_PRO_CPU_INTR_ENA (BIT(0)) #define GPIO_LL_PRO_CPU_NMI_INTR_ENA (BIT(1)) +#define GPIO_LL_INTR_SOURCE0 ETS_GPIO_INTR_SOURCE + /** * @brief Get the configuration for an IO * diff --git a/components/hal/esp32h2/include/hal/gpio_ll.h b/components/hal/esp32h2/include/hal/gpio_ll.h index 17a79723b2..2589dea163 100644 --- a/components/hal/esp32h2/include/hal/gpio_ll.h +++ b/components/hal/esp32h2/include/hal/gpio_ll.h @@ -38,6 +38,8 @@ extern "C" { #define GPIO_LL_PRO_CPU_INTR_ENA (BIT(0)) #define GPIO_LL_PRO_CPU_NMI_INTR_ENA (BIT(1)) +#define GPIO_LL_INTR_SOURCE0 ETS_GPIO_INTR_SOURCE + /** * @brief Get the configuration for an IO * diff --git a/components/hal/esp32h21/include/hal/gpio_ll.h b/components/hal/esp32h21/include/hal/gpio_ll.h index 62c68295b5..8f25460f88 100644 --- a/components/hal/esp32h21/include/hal/gpio_ll.h +++ b/components/hal/esp32h21/include/hal/gpio_ll.h @@ -39,6 +39,8 @@ extern "C" { #define GPIO_LL_PRO_CPU_INTR_ENA (BIT(0)) #define GPIO_LL_PRO_CPU_NMI_INTR_ENA (BIT(1)) +#define GPIO_LL_INTR_SOURCE0 ETS_GPIO_INTERRUPT_PRO_SOURCE + /** * @brief Get the configuration for an IO * diff --git a/components/hal/esp32p4/include/hal/gpio_ll.h b/components/hal/esp32p4/include/hal/gpio_ll.h index a3505eb646..565604d967 100644 --- a/components/hal/esp32p4/include/hal/gpio_ll.h +++ b/components/hal/esp32p4/include/hal/gpio_ll.h @@ -44,6 +44,8 @@ extern "C" { #define GPIO_LL_INTR2_ENA (BIT(3)) #define GPIO_LL_INTR3_ENA (BIT(4)) +#define GPIO_LL_INTR_SOURCE0 ETS_GPIO_INTR0_SOURCE + /** * @brief Get the configuration for an IO * diff --git a/components/hal/esp32s2/include/hal/gpio_ll.h b/components/hal/esp32s2/include/hal/gpio_ll.h index cb4f004cd6..872fc55c82 100644 --- a/components/hal/esp32s2/include/hal/gpio_ll.h +++ b/components/hal/esp32s2/include/hal/gpio_ll.h @@ -32,6 +32,8 @@ extern "C" { #define GPIO_LL_PRO_CPU_INTR_ENA (BIT(0)) #define GPIO_LL_PRO_CPU_NMI_INTR_ENA (BIT(1)) +#define GPIO_LL_INTR_SOURCE0 ETS_GPIO_INTR_SOURCE + /** * @brief Get the configuration for an IO * diff --git a/components/hal/esp32s3/include/hal/gpio_ll.h b/components/hal/esp32s3/include/hal/gpio_ll.h index c90e7d4229..ddebea0479 100644 --- a/components/hal/esp32s3/include/hal/gpio_ll.h +++ b/components/hal/esp32s3/include/hal/gpio_ll.h @@ -33,6 +33,8 @@ extern "C" { #define GPIO_LL_INTR_ENA (BIT(0)) #define GPIO_LL_NMI_INTR_ENA (BIT(1)) +#define GPIO_LL_INTR_SOURCE0 ETS_GPIO_INTR_SOURCE + /** * @brief Enable pull-up on GPIO. *