Chapter 2. API Reference
• The RMT transmitter has finished transmitting the signal -
• The number of events the transmitter has sent matches a threshold value
• Ownership to the RMT memory block has been violated -
Setting or clearing an interrupt enable mask for specific channels and events may be also done by calling
rmt_set_intr_enable_mask()
When servicing an interrupt within an ISR, the interrupt need to explicitly cleared.
cific bits described as RMT.int_clr.val.chN_event_name and defined as a volatile struct in
soc/esp32s2/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 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 regis-
tered 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 rmt_register_tx_end_callback().
Uninstall Driver
If the RMT driver has been installed with
not required, the driver may be removed to free allocated resources by calling rmt_driver_uninstall().
Application Examples
• Using RMT to send morse code: peripherals/rmt/morse_code.
• Using RMT to drive RGB LED strip: peripherals/rmt/led_strip.
• NEC remote control TX and RX example: peripherals/rmt/ir_protocols.
• Musical buzzer example: peripherals/rmt/musical_buzzer.
API Reference
Header File
•
components/driver/include/driver/rmt.h
Functions
esp_err_t rmt_set_clk_div(rmt_channel_t
Set RMT clock divider, channel clock is divided from source clock.
Return
• ESP_ERR_INVALID_ARG Parameter error
• ESP_OK Success
Parameters
• channel: RMT channel
• div_cnt: RMT counter clock divider
esp_err_t rmt_get_clk_div(rmt_channel_t
Get RMT clock divider, channel clock is divided from source clock.
Return
• ESP_ERR_INVALID_ARG Parameter error
• ESP_OK Success
Parameters
• channel: RMT channel
• div_cnt: pointer to accept RMT counter divider
Espressif Systems
rmt_set_tx_intr_en()
rmt_set_err_intr_en()
or rmt_clr_intr_enable_mask().
rmt_driver_install()
channel, uint8_t div_cnt)
channel, uint8_t *div_cnt)
343
Submit Document Feedback
rmt_set_tx_thr_intr_en()
To do so, set spe-
for some specific period of time and then
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?