@@ -50,6 +50,9 @@ constexpr gpio_config_t gpio_cfg_table[] = {
5050 .pull_up_en = GPIO_PULLUP_DISABLE ,
5151 .pull_down_en = GPIO_PULLDOWN_DISABLE ,
5252 .intr_type = GPIO_INTR_DISABLE ,
53+ #if defined(CONFIG_IDF_TARGET_ESP32P4)
54+ .hys_ctrl_mode = GPIO_HYS_SOFT_ENABLE ,
55+ #endif
5356 },
5457 {
5558 // Output
@@ -58,6 +61,9 @@ constexpr gpio_config_t gpio_cfg_table[] = {
5861 .pull_up_en = GPIO_PULLUP_DISABLE ,
5962 .pull_down_en = GPIO_PULLDOWN_DISABLE ,
6063 .intr_type = GPIO_INTR_DISABLE ,
64+ #if defined(CONFIG_IDF_TARGET_ESP32P4)
65+ .hys_ctrl_mode = GPIO_HYS_SOFT_ENABLE ,
66+ #endif
6167 },
6268 {
6369 // Pullup
@@ -66,6 +72,9 @@ constexpr gpio_config_t gpio_cfg_table[] = {
6672 .pull_up_en = GPIO_PULLUP_ENABLE ,
6773 .pull_down_en = GPIO_PULLDOWN_DISABLE ,
6874 .intr_type = GPIO_INTR_DISABLE ,
75+ #if defined(CONFIG_IDF_TARGET_ESP32P4)
76+ .hys_ctrl_mode = GPIO_HYS_SOFT_ENABLE ,
77+ #endif
6978 },
7079 {
7180 // InputPullup
@@ -74,6 +83,9 @@ constexpr gpio_config_t gpio_cfg_table[] = {
7483 .pull_up_en = GPIO_PULLUP_ENABLE ,
7584 .pull_down_en = GPIO_PULLDOWN_DISABLE ,
7685 .intr_type = GPIO_INTR_DISABLE ,
86+ #if defined(CONFIG_IDF_TARGET_ESP32P4)
87+ .hys_ctrl_mode = GPIO_HYS_SOFT_ENABLE ,
88+ #endif
7789 },
7890 {
7991 // Pulldown
@@ -82,6 +94,9 @@ constexpr gpio_config_t gpio_cfg_table[] = {
8294 .pull_up_en = GPIO_PULLUP_DISABLE ,
8395 .pull_down_en = GPIO_PULLDOWN_ENABLE ,
8496 .intr_type = GPIO_INTR_DISABLE ,
97+ #if defined(CONFIG_IDF_TARGET_ESP32P4)
98+ .hys_ctrl_mode = GPIO_HYS_SOFT_ENABLE ,
99+ #endif
85100 },
86101 {
87102 // InputPulldown
@@ -90,6 +105,9 @@ constexpr gpio_config_t gpio_cfg_table[] = {
90105 .pull_up_en = GPIO_PULLUP_DISABLE ,
91106 .pull_down_en = GPIO_PULLDOWN_ENABLE ,
92107 .intr_type = GPIO_INTR_DISABLE ,
108+ #if defined(CONFIG_IDF_TARGET_ESP32P4)
109+ .hys_ctrl_mode = GPIO_HYS_SOFT_ENABLE ,
110+ #endif
93111 },
94112 {
95113 // OpenDrain
@@ -98,6 +116,9 @@ constexpr gpio_config_t gpio_cfg_table[] = {
98116 .pull_up_en = GPIO_PULLUP_ENABLE , //
99117 .pull_down_en = GPIO_PULLDOWN_DISABLE ,
100118 .intr_type = GPIO_INTR_DISABLE ,
119+ #if defined(CONFIG_IDF_TARGET_ESP32P4)
120+ .hys_ctrl_mode = GPIO_HYS_SOFT_ENABLE ,
121+ #endif
101122 },
102123 {
103124 // OutputOpenDrain,
@@ -106,6 +127,9 @@ constexpr gpio_config_t gpio_cfg_table[] = {
106127 .pull_up_en = GPIO_PULLUP_DISABLE ,
107128 .pull_down_en = GPIO_PULLDOWN_DISABLE ,
108129 .intr_type = GPIO_INTR_DISABLE ,
130+ #if defined(CONFIG_IDF_TARGET_ESP32P4)
131+ .hys_ctrl_mode = GPIO_HYS_SOFT_ENABLE ,
132+ #endif
109133 },
110134 {
111135 // Analog
@@ -114,6 +138,9 @@ constexpr gpio_config_t gpio_cfg_table[] = {
114138 .pull_up_en = GPIO_PULLUP_DISABLE ,
115139 .pull_down_en = GPIO_PULLDOWN_DISABLE ,
116140 .intr_type = GPIO_INTR_DISABLE ,
141+ #if defined(CONFIG_IDF_TARGET_ESP32P4)
142+ .hys_ctrl_mode = GPIO_HYS_SOFT_ENABLE ,
143+ #endif
117144 },
118145};
119146
@@ -384,7 +411,11 @@ m5::hal::error::error_t AdapterGPIOBase::GPIOImpl::read_analog(uint16_t& value,
384411
385412 adc_oneshot_unit_handle_t adc_handle{};
386413 adc_oneshot_unit_init_cfg_t init_config = {
414+ #if defined(CONFIG_IDF_TARGET_ESP32C6)
415+ .unit_id = unit, .clk_src = ADC_DIGI_CLK_SRC_DEFAULT , .ulp_mode = ADC_ULP_MODE_DISABLE };
416+ #else
387417 .unit_id = unit, .clk_src = ADC_RTC_CLK_SRC_DEFAULT , .ulp_mode = ADC_ULP_MODE_DISABLE };
418+ #endif
388419
389420 if (adc_oneshot_new_unit (&init_config, &adc_handle) != ESP_OK ) {
390421 return m5::hal::error::error_t ::UNKNOWN_ERROR ;
0 commit comments