From c654f653fdfaf7cb51a6737ddcf15919587a7e2a Mon Sep 17 00:00:00 2001 From: mofeifei Date: Wed, 30 Jul 2025 10:24:04 +0800 Subject: [PATCH] docs: fix rmt loop transmit description --- docs/en/api-reference/peripherals/rmt.rst | 5 ++--- docs/zh_CN/api-reference/peripherals/rmt.rst | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/en/api-reference/peripherals/rmt.rst b/docs/en/api-reference/peripherals/rmt.rst index f6a02443f3..7d8777a471 100644 --- a/docs/en/api-reference/peripherals/rmt.rst +++ b/docs/en/api-reference/peripherals/rmt.rst @@ -246,11 +246,10 @@ Once you created an encoder, you can initiate a TX transaction by calling :cpp:f - :cpp:member:`rmt_transmit_config_t::loop_count` sets the number of transmission loops. After the transmitter has finished one round of transmission, it can restart the same transmission again if this value is not set to zero. As the loop is controlled by hardware, the RMT channel can be used to generate many periodic sequences with minimal CPU intervention. - Setting :cpp:member:`rmt_transmit_config_t::loop_count` to `-1` means an infinite loop transmission. In this case, the channel does not stop until :cpp:func:`rmt_disable` is called. The "trans-done" event is not generated as well. - - Setting :cpp:member:`rmt_transmit_config_t::loop_count` to a positive number means finite number of iterations. In this case, the "trans-done" event is when the specified number of iterations have completed. - .. note:: + .. only:: not esp32 - The **loop transmit** feature is not supported on all ESP chips, please refer to [`TRM <{IDF_TARGET_TRM_EN_URL}#rmt>`__] before you configure this option, or you might encounter :c:macro:`ESP_ERR_NOT_SUPPORTED` error. + - Setting :cpp:member:`rmt_transmit_config_t::loop_count` to a positive number means finite number of iterations. In this case, the "trans-done" event is when the specified number of iterations have completed. - :cpp:member:`rmt_transmit_config_t::eot_level` sets the output level when the transmitter finishes working or stops working by calling :cpp:func:`rmt_disable`. - :cpp:member:`rmt_transmit_config_t::queue_nonblocking` sets whether to wait for a free slot in the transaction queue when it is full. If this value is set to ``true``, then the function will return with an error code :c:macro:`ESP_ERR_INVALID_STATE` when the queue is full. Otherwise, the function will block until a free slot is available in the queue. diff --git a/docs/zh_CN/api-reference/peripherals/rmt.rst b/docs/zh_CN/api-reference/peripherals/rmt.rst index 0e20a7d4e9..652d18063e 100644 --- a/docs/zh_CN/api-reference/peripherals/rmt.rst +++ b/docs/zh_CN/api-reference/peripherals/rmt.rst @@ -246,11 +246,10 @@ RMT 是一种特殊的通信外设,无法像 SPI 和 I2C 那样发送原始字 - :cpp:member:`rmt_transmit_config_t::loop_count` 设置发送的循环次数。在发射器完成一轮发送后,如果该值未设置为零,则再次启动相同的发送程序。由于循环由硬件控制,RMT 通道可以在几乎不需要 CPU 干预的情况下,生成许多周期性序列。 - 将 :cpp:member:`rmt_transmit_config_t::loop_count` 设置为 ``-1``,会启用无限循环发送机制,此时,除非手动调用 :cpp:func:`rmt_disable`,否则通道不会停止,也不会生成“完成发送”事件。 - - 将 :cpp:member:`rmt_transmit_config_t::loop_count` 设置为正数,意味着迭代次数有限。此时,“完成发送”事件在指定的迭代次数完成后发生。 - .. note:: + .. only:: not esp32 - 注意,不是所有 ESP 芯片都支持 **循环发送** 功能,在配置此选项前,请参阅 [`TRM <{IDF_TARGET_TRM_EN_URL}#rmt>`__]。若所选芯片不支持配置此选项,可能会报告 :c:macro:`ESP_ERR_NOT_SUPPORTED` 错误。 + - 将 :cpp:member:`rmt_transmit_config_t::loop_count` 设置为正数,意味着迭代次数有限。此时,“完成发送”事件在指定的迭代次数完成后发生。 - :cpp:member:`rmt_transmit_config_t::eot_level` 设置发射器完成工作时的输出电平,该设置同时适用于调用 :cpp:func:`rmt_disable` 停止发射器工作时的输出电平。 - :cpp:member:`rmt_transmit_config_t::queue_nonblocking` 设置当传输队列满的时候该函数是否需要等待。如果该值设置为 ``true`` 那么当遇到队列满的时候,该函数会立即返回错误代码 :c:macro:`ESP_ERR_INVALID_STATE`。否则,函数会阻塞当前线程,直到传输队列有空档。