diff --git a/docs/en/api-reference/system/sleep_modes.rst b/docs/en/api-reference/system/sleep_modes.rst index 9b72cdb462f..861842e2cbb 100644 --- a/docs/en/api-reference/system/sleep_modes.rst +++ b/docs/en/api-reference/system/sleep_modes.rst @@ -381,15 +381,22 @@ RTC peripherals or RTC memories do not need to be powered on during sleep in thi - Deep-sleep mode (always) - Light-sleep mode when :ref:`CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP` is enabled + .. only:: SOC_RTC_GPIO_EDGE_WAKEUP_SUPPORTED + + On {IDF_TARGET_NAME} the API also accepts edge-triggered wakeup modes: ``ESP_GPIO_WAKEUP_GPIO_POSEDGE`` (rising edge), ``ESP_GPIO_WAKEUP_GPIO_NEGEDGE`` (falling edge), and ``ESP_GPIO_WAKEUP_GPIO_ANYEDGE`` (both edges). For ``ESP_GPIO_WAKEUP_GPIO_ANYEDGE``, the internal pull-up/pull-down is disabled (when :ref:`CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS` is enabled) because the idle level is ambiguous; an external pull or an already-stable line is recommended. + .. note:: Only GPIOs powered by the VDD3P3_RTC power domain (RTC IOs) can be used with this API. The exact set of supported pins can be checked in the `datasheet <{IDF_TARGET_DATASHEET_EN_URL}>`__ > Section IO Pins. + .. note:: + Any GPIO/IO wakeup signal -- whether level or edge -- must be held (or have a pulse width) of at least 3 RTC slow-clock cycles to be reliably sampled by the wakeup logic. The duration of one slow-clock cycle depends on :ref:`CONFIG_RTC_CLK_SRC` (e.g. RC_SLOW @ ~136 kHz ~= 7.4 us/cycle, XTAL32K @ 32.768 kHz ~= 30.5 us/cycle). This applies to both :cpp:func:`esp_sleep_enable_gpio_wakeup` and :cpp:func:`esp_sleep_enable_gpio_wakeup_on_hp_periph_powerdown`. + .. only:: esp32h2 GPIO Wakeup ^^^^^^^^^^^ - Any IO can be used as the external input to wake up the chip from Light-sleep. Each pin can be individually configured to trigger wakeup on high or low level using the :cpp:func:`gpio_wakeup_enable` function. Then the :cpp:func:`esp_sleep_enable_gpio_wakeup` function should be called to enable this wakeup source. + Any IO can be used as the external input to wake up the chip from Light-sleep. Each pin can be individually configured using :cpp:func:`gpio_wakeup_enable` (low/high level only). Then the :cpp:func:`esp_sleep_enable_gpio_wakeup` function should be called to enable this wakeup source. .. _uart_wakeup_light_sleep: diff --git a/docs/zh_CN/api-reference/system/sleep_modes.rst b/docs/zh_CN/api-reference/system/sleep_modes.rst index fb451f1eb01..fb0bc941944 100644 --- a/docs/zh_CN/api-reference/system/sleep_modes.rst +++ b/docs/zh_CN/api-reference/system/sleep_modes.rst @@ -381,15 +381,22 @@ RTC 控制器中内嵌定时器,可用于在预定义的时间到达后唤醒 - Deep-sleep 模式(始终可用) - 启用 :ref:`CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP` 时的 Light-sleep 模式 + .. only:: SOC_RTC_GPIO_EDGE_WAKEUP_SUPPORTED + + 在 {IDF_TARGET_NAME} 上,该 API 还支持边沿触发的唤醒模式:``ESP_GPIO_WAKEUP_GPIO_POSEDGE``(上升沿)、``ESP_GPIO_WAKEUP_GPIO_NEGEDGE``(下降沿)和 ``ESP_GPIO_WAKEUP_GPIO_ANYEDGE``(任意沿)。对于 ``ESP_GPIO_WAKEUP_GPIO_ANYEDGE``,当启用 :ref:`CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS` 时,由于空闲电平不确定,驱动会关闭内部上拉/下拉,建议使用外部上/下拉电阻或保证进入睡眠前线路电平稳定。 + .. note:: 只有由 VDD3P3_RTC 电源域供电的 GPIO(RTC IO)可以与此 API 一起使用。具体支持的管脚请参考 `datasheet <{IDF_TARGET_DATASHEET_CN_URL}>`__ > IO 管脚。 + .. note:: + 使用 IO 唤醒源(无论是电平模式还是边沿模式)将芯片从睡眠中唤醒时,唤醒信号必须保持(电平模式)或脉冲宽度(边沿模式)至少 3 个 RTC 慢时钟周期,唤醒逻辑才能可靠采样。一个慢时钟周期的时长取决于 :ref:`CONFIG_RTC_CLK_SRC` 的配置(例如 RC_SLOW @ ~136 kHz ≈ 7.4 µs/周期,XTAL32K @ 32.768 kHz ≈ 30.5 µs/周期)。该约束同样适用于 :cpp:func:`esp_sleep_enable_gpio_wakeup` 和 :cpp:func:`esp_sleep_enable_gpio_wakeup_on_hp_periph_powerdown`。 + .. only:: esp32h2 GPIO 唤醒 ^^^^^^^^^^^ - 任何一个 IO 都可以用作外部输入管脚,将芯片从 Light-sleep 状态唤醒。调用 :cpp:func:`gpio_wakeup_enable` 函数可以将任意管脚单独配置为在高电平或低电平触发唤醒。此后,应调用 :cpp:func:`esp_sleep_enable_gpio_wakeup` 函数来启用此唤醒源。 + 任何一个 IO 都可以用作外部输入管脚,将芯片从 Light-sleep 状态唤醒。可调用 :cpp:func:`gpio_wakeup_enable` 为每个管脚单独配置唤醒条件(仅高/低电平)。此后,应调用 :cpp:func:`esp_sleep_enable_gpio_wakeup` 函数来启用此唤醒源。 .. _uart_wakeup_light_sleep: