kopia lustrzana https://github.com/espressif/esp-idf
Merge branch 'docs/translate_sub_power_mode_docs' into 'master'
docs: Provide CN trans for sub power mode docs Closes DOC-5972 See merge request espressif/esp-idf!25391pull/12212/head
commit
e697109388
|
@ -29,8 +29,8 @@ In Deep-sleep mode, the CPUs, most of the RAM, and all digital peripherals that
|
|||
|
||||
- RTC controller
|
||||
:SOC_ULP_SUPPORTED: - ULP coprocessor
|
||||
:SOC_RTC_FAST_MEM_SUPPORTED: - RTC fast memory
|
||||
:SOC_RTC_SLOW_MEM_SUPPORTED: - RTC slow memory
|
||||
:SOC_RTC_FAST_MEM_SUPPORTED: - RTC FAST memory
|
||||
:SOC_RTC_SLOW_MEM_SUPPORTED: - RTC SLOW memory
|
||||
|
||||
.. only:: SOC_BT_SUPPORTED
|
||||
|
||||
|
@ -55,67 +55,111 @@ In Deep-sleep mode, the CPUs, most of the RAM, and all digital peripherals that
|
|||
Sub Sleep Modes
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
Tables below list the sub sleep modes (columns), and the features they support (rows). Mode that support more features may consume more power during sleep mode. The sleep system automatically selects the mode that satisfies all the features required by the user while consuming least power.
|
||||
Tables below list the sub sleep modes in the first row and the features they support in the first column. Modes that support more features may consume more power during sleep mode. The sleep system automatically selects the mode that satisfies all the features required by the user while consuming least power.
|
||||
|
||||
Deep-sleep:
|
||||
|
||||
+-----------------------------------+----------------+--------------+-----------------+
|
||||
| | DSLP_ULTRA_LOW | DSLP_DEFAULT | DSLP_8MD256 / |
|
||||
| | | | DSLP_ADC_TSENS |
|
||||
+===================================+================+==============+=================+
|
||||
| ULP/Touch sensor (S2, S3 only) | Y | Y | Y |
|
||||
+-----------------------------------+----------------+--------------+-----------------+
|
||||
| RTC IO input/RTC mem at high temp | | Y | Y |
|
||||
+-----------------------------------+----------------+--------------+-----------------+
|
||||
| ADC_TSEN_MONITOR | | | Y |
|
||||
+-----------------------------------+----------------+--------------+-----------------+
|
||||
| 8MD256 | | | Y |
|
||||
+-----------------------------------+----------------+--------------+-----------------+
|
||||
.. list-table::
|
||||
:widths: auto
|
||||
:header-rows: 2
|
||||
|
||||
* -
|
||||
- DSLP_ULTRA_LOW
|
||||
- DSLP_DEFAULT
|
||||
- DSLP_8MD256/
|
||||
* -
|
||||
-
|
||||
-
|
||||
- DSLP_ADC_TSENS
|
||||
* - ULP/Touch sensor (ESP32-S2 and ESP32-S3 only)
|
||||
- Y
|
||||
- Y
|
||||
- Y
|
||||
* - RTC IO input/RTC memory at high temperature
|
||||
-
|
||||
- Y
|
||||
- Y
|
||||
* - ADC_TSEN_MONITOR
|
||||
-
|
||||
-
|
||||
- Y
|
||||
* - 8MD256 as the clock source for RTC_SLOW_CLK
|
||||
-
|
||||
-
|
||||
- Y
|
||||
|
||||
Features:
|
||||
|
||||
1. 8MD256: Use 8MD256 as the clock source for RTC Slow. Controlled by Kconfig option `CONFIG_RTC_CLK_SRC_INT_8MD256`.
|
||||
1. RTC IO input/RTC memory at high temperature (experimental): Use RTC IO as input pins, or use RTC memory at high temperature. The chip can go into ultra low power mode when these features are disabled. Controlled by API :cpp:func:`rtc_sleep_enable_ultra_low`.
|
||||
|
||||
2. ADC_TSEN_MONITOR: Use ADC/Temperature Sensor in monitor mode (controlled by ULP). Enabled by :cpp:func:`ulp_adc_init` API or its higher level APIs. Only available for chips with monitor modes (S2 and S3).
|
||||
2. ADC_TSEN_MONITOR: Use ADC/Temperature Sensor in monitor mode (controlled by ULP). Enabled by API :cpp:func:`ulp_adc_init` or its higher level APIs. Only available for ESP32-S2 and ESP32-S3 chips with monitor mode.
|
||||
|
||||
3. RTC IO input/RTC mem at high temp: Use RTC IO as input pins, or use RTC memory in high temperature. The chip can go into the ultra low power mode when these features are disabled. Controlled by API :cpp:func:`rtc_sleep_enable_ultra_low`. (Experimental)
|
||||
3. 8MD256 as the clock source for RTC_SLOW_CLK: When 8MD256 is selected as the clock source for RTC_SLOW_CLK using the Kconfig option ``CONFIG_RTC_CLK_SRC_INT_8MD256``, the chip will automatically enter this sub sleep mode during Deep-sleep mode.
|
||||
|
||||
Light-sleep:
|
||||
|
||||
+-----------------------------------+--------------+----------------+-------------+---------------+
|
||||
| | LSLP_DEFAULT | LSLP_ADC_TSENS | LSLP_8MD256 | LSLP_LEDC8M / |
|
||||
| | | | | LSLP_XTAL_FPU |
|
||||
+===================================+==============+================+=============+===============+
|
||||
| ULP/Touch sensor (S2, S3 only) | Y | Y | Y | Y |
|
||||
+-----------------------------------+--------------+----------------+-------------+---------------+
|
||||
| RTC IO input/RTC mem at high temp | Y | Y | Y | Y |
|
||||
+-----------------------------------+--------------+----------------+-------------+---------------+
|
||||
| ADC_TSEN_MONITOR | | Y | Y | Y |
|
||||
+-----------------------------------+--------------+----------------+-------------+---------------+
|
||||
| 8MD256 | | | Y | Y |
|
||||
+-----------------------------------+--------------+----------------+-------------+---------------+
|
||||
| dig 8M | | | | Y |
|
||||
+-----------------------------------+--------------+----------------+-------------+---------------+
|
||||
| XTAL | | | | Y |
|
||||
+-----------------------------------+--------------+----------------+-------------+---------------+
|
||||
.. list-table::
|
||||
:widths: auto
|
||||
:header-rows: 2
|
||||
|
||||
Features: (See also the 8MD256 and ADC_TSEN_MONITOR feature for deep-sleep)
|
||||
* -
|
||||
- LSLP_DEFAULT
|
||||
- LSLP_ADC_TSENS
|
||||
- LSLP_8MD256
|
||||
- LSLP_LEDC8M/
|
||||
* -
|
||||
-
|
||||
-
|
||||
-
|
||||
- LSLP_XTAL_FPU
|
||||
* - ULP/Touch sensor (ESP32-S2 and ESP32-S3 only)
|
||||
- Y
|
||||
- Y
|
||||
- Y
|
||||
- Y
|
||||
* - RTC IO input/RTC memory at high temperature
|
||||
- Y
|
||||
- Y
|
||||
- Y
|
||||
- Y
|
||||
* - ADC_TSEN_MONITOR
|
||||
-
|
||||
- Y
|
||||
- Y
|
||||
- Y
|
||||
* - 8MD256 as the clock source for RTC_SLOW_CLK
|
||||
-
|
||||
-
|
||||
- Y
|
||||
- Y
|
||||
* - 8 MHz RC clock source used by digital peripherals
|
||||
-
|
||||
-
|
||||
-
|
||||
- Y
|
||||
* - Keep the XTAL clock on
|
||||
-
|
||||
-
|
||||
-
|
||||
- Y
|
||||
|
||||
1. XTAL: Keep XTAL on during light-sleep. Controlled by `ESP_PD_DOMAIN_XTAL` power domain.
|
||||
Features: (Also see 8MD256 and ADC_TSEN_MONITOR features for Deep-sleep mode above)
|
||||
|
||||
2. dig 8M: 8M RC clock source used by digital peripherals. Currently only LEDC will use this clock source during light-sleep. When LEDC selects this clock source, this feature is automatically enabled.
|
||||
1. 8 MHz RC clock source used by digital peripherals: Currently, only LEDC uses this clock source during Light-sleep mode. When LEDC selects this clock source, this feature is automatically enabled.
|
||||
|
||||
2. Keep the XTAL clock on: Keep the XTAL clock on during Light-sleep mode. Controlled by ``ESP_PD_DOMAIN_XTAL`` power domain.
|
||||
|
||||
.. only:: esp32s2
|
||||
|
||||
{IDF_TARGET_NAME} uses the same power mode for LSLP_8MD256, LSLP_LEDC8M and LSLP_XTAL_FPU.
|
||||
{IDF_TARGET_NAME} uses the same power mode for LSLP_8MD256, LSLP_LEDC8M, and LSLP_XTAL_FPU features.
|
||||
|
||||
.. only:: esp32s3
|
||||
|
||||
Default mode of {IDF_TARGET_NAME} already supports the ADC_TSEN_MONITOR feature.
|
||||
Default mode of {IDF_TARGET_NAME} already supports ADC_TSEN_MONITOR feature.
|
||||
|
||||
.. only:: esp32c2 or esp32c3
|
||||
|
||||
{IDF_TARGET_NAME} doesn't have ADC_TSEN_MONITOR mode. There is no LSLP_ADC_TSENS mode either.
|
||||
{IDF_TARGET_NAME} does not have ADC_TSEN_MONITOR or LSLP_ADC_TSENS feature.
|
||||
|
||||
.. _api-reference-wakeup-source:
|
||||
|
||||
|
@ -129,7 +173,7 @@ Following are the wakeup sources supported on {IDF_TARGET_NAME}.
|
|||
Timer
|
||||
^^^^^
|
||||
|
||||
The RTC controller has a built-in timer which can be used to wake up the chip after a predefined amount of time. Time is specified at microsecond precision, but the actual resolution depends on the clock source selected for RTC SLOW_CLK.
|
||||
The RTC controller has a built-in timer which can be used to wake up the chip after a predefined amount of time. Time is specified at microsecond precision, but the actual resolution depends on the clock source selected for RTC_SLOW_CLK.
|
||||
|
||||
.. only:: SOC_ULP_SUPPORTED
|
||||
|
||||
|
@ -173,8 +217,8 @@ RTC peripherals or RTC memories do not need to be powered on during sleep in thi
|
|||
|
||||
.. only:: SOC_PM_SUPPORT_EXT1_WAKEUP
|
||||
|
||||
External Wakeup (ext1)
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
External Wakeup (``ext1``)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The RTC controller contains the logic to trigger wakeup using multiple RTC GPIOs. One of the following two logic functions can be used to trigger wakeup:
|
||||
|
||||
|
@ -188,18 +232,18 @@ RTC peripherals or RTC memories do not need to be powered on during sleep in thi
|
|||
- wake up if any of the selected pins is high (``ESP_EXT1_WAKEUP_ANY_HIGH``)
|
||||
- wake up if any of the selected pins is low (``ESP_EXT1_WAKEUP_ANY_LOW``)
|
||||
|
||||
This wakeup source is implemented by the RTC controller. As such, RTC peripherals and RTC memories can be powered down in this mode. However, if RTC peripherals are powered down, internal pullup and pulldown resistors will be disabled if we don't use the HOLD feature. To use internal pullup or pulldown resistors, request the RTC peripherals power domain to be kept on during sleep, and configure pullup/pulldown resistors using ``rtc_gpio_`` functions before entering sleep::
|
||||
This wakeup source is controlled by the RTC controller. Unlike ``ext0``, this wakeup source supports wakeup even when the RTC peripheral is powered down. Although the power domain of the RTC peripheral, where RTC IOs are located, is powered down during sleep modes, ESP-IDF will automatically lock the state of the wakeup pin before the system enters sleep modes and unlock upon exiting sleep modes. Therefore, the internal pull-up or pull-down resistors can still be configured for the wakeup pin::
|
||||
|
||||
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
|
||||
rtc_gpio_pullup_dis(gpio_num);
|
||||
rtc_gpio_pulldown_en(gpio_num);
|
||||
|
||||
If we turn off the ``RTC_PERIPH`` domain, we will use the HOLD feature to maintain the pull-up and pull-down on the pins during sleep. HOLD feature will be acted on the pin internally before the system entering sleep, and this can further reduce power consumption::
|
||||
If we turn off the ``RTC_PERIPH`` domain, we will use the HOLD feature to maintain the pull-up and pull-down on the pins during sleep. HOLD feature will be acted on the pin internally before the system enters sleep modes, and this can further reduce power consumption::
|
||||
|
||||
rtc_gpio_pullup_dis(gpio_num);
|
||||
rtc_gpio_pulldown_en(gpio_num);
|
||||
|
||||
If certain chips lack the ``RTC_PERIPH`` domain, we can only use the HOLD feature to maintain the pull-up and pull-down on the pins during sleep::
|
||||
If certain chips lack the ``RTC_PERIPH`` domain, we can only use the HOLD feature to maintain the pull-up and pull-down on the pins during sleep modes::
|
||||
|
||||
gpio_pullup_dis(gpio_num);
|
||||
gpio_pulldown_en(gpio_num);
|
||||
|
@ -217,7 +261,7 @@ RTC peripherals or RTC memories do not need to be powered on during sleep in thi
|
|||
ULP Coprocessor Wakeup
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
ULP coprocessor can run while the chip is in sleep mode, and may be used to poll sensors, monitor ADC or touch sensor values, and wake up the chip when a specific event is detected. ULP coprocessor is part of the RTC peripherals power domain, and it runs the program stored in RTC slow memory. RTC slow memory will be powered on during sleep if this wakeup mode is requested. RTC peripherals will be automatically powered on before ULP coprocessor starts running the program; once the program stops running, RTC peripherals are automatically powered down again.
|
||||
ULP coprocessor can run while the chip is in sleep mode, and may be used to poll sensors, monitor ADC or touch sensor values, and wake up the chip when a specific event is detected. ULP coprocessor is part of the RTC peripherals power domain, and it runs the program stored in RTC SLOW memory. RTC SLOW memory will be powered on during sleep if this wakeup mode is requested. RTC peripherals will be automatically powered on before ULP coprocessor starts running the program; once the program stops running, RTC peripherals are automatically powered down again.
|
||||
|
||||
.. only:: esp32
|
||||
|
||||
|
@ -285,15 +329,15 @@ By default, :cpp:func:`esp_deep_sleep_start` and :cpp:func:`esp_light_sleep_star
|
|||
|
||||
.. only:: esp32
|
||||
|
||||
Note: in revision 0 of ESP32, RTC fast memory is always kept enabled in Deep-sleep, so that the Deep-sleep stub can run after reset. This can be overridden, if the application does not need clean reset behaviour after Deep-sleep.
|
||||
Note: in revision 0 of ESP32, RTC FAST memory is always kept enabled in Deep-sleep, so that the Deep-sleep stub can run after reset. This can be overridden, if the application does not need clean reset behaviour after Deep-sleep.
|
||||
|
||||
.. only:: SOC_RTC_SLOW_MEM_SUPPORTED
|
||||
|
||||
If some variables in the program are placed into RTC slow memory (for example, using ``RTC_DATA_ATTR`` attribute), RTC slow memory will be kept powered on by default. This can be overridden using :cpp:func:`esp_sleep_pd_config` function, if desired.
|
||||
If some variables in the program are placed into RTC SLOW memory (for example, using ``RTC_DATA_ATTR`` attribute), RTC SLOW memory will be kept powered on by default. This can be overridden using :cpp:func:`esp_sleep_pd_config` function, if desired.
|
||||
|
||||
.. only:: not SOC_RTC_SLOW_MEM_SUPPORTED and SOC_RTC_FAST_MEM_SUPPORTED
|
||||
|
||||
In {IDF_TARGET_NAME}, there is only RTC fast memory, so if some variables in the program are marked by ``RTC_DATA_ATTR``, ``RTC_SLOW_ATTR`` or ``RTC_FAST_ATTR`` attributes, all of them go to RTC fast memory. It will be kept powered on by default. This can be overridden using :cpp:func:`esp_sleep_pd_config` function, if desired.
|
||||
In {IDF_TARGET_NAME}, there is only RTC FAST memory, so if some variables in the program are marked by ``RTC_DATA_ATTR``, ``RTC_SLOW_ATTR`` or ``RTC_FAST_ATTR`` attributes, all of them go to RTC FAST memory. It will be kept powered on by default. This can be overridden using :cpp:func:`esp_sleep_pd_config` function, if desired.
|
||||
|
||||
Power-down of Flash
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
@ -384,11 +428,11 @@ Application Example
|
|||
-------------------
|
||||
|
||||
- :example:`protocols/sntp`: the implementation of basic functionality of Deep-sleep, where ESP module is periodically waken up to retrieve time from NTP server.
|
||||
- :example:`wifi/power_save`: the implementation of Wi-Fi Modem-sleep example.
|
||||
- :example:`wifi/power_save`: the usage of Wi-Fi Modem-sleep mode and automatic Light-sleep feature to maintain Wi-Fi connections.
|
||||
|
||||
.. only:: SOC_BT_SUPPORTED
|
||||
|
||||
- :example:`bluetooth/nimble/power_save`: the implementation of Bluetooth Modem-sleep example.
|
||||
- :example:`bluetooth/nimble/power_save`: the usage of Bluetooth Modem-sleep mode and automatic Light-sleep feature to maintain Bluetooth connections.
|
||||
|
||||
.. only:: SOC_ULP_SUPPORTED
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
睡眠节能模式
|
||||
----------------------
|
||||
|
||||
在 Light-sleep 模式下,数字外设、CPU、以及大部分 RAM 都使用时钟门控,同时电源电压降低。退出该模式后,数字外设、CPU 和 RAM 恢复运行,内部状态保持不变。
|
||||
在 Light-sleep 模式下,数字外设、CPU、以及大部分 RAM 都使用时钟门控,同时其供电电压降低。退出该模式后,数字外设、CPU 和 RAM 恢复运行,并且内部状态将被保留。
|
||||
|
||||
在 Deep-sleep 模式下,CPU、大部分 RAM、以及所有由时钟 APB_CLK 驱动的数字外设都会被断电。芯片上继续处于供电状态的部分仅包括:
|
||||
|
||||
|
@ -50,6 +50,117 @@
|
|||
|
||||
如需保持 Wi-Fi 连接,请启用 Wi-Fi Modem-sleep 模式和自动 Light-sleep 模式(请参阅 :doc:`电源管理 API <power_management>`)。在这两种模式下,Wi-Fi 驱动程序发出请求时,系统将自动从睡眠中被唤醒,从而保持与 AP 的连接。
|
||||
|
||||
.. only:: esp32s2 or esp32s3 or esp32c2 or esp32c3
|
||||
|
||||
子睡眠模式
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
下表首行表示子睡眠模式,首列表示不同模式支持的功能。在睡眠模式下,支持更多功能的模式功耗可能更大。睡眠系统会自动选择满足用户功能需求且功耗最小的模式。
|
||||
|
||||
Deep-sleep:
|
||||
|
||||
.. list-table::
|
||||
:widths: auto
|
||||
:header-rows: 2
|
||||
|
||||
* -
|
||||
- DSLP_ULTRA_LOW
|
||||
- DSLP_DEFAULT
|
||||
- DSLP_8MD256/
|
||||
* -
|
||||
-
|
||||
-
|
||||
- DSLP_ADC_TSENS
|
||||
* - ULP/触摸传感器(仅限 ESP32-S2、ESP32-S3)
|
||||
- Y
|
||||
- Y
|
||||
- Y
|
||||
* - RTC IO 输入/高温下 RTC 内存
|
||||
-
|
||||
- Y
|
||||
- Y
|
||||
* - ADC_TSEN_MONITOR
|
||||
-
|
||||
-
|
||||
- Y
|
||||
* - 8MD256 作为 RTC_SLOW_CLK 时钟源
|
||||
-
|
||||
-
|
||||
- Y
|
||||
|
||||
功能:
|
||||
|
||||
1. RTC IO 输入/高温下 RTC 内存(试验功能):将 RTC IO 用作输入管脚,或在高温下使用 RTC 内存。禁用上述功能,芯片可进入超低功耗模式。由 API :cpp:func:`rtc_sleep_enable_ultra_low` 控制。
|
||||
|
||||
2. ADC_TSEN_MONITOR:在 monitor 模式下使用 ADC/温度传感器(由 ULP 控制),通过 :cpp:func:`ulp_adc_init` 或其更高级别的 API 启用。仅适用于支持 monitor 模式的 ESP32-S2 和 ESP32-S3 芯片。
|
||||
|
||||
3. 8MD256 作为 RTC_SLOW_CLK 时钟源:通过 ``CONFIG_RTC_CLK_SRC_INT_8MD256`` 选择 8MD256 作为 RTC_SLOW_CLK 时钟源时,芯片在 Deep-sleep 模式下将自动进入该子睡眠模式.
|
||||
|
||||
Light-sleep:
|
||||
|
||||
.. list-table::
|
||||
:widths: auto
|
||||
:header-rows: 2
|
||||
|
||||
* -
|
||||
- LSLP_DEFAULT
|
||||
- LSLP_ADC_TSENS
|
||||
- LSLP_8MD256
|
||||
- LSLP_LEDC8M/
|
||||
* -
|
||||
-
|
||||
-
|
||||
-
|
||||
- LSLP_XTAL_FPU
|
||||
* - ULP/触摸传感器(仅限 ESP32-S2、ESP32-S3)
|
||||
- Y
|
||||
- Y
|
||||
- Y
|
||||
- Y
|
||||
* - RTC IO 输入/高温下 RTC 内存
|
||||
- Y
|
||||
- Y
|
||||
- Y
|
||||
- Y
|
||||
* - ADC_TSEN_MONITOR
|
||||
-
|
||||
- Y
|
||||
- Y
|
||||
- Y
|
||||
* - 8MD256 作为 RTC_SLOW_CLK 时钟源
|
||||
-
|
||||
-
|
||||
- Y
|
||||
- Y
|
||||
* - 数字外设使用 8 MHz RC 时钟源
|
||||
-
|
||||
-
|
||||
-
|
||||
- Y
|
||||
* - 保持 XTAL 时钟开启
|
||||
-
|
||||
-
|
||||
-
|
||||
- Y
|
||||
|
||||
功能:(了解 Deep-sleep 模式,请参考前文 8MD256 和 ADC_TSEN_MONITOR 功能描述)
|
||||
|
||||
1. 数字外设使用 8 MHz RC 时钟源:目前,只有 LEDC 在 Light-sleep 模式下使用该时钟源。当 LEDC 选用该时钟源时,此功能将自动启用。
|
||||
|
||||
2. 保持 XTAL 时钟开启:在 Light-sleep 模式下保持 XTAL 时钟开启,由 ``ESP_PD_DOMAIN_XTAL`` 电源域控制。
|
||||
|
||||
.. only:: esp32s2
|
||||
|
||||
{IDF_TARGET_NAME} 的 LSLP_8MD256、LSLP_LEDC8M 和 LSLP_XTAL_FPU 功能使用相同的功耗模式。
|
||||
|
||||
.. only:: esp32s3
|
||||
|
||||
{IDF_TARGET_NAME} 的默认模式现已支持 ADC_TSEN_MONITOR 功能。
|
||||
|
||||
.. only:: esp32c2 or esp32c3
|
||||
|
||||
{IDF_TARGET_NAME} 不支持 ADC_TSEN_MONITOR 和 LSLP_ADC_TSENS 功能。
|
||||
|
||||
.. _api-reference-wakeup-source:
|
||||
|
||||
唤醒源
|
||||
|
@ -62,7 +173,7 @@
|
|||
定时器
|
||||
^^^^^^^^
|
||||
|
||||
RTC 控制器中内嵌定时器,可用于在预定义的时间到达后唤醒芯片。时间精度为微秒,但其实际分辨率依赖于为 RTC SLOW_CLK 所选择的时钟源。
|
||||
RTC 控制器中内嵌定时器,可用于在预定义的时间到达后唤醒芯片。时间精度为微秒,但其实际分辨率依赖于为 RTC_SLOW_CLK 所选择的时钟源。
|
||||
|
||||
.. only:: SOC_ULP_SUPPORTED
|
||||
|
||||
|
@ -113,26 +224,26 @@ RTC 控制器中内嵌定时器,可用于在预定义的时间到达后唤醒
|
|||
|
||||
.. only:: esp32
|
||||
|
||||
- 当任意一个所选管脚为高电平时唤醒(ESP_EXT1_WAKEUP_ANY_HIGH)
|
||||
- 当任意一个所选管脚为高电平时唤醒 (ESP_EXT1_WAKEUP_ANY_HIGH)
|
||||
- 当所有所选管脚为低电平时唤醒 (ESP_EXT1_WAKEUP_ALL_LOW)
|
||||
|
||||
.. only:: esp32s2 or esp32s3 or esp32c6 or esp32h2
|
||||
|
||||
- 当任意一个所选管脚为高电平时唤醒(ESP_EXT1_WAKEUP_ANY_HIGH)
|
||||
- 当任意一个所选管脚为低电平时唤醒(ESP_EXT1_WAKEUP_ANY_LOW)
|
||||
- 当任意一个所选管脚为高电平时唤醒 (ESP_EXT1_WAKEUP_ANY_HIGH)
|
||||
- 当任意一个所选管脚为低电平时唤醒 (ESP_EXT1_WAKEUP_ANY_LOW)
|
||||
|
||||
此唤醒源由 RTC 控制器实现。这种模式下的 RTC 外设和 RTC 内存可以被断电。然而,如果RTC外设被断电,如果我们不使用 HOLD 功能,内部上拉和下拉电阻将被禁用。想要使用内部上拉和下拉电阻,需要 RTC 外设电源域在睡眠期间保持开启,并在进入睡眠前使用函数 ``rtc_gpio_`` 配置上拉或下拉电阻。
|
||||
此唤醒源由 RTC 控制器实现。区别于 ``ext0`` 唤醒源,在 RTC 外设断电的情况下此唤醒源同样支持唤醒。虽然睡眠期间 RTC IO 所在的 RTC 外设电源域将会断电,但是 ESP-IDF 会自动在系统进入睡眠前锁定唤醒管脚的状态并在退出睡眠时解除锁定,所以仍然可为唤醒管脚配置内部上拉或下拉电阻::
|
||||
|
||||
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
|
||||
gpio_pullup_dis(gpio_num);
|
||||
gpio_pulldown_en(gpio_num);
|
||||
|
||||
如果我们关闭 ``RTC_PERIPH`` 域,我们将使用 HOLD 功能在睡眠期间维持引脚上的上拉和下拉电阻。所选管脚的 HOLD 功能会在系统真正进入睡眠前被开启,这有助于进一步减小睡眠时的功耗。
|
||||
如果我们关闭 ``RTC_PERIPH`` 域,我们将使用 HOLD 功能在睡眠期间维持管脚上的上拉和下拉电阻。所选管脚的 HOLD 功能会在系统真正进入睡眠前被开启,这有助于进一步减小睡眠时的功耗::
|
||||
|
||||
rtc_gpio_pullup_dis(gpio_num);
|
||||
rtc_gpio_pulldown_en(gpio_num);
|
||||
|
||||
如果某些芯片缺少 ``RTC_PERIPH`` 域,我们只能使用 HOLD 功能来在睡眠期间维持引脚上的上拉和下拉电阻。
|
||||
如果某些芯片缺少 ``RTC_PERIPH`` 域,我们只能使用 HOLD 功能来在睡眠期间维持管脚上的上拉和下拉电阻::
|
||||
|
||||
gpio_pullup_dis(gpio_num);
|
||||
gpio_pulldown_en(gpio_num);
|
||||
|
@ -218,7 +329,7 @@ RTC 外设和内存断电
|
|||
|
||||
.. only:: esp32
|
||||
|
||||
注意:在 ESP32 修订版 1 中,RTC 高速内存在 Deep-sleep 期间将总是保持使能,以保证复位后可运行 Deep-sleep stub。如果应用程序在 Deep-sleep 模式后无需复位,您也可以对其进行修改。
|
||||
注意:在 ESP32 修订版 1 中,RTC 高速内存在 Deep-sleep 期间将总是保持使能,以保证复位后可运行 Deep-sleep stub。如果应用程序在 Deep-sleep 模式后无需复位,你也可以对其进行修改。
|
||||
|
||||
.. only:: SOC_RTC_SLOW_MEM_SUPPORTED
|
||||
|
||||
|
@ -236,10 +347,10 @@ flash 断电
|
|||
理论上讲,在 flash 完全断电后可以仅唤醒系统,然而现实情况是 flash 断电所需的时间很难预测。如果用户为 flash 供电电路添加了滤波电容,断电所需时间可能会更长。此外,即使可以预知 flash 彻底断电所需的时间,有时也不能通过设置足够长的睡眠时间来确保 flash 断电的安全(比如,突发的异步唤醒源会使得实际的睡眠时间不可控)。
|
||||
|
||||
.. warning::
|
||||
|
||||
|
||||
如果在 flash 的供电电路上添加了滤波电容,那么应当尽一切可能避免 flash 断电。
|
||||
|
||||
因为这些不可控的因素,ESP-IDF 很难保证 flash 断电的绝对安全。因此 ESP-IDF 不推荐用户断电 flash。对于一些功耗敏感型应用,可以通过设置 Kconfig 配置项 :ref:`CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND` 来减少 light sleep 期间 flash 的功耗。这种方式在几乎所有场景下都要比断电 flash 更好,兼顾了安全性和功耗。
|
||||
因为这些不可控的因素,ESP-IDF 很难保证 flash 断电的绝对安全。因此 ESP-IDF 不推荐用户断电 flash。对于一些功耗敏感型应用,可以通过设置 Kconfig 配置项 :ref:`CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND` 来减少 Light-sleep 期间 flash 的功耗。这种方式在几乎所有场景下都要比断电 flash 更好,兼顾了安全性和功耗。
|
||||
|
||||
.. only:: SOC_SPIRAM_SUPPORTED
|
||||
|
||||
|
@ -256,7 +367,7 @@ flash 断电
|
|||
|
||||
.. list::
|
||||
|
||||
- Light sleep 时,ESP-IDF 没有提供保证 flash 一定会被断电的机制。
|
||||
- Light-sleep 模式下,ESP-IDF 没有提供保证 flash 一定会被断电的机制。
|
||||
- 不管用户的配置如何,函数 :cpp:func:`esp_deep_sleep_start` 都会强制断电 flash。
|
||||
|
||||
配置 IO(仅适用于 Deep-sleep)
|
||||
|
@ -317,11 +428,11 @@ UART 输出处理
|
|||
-------------------
|
||||
|
||||
- :example:`protocols/sntp`:如何实现 Deep-sleep 模式的基本功能,周期性唤醒 ESP 模块,以从 NTP 服务器获取时间。
|
||||
- :example:`wifi/power_save`:如何实现 Wi-Fi Modem-sleep 模式。
|
||||
- :example:`wifi/power_save`:如何通过 Wi-Fi Modem-sleep 模式和自动 Light-sleep 模式保持 Wi-Fi 连接。
|
||||
|
||||
.. only:: SOC_BT_SUPPORTED
|
||||
|
||||
- :example:`bluetooth/nimble/power_save`:如何实现 Bluetooth Modem-sleep 模式。
|
||||
- :example:`bluetooth/nimble/power_save`:如何通过 Bluetooth Modem-sleep 模式和自动 Light-sleep 模式保持 Bluetooth 连接。
|
||||
|
||||
.. only:: SOC_ULP_SUPPORTED
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue