diff --git a/components/driver/gpio.c b/components/driver/gpio.c index e9e711989b..f7742ef245 100644 --- a/components/driver/gpio.c +++ b/components/driver/gpio.c @@ -391,7 +391,8 @@ esp_err_t gpio_config(const gpio_config_t *pGPIOConfig) gpio_intr_disable(io_num); } - PIN_FUNC_SELECT(io_reg, PIN_FUNC_GPIO); /*function number 2 is GPIO_FUNC for each pin */ + /* By default, all the pins have to be configured as GPIO pins. */ + PIN_FUNC_SELECT(io_reg, PIN_FUNC_GPIO); } io_num++; diff --git a/components/hal/include/hal/gpio_types.h b/components/hal/include/hal/gpio_types.h index 31a5ed108f..2438014a5e 100644 --- a/components/hal/include/hal/gpio_types.h +++ b/components/hal/include/hal/gpio_types.h @@ -292,7 +292,7 @@ typedef enum { GPIO_NUM_16 = 16, /*!< GPIO16, input and output */ GPIO_NUM_17 = 17, /*!< GPIO17, input and output */ GPIO_NUM_18 = 18, /*!< GPIO18, input and output */ - // TODO: ESP32C3 IDF-2463 + GPIO_NUM_19 = 19, /*!< GPIO19, input and output */ GPIO_NUM_20 = 20, /*!< GPIO20, input and output */ GPIO_NUM_21 = 21, /*!< GPIO21, input and output */ GPIO_NUM_22 = 22, /*!< GPIO22, input and output */ diff --git a/components/soc/esp32c3/include/soc/io_mux_reg.h b/components/soc/esp32c3/include/soc/io_mux_reg.h index 254872a5fc..3f338ea92d 100644 --- a/components/soc/esp32c3/include/soc/io_mux_reg.h +++ b/components/soc/esp32c3/include/soc/io_mux_reg.h @@ -117,7 +117,7 @@ #define IO_MUX_GPIO20_REG PERIPHS_IO_MUX_U0RXD_U #define IO_MUX_GPIO21_REG PERIPHS_IO_MUX_U0TXD_U -#define FUNC_GPIO_GPIO 1 +/* Value to set in IO Mux to use a pin as GPIO. */ #define PIN_FUNC_GPIO 1 #define GPIO_PAD_PULLUP(num) do{PIN_PULLDWN_DIS(IOMUX_REG_GPIO##num);PIN_PULLUP_EN(IOMUX_REG_GPIO##num);}while(0)