Chapter 2. API Reference
Parameters
• channel: RMT channel
• rx_buf_size: Size of RMT RX ringbuffer. Can be 0 if the RX ringbuffer is not used.
• intr_alloc_flags: Flags for the RMT driver interrupt handler. Pass 0 for default flags. See
esp_intr_alloc.h for details. If ESP_INTR_FLAG_IRAM is used, please do not use the memory
allocated from psram when calling rmt_write_items.
esp_err_t rmt_driver_uninstall(rmt_channel_t channel)
Uninstall RMT driver.
Return
• ESP_ERR_INVALID_ARG Parameter error
• ESP_OK Success
Parameters
• channel: RMT channel
esp_err_t rmt_get_channel_status(rmt_channel_status_result_t *channel_status)
Get the current status of eight channels.
Note Do not call this function if it is possible that rmt_driver_uninstall will be called at the same
time.
Return
• ESP_ERR_INVALID_ARG Parameter is NULL
• ESP_OK Success
Parameters
• [out] channel_status: store the current status of each channel
esp_err_t rmt_get_counter_clock(rmt_channel_t channel, uint32_t *clock_hz)
Get speed of channel’s internal counter clock.
Return
• ESP_ERR_INVALID_ARG Parameter is NULL
• ESP_OK Success
Parameters
• channel: RMT channel
• [out] clock_hz: counter clock speed, in hz
esp_err_t rmt_write_items(rmt_channel_t channel, const rmt_item32_t *rmt_item, int item_num,
bool wait_tx_done)
RMT send waveform from rmt_item array.
This API allows user to send waveform with any length.
Note This function will not copy data, instead, it will point to the original items, and send the waveform items.
If wait_tx_done is set to true, this function will block and will not return until all items have been sent
out. If wait_tx_done is set to false, this function will return immediately, and the driver interrupt will
continue sending the items. We must make sure the item data will not be damaged when the driver is still
sending items in driver interrupt.
Return
• ESP_ERR_INVALID_ARG Parameter error
• ESP_OK Success
Parameters
• channel: RMT channel
• rmt_item: head point of RMT items array. If ESP_INTR_FLAG_IRAM is used, please do not
use the memory allocated from psram when calling rmt_write_items.
• item_num: RMT data item number.
• wait_tx_done:
– If set 1, it will block the task and wait for sending done.
– If set 0, it will not wait and return immediately.
esp_err_t rmt_wait_tx_done(rmt_channel_t channel, TickType_t wait_time)
Wait RMT TX finished.
Return
Espressif Systems 350
Submit Document Feedback
Release v4.4