diff --git a/components/esp_rom/esp32c61/include/esp32c61/rom/gpio.h b/components/esp_rom/esp32c61/include/esp32c61/rom/gpio.h index f4272ea6e3..abaa4a8ab0 100644 --- a/components/esp_rom/esp32c61/include/esp32c61/rom/gpio.h +++ b/components/esp_rom/esp32c61/include/esp32c61/rom/gpio.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -44,7 +44,7 @@ typedef enum { /** - * @brief Change GPIO(0-24) pin output by setting, clearing, or disabling pins, GPIO0<->BIT(0). + * @brief Change GPIO(0-29) pin output by setting, clearing, or disabling pins, GPIO0<->BIT(0). * There is no particular ordering guaranteed; so if the order of writes is significant, * calling code should divide a single call into multiple calls. * @@ -61,7 +61,7 @@ typedef enum { void gpio_output_set(uint32_t set_mask, uint32_t clear_mask, uint32_t enable_mask, uint32_t disable_mask); /** - * @brief Sample the value of GPIO input pins(0-24) and returns a bitmask. + * @brief Sample the value of GPIO input pins(0-29) and returns a bitmask. * @param None * * @return uint32_t : bitmask for GPIO input pins, BIT(0) for GPIO0. @@ -93,7 +93,7 @@ void gpio_pin_wakeup_disable(void); /** * @brief set gpio input to a signal, one gpio can input to several signals. * - * @param uint32_t gpio : gpio number, 0~24 + * @param uint32_t gpio : gpio number, 0~29 * gpio == 0x30, input 0 to signal * gpio == 0x20, input 1 to signal * @@ -108,10 +108,10 @@ void gpio_matrix_in(uint32_t gpio, uint32_t signal_idx, bool inv); /** * @brief set signal output to gpio, one signal can output to several gpios. * - * @param uint32_t gpio : gpio number, 0~24 + * @param uint32_t gpio : gpio number, 0~29 * * @param uint32_t signal_idx : signal index. - * signal_idx == 0x80, cancel output put to the gpio + * signal_idx == 0x100, cancel output put to the gpio * * @param bool out_inv : the signal output is invert or not * @@ -124,7 +124,7 @@ void gpio_matrix_out(uint32_t gpio, uint32_t signal_idx, bool out_inv, bool oen_ /** * @brief Select pad as a gpio function from IOMUX. * - * @param uint32_t gpio_num : gpio number, 0~24 + * @param uint32_t gpio_num : gpio number, 0~29 * * @return None */ @@ -133,7 +133,7 @@ void gpio_pad_select_gpio(uint32_t gpio_num); /** * @brief Set pad driver capability. * - * @param uint32_t gpio_num : gpio number, 0~24 + * @param uint32_t gpio_num : gpio number, 0~29 * * @param uint32_t drv : 0-3 * @@ -144,7 +144,7 @@ void gpio_pad_set_drv(uint32_t gpio_num, uint32_t drv); /** * @brief Pull up the pad from gpio number. * - * @param uint32_t gpio_num : gpio number, 0~24 + * @param uint32_t gpio_num : gpio number, 0~29 * * @return None */ @@ -153,7 +153,7 @@ void gpio_pad_pullup(uint32_t gpio_num); /** * @brief Pull down the pad from gpio number. * - * @param uint32_t gpio_num : gpio number, 0~24 + * @param uint32_t gpio_num : gpio number, 0~29 * * @return None */ @@ -162,7 +162,7 @@ void gpio_pad_pulldown(uint32_t gpio_num); /** * @brief Unhold the pad from gpio number. * - * @param uint32_t gpio_num : gpio number, 0~24 + * @param uint32_t gpio_num : gpio number, 0~29 * * @return None */ @@ -171,7 +171,7 @@ void gpio_pad_unhold(uint32_t gpio_num); /** * @brief Hold the pad from gpio number. * - * @param uint32_t gpio_num : gpio number, 0~24 + * @param uint32_t gpio_num : gpio number, 0~29 * * @return None */ @@ -180,7 +180,7 @@ void gpio_pad_hold(uint32_t gpio_num); /** * @brief enable gpio pad input. * - * @param uint32_t gpio_num : gpio number, 0~24 + * @param uint32_t gpio_num : gpio number, 0~29 * * @return None */ @@ -189,7 +189,7 @@ void gpio_pad_input_enable(uint32_t gpio_num); /** * @brief disable gpio pad input. * - * @param uint32_t gpio_num : gpio number, 0~24 + * @param uint32_t gpio_num : gpio number, 0~29 * * @return None */ diff --git a/components/soc/esp32c61/gpio_periph.c b/components/soc/esp32c61/gpio_periph.c index 573c99dc07..7f34e53bf6 100644 --- a/components/soc/esp32c61/gpio_periph.c +++ b/components/soc/esp32c61/gpio_periph.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -32,6 +32,11 @@ const uint32_t GPIO_HOLD_MASK[] = { BIT(22), //GPIO22 BIT(23), //GPIO23 BIT(24), //GPIO24 + BIT(25), //GPIO25 + BIT(26), //GPIO26 + BIT(27), //GPIO27 + BIT(28), //GPIO28 + BIT(29), //GPIO29 }; _Static_assert(sizeof(GPIO_HOLD_MASK) == SOC_GPIO_PIN_COUNT * sizeof(uint32_t), "Invalid size of GPIO_HOLD_MASK"); diff --git a/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in index 426d833586..ae89230607 100644 --- a/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in @@ -385,7 +385,7 @@ config SOC_GPIO_PORT config SOC_GPIO_PIN_COUNT int - default 25 + default 30 config SOC_GPIO_SUPPORT_PIN_GLITCH_FILTER bool @@ -409,11 +409,11 @@ config SOC_LP_IO_CLOCK_IS_INDEPENDENT config SOC_GPIO_IN_RANGE_MAX int - default 24 + default 29 config SOC_GPIO_OUT_RANGE_MAX int - default 24 + default 29 config SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP bool @@ -429,7 +429,7 @@ config SOC_GPIO_DEEP_SLEEP_WAKE_SUPPORTED_PIN_CNT config SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK hex - default 0x1FFFF80 + default 0x3FFFFF80 config SOC_GPIO_SUPPORT_FORCE_HOLD bool diff --git a/components/soc/esp32c61/include/soc/gpio_num.h b/components/soc/esp32c61/include/soc/gpio_num.h index c92151b7f8..687a239b3a 100644 --- a/components/soc/esp32c61/include/soc/gpio_num.h +++ b/components/soc/esp32c61/include/soc/gpio_num.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -40,6 +40,11 @@ typedef enum { GPIO_NUM_22 = 22, /*!< GPIO22, input and output */ GPIO_NUM_23 = 23, /*!< GPIO23, input and output */ GPIO_NUM_24 = 24, /*!< GPIO24, input and output */ + GPIO_NUM_25 = 25, /*!< GPIO25, input and output */ + GPIO_NUM_26 = 26, /*!< GPIO26, input and output */ + GPIO_NUM_27 = 27, /*!< GPIO27, input and output */ + GPIO_NUM_28 = 28, /*!< GPIO28, input and output */ + GPIO_NUM_29 = 29, /*!< GPIO29, input and output */ GPIO_NUM_MAX, } gpio_num_t; diff --git a/components/soc/esp32c61/include/soc/soc_caps.h b/components/soc/esp32c61/include/soc/soc_caps.h index acd5b7e658..d7f415d8da 100644 --- a/components/soc/esp32c61/include/soc/soc_caps.h +++ b/components/soc/esp32c61/include/soc/soc_caps.h @@ -161,7 +161,7 @@ /*-------------------------- GPIO CAPS ---------------------------------------*/ // ESP32-C61 has 1 GPIO peripheral #define SOC_GPIO_PORT 1U -#define SOC_GPIO_PIN_COUNT 25 +#define SOC_GPIO_PIN_COUNT 30 #define SOC_GPIO_SUPPORT_PIN_GLITCH_FILTER 1 #define SOC_GPIO_SUPPORT_PIN_HYS_FILTER 1 @@ -178,16 +178,16 @@ #define SOC_GPIO_VALID_GPIO_MASK ((1ULL< *IO MUX and GPIO Matrix (GPIO, IO_MUX)* [`PDF <{IDF_TARGET_TRM_EN_URL}#iomuxgpio>`__]. +The {IDF_TARGET_NAME} chip features 30 physical GPIO pins (GPIO0 ~ GPIO29). Each pin can be used as a general-purpose I/O, or to be connected to an internal peripheral signal. Through GPIO matrix and IO MUX, peripheral input signals can be from any IO pins, and peripheral output signals can be routed to any IO pins. Together these modules provide highly configurable I/O. For more details, see *{IDF_TARGET_NAME} Technical Reference Manual* > *IO MUX and GPIO Matrix (GPIO, IO_MUX)* [`PDF <{IDF_TARGET_TRM_EN_URL}#iomuxgpio>`__]. The table below provides more information on pin usage, and please note the comments in the table for GPIOs with restrictions. @@ -147,6 +147,31 @@ The table below provides more information on pin usage, and please note the comm - - + * - GPIO25 + - + - + - + + * - GPIO26 + - + - + - + + * - GPIO27 + - + - + - + + * - GPIO28 + - + - + - + + * - GPIO29 + - + - + - + .. note:: - Some pins are used as strapping pins, which can be used to select in which boot mode to load the chip, etc.. The details can be found in `datasheet <{IDF_TARGET_DATASHEET_EN_URL}>`_ > ``Strapping Pins``. diff --git a/docs/zh_CN/api-reference/peripherals/gpio/esp32c61.inc b/docs/zh_CN/api-reference/peripherals/gpio/esp32c61.inc index 41f213f3ae..fb45d9a6eb 100644 --- a/docs/zh_CN/api-reference/peripherals/gpio/esp32c61.inc +++ b/docs/zh_CN/api-reference/peripherals/gpio/esp32c61.inc @@ -9,7 +9,7 @@ .. gpio-summary -{IDF_TARGET_NAME} 芯片具有 25 个物理 GPIO 管脚(GPIO0 ~ GPIO24)。每个管脚都可用作一个通用 IO,或连接一个内部的外设 信号。通过 GPIO 交换矩阵和 IO MUX,可配置外设模块的输入信号来源于任何的 IO 管脚,并且外设模块的输 出信号也可连接到任意 IO 管脚。这些模块共同组成了芯片的 IO 控制。更多详细信息,请参阅 *{IDF_TARGET_NAME} 技术参考手册* > *IO MUX 和 GPIO 矩阵(GPIO、IO_MUX)* [`PDF <{IDF_TARGET_TRM_CN_URL}#iomuxgpio>`__]。 +{IDF_TARGET_NAME} 芯片具有 30 个物理 GPIO 管脚(GPIO0 ~ GPIO29)。每个管脚都可用作一个通用 IO,或连接一个内部的外设 信号。通过 GPIO 交换矩阵和 IO MUX,可配置外设模块的输入信号来源于任何的 IO 管脚,并且外设模块的输 出信号也可连接到任意 IO 管脚。这些模块共同组成了芯片的 IO 控制。更多详细信息,请参阅 *{IDF_TARGET_NAME} 技术参考手册* > *IO MUX 和 GPIO 矩阵(GPIO、IO_MUX)* [`PDF <{IDF_TARGET_TRM_CN_URL}#iomuxgpio>`__]。 下表提供了各管脚的详细信息,部分 GPIO 具有特殊的使用限制,具体可参考表中的注释列。 @@ -147,6 +147,31 @@ - - + * - GPIO25 + - + - + - + + * - GPIO26 + - + - + - + + * - GPIO27 + - + - + - + + * - GPIO28 + - + - + - + + * - GPIO29 + - + - + - + .. note:: - 其中一些管脚被用作 Strapping 管脚,可用于选择加载芯片的启动模式等。详细信息请见 `ESP32-C61 技术规格书 <{IDF_TARGET_DATASHEET_CN_URL}>`_ > ``Strapping 管脚``。 diff --git a/examples/common_components/env_caps/esp32c61/Kconfig.env_caps b/examples/common_components/env_caps/esp32c61/Kconfig.env_caps index db601e0962..cb3bd34ea8 100644 --- a/examples/common_components/env_caps/esp32c61/Kconfig.env_caps +++ b/examples/common_components/env_caps/esp32c61/Kconfig.env_caps @@ -4,7 +4,7 @@ config ENV_GPIO_RANGE_MIN config ENV_GPIO_RANGE_MAX int - default 24 + default 29 config ENV_GPIO_IN_RANGE_MAX int diff --git a/examples/common_components/env_caps/esp32p4/Kconfig.env_caps b/examples/common_components/env_caps/esp32p4/Kconfig.env_caps index d736f9c179..fae0fac8be 100644 --- a/examples/common_components/env_caps/esp32p4/Kconfig.env_caps +++ b/examples/common_components/env_caps/esp32p4/Kconfig.env_caps @@ -4,7 +4,7 @@ config ENV_GPIO_RANGE_MIN config ENV_GPIO_RANGE_MAX int - default 56 + default 54 config ENV_GPIO_IN_RANGE_MAX int