mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
feat(driver_spi): slave hd driver sleep retention support
This commit is contained in:
@@ -121,6 +121,16 @@ Receiving General Purpose Interrupts from the Master
|
||||
|
||||
When the master sends ``CMD8``, ``CMD9`` or ``CMDA``, the slave corresponding is triggered. Currently the ``CMD8`` is permanently used to indicate the termination of ``Rd_DMA`` segments. To receive general-purpose interrupts, register callbacks for ``CMD9`` and ``CMDA`` when the slave is initialized, see :ref:`spi_slave_hd_callbacks`.
|
||||
|
||||
.. only:: SOC_SPI_SUPPORT_SLEEP_RETENTION
|
||||
|
||||
Sleep Retention
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
{IDF_TARGET_NAME} supports to retain the SPI register context before entering **light sleep** and restore them after waking up. This means you don't have to re-init the SPI driver after the light sleep.
|
||||
|
||||
This feature can be enabled by setting the flag :c:macro:`SPICOMMON_BUSFLAG_SLP_ALLOW_PD`. It will allow the system to power down the SPI in light sleep, meanwhile save the register context. It can help to save more power consumption with some extra cost of the memory.
|
||||
|
||||
Notice that when GPSPI is working as a slave, it is **not** support to enter sleep when any transaction (including TX and RX) is not finished.
|
||||
|
||||
.. only:: not esp32
|
||||
|
||||
|
||||
@@ -121,6 +121,16 @@ SPI 从机半双工模式
|
||||
|
||||
当主机发送 ``CMD8``、``CMD9`` 或 ``CMDA`` 时,从机会触发相应的动作。目前,``CMD8`` 固定用于指示 ``Rd_DMA`` 段的终止。要接收通用中断,可以在从机初始化时为 ``CMD9`` 和 ``CMDA`` 注册回调函数,详情请参阅 :ref:`spi_slave_hd_callbacks`。
|
||||
|
||||
.. only:: SOC_SPI_SUPPORT_SLEEP_RETENTION
|
||||
|
||||
睡眠保留
|
||||
^^^^^^^^
|
||||
|
||||
{IDF_TARGET_NAME} 支持在进入 **Light Sleep** 之前保留 SPI 寄存器中的内容,并在唤醒后恢复。即程序不需要在 **Light Sleep** 唤醒后重新配置 SPI。
|
||||
|
||||
该特性可以通过置位配置中的 :c:macro:`SPICOMMON_BUSFLAG_SLP_ALLOW_PD` 标志位启用。启用后驱动允许系统在 Light Sleep 时对 SPI 掉电,同时保存寄存器配置。它可以帮助降低轻度睡眠时的功耗,但需要花费一些额外的存储来保存寄存器的配置。
|
||||
|
||||
注意在 Slave 角色下,不支持在所有传输(发送和接收)未完成时进入睡眠,否则将会出错。
|
||||
|
||||
.. only:: not esp32
|
||||
|
||||
|
||||
Reference in New Issue
Block a user