From 101c6abf04be46cc459d5dcf7c206c66c1b47c1a Mon Sep 17 00:00:00 2001 From: morris Date: Mon, 23 Oct 2023 11:35:53 +0800 Subject: [PATCH] docs(rmt): correct the reason about not allowing customized ISR handler Closes https://github.com/espressif/esp-idf/issues/11478 --- docs/en/api-reference/peripherals/rmt.rst | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/docs/en/api-reference/peripherals/rmt.rst b/docs/en/api-reference/peripherals/rmt.rst index 7495ebcee5..89f4cbdf51 100644 --- a/docs/en/api-reference/peripherals/rmt.rst +++ b/docs/en/api-reference/peripherals/rmt.rst @@ -278,11 +278,7 @@ Receive Mode Parameters Use Interrupts -------------- -Registering of an interrupt handler for the RMT controller is done be calling :cpp:func:`rmt_isr_register`. - -.. note:: - - When calling :cpp:func:`rmt_driver_install` to use the system RMT driver, a default ISR is being installed. In such a case you cannot register a generic ISR handler with :cpp:func:`rmt_isr_register`. +Registering of an interrupt handler for the RMT controller is done by calling :cpp:func:`rmt_isr_register`. The RMT controller triggers interrupts on four specific events describes below. To enable interrupts on these events, the following functions are provided: @@ -295,12 +291,13 @@ Setting or clearing an interrupt enable mask for specific channels and events ma When servicing an interrupt within an ISR, the interrupt need to explicitly cleared. To do so, set specific bits described as ``RMT.int_clr.val.chN_event_name`` and defined as a ``volatile struct`` in :component_file:`soc/{IDF_TARGET_PATH_NAME}/include/soc/rmt_struct.h`, where N is the RMT channel number [0, n] and the ``event_name`` is one of four events described above. -If you do not need an ISR anymore, you can deregister it by calling a function :cpp:func:`rmt_isr_deregister`. +If you do not need an ISR anymore, you can de-register it by calling a function :cpp:func:`rmt_isr_deregister`. .. warning:: - It's not recommended for users to register an interrupt handler in their applications. RMT driver is highly dependent on interrupt, especially when doing transaction in a ping-pong way, so the driver itself has registered a default handler called ``rmt_driver_isr_default``. - Instead, if what you want is to get a notification when transaction is done, go ahead with :cpp:func:`rmt_register_tx_end_callback`. + :cpp:func:`rmt_isr_register` is provided as a public API by mistake. It's not recommended to use it directly. Even if you have registered a customized ISR handler with that, you still don't have the context of the RMT driver object. The driver has registered a dedicated ISR handler called ``rmt_driver_isr_default`` within :cpp:func:`rmt_driver_install`. + + If you want to get a notification at some specific event (for example, "transaction done"), you can register callback functions like :cpp:func:`rmt_register_tx_end_callback`. Uninstall Driver