Chapter 2. API Reference
esp_err_t rmt_set_rx_idle_thresh(rmt_channel_t channel, uint16_t thresh)
Set RMT RX idle threshold value.
In receive mode, when no edge is detected on the input signal for longer than idle_thres channel clock cycles,
the receive process is finished.
Return
• ESP_ERR_INVALID_ARG Parameter error
• ESP_OK Success
Parameters
• channel: RMT channel
• thresh: RMT RX idle threshold
esp_err_t rmt_get_rx_idle_thresh(rmt_channel_t channel, uint16_t *thresh)
Get RMT idle threshold value.
In receive mode, when no edge is detected on the input signal for longer than idle_thres channel clock cycles,
the receive process is finished.
Return
• ESP_ERR_INVALID_ARG Parameter error
• ESP_OK Success
Parameters
• channel: RMT channel
• thresh: pointer to accept RMT RX idle threshold value
esp_err_t rmt_set_mem_block_num(rmt_channel_t channel, uint8_t rmt_mem_num)
Set RMT memory block number for RMT channel.
This function is used to configure the amount of memory blocks allocated to channel n The 8 channels share
a 512x32-bit RAM block which can be read and written by the processor cores over the APB bus, as well as
read by the transmitters and written by the receivers.
The RAM address range for channel n is start_addr_CHn to end_addr_CHn, which are defined by: Memory
block start address is RMT_CHANNEL_MEM(n) (in soc/rmt_reg.h), that is, start_addr_chn = RMT base
address + 0x800 + 64 ∗ 4 ∗ n, and end_addr_chn = RMT base address + 0x800 + 64 ∗ 4 ∗ n + 64 ∗ 4 ∗
RMT_MEM_SIZE_CHn mod 512 ∗ 4
Note If memory block number of one channel is set to a value greater than 1, this channel will occupy the
memory block of the next channel. Channel 0 can use at most 8 blocks of memory, accordingly channel
7 can only use one memory block.
Return
• ESP_ERR_INVALID_ARG Parameter error
• ESP_OK Success
Parameters
• channel: RMT channel
• rmt_mem_num: RMT RX memory block number, one block has 64 * 32 bits.
esp_err_t rmt_get_mem_block_num(rmt_channel_t channel, uint8_t *rmt_mem_num)
Get RMT memory block number.
Return
• ESP_ERR_INVALID_ARG Parameter error
• ESP_OK Success
Parameters
• channel: RMT channel
• rmt_mem_num: Pointer to accept RMT RX memory block number
esp_err_t rmt_set_tx_carrier(rmt_channel_t channel, bool carrier_en, uint16_t high_level, uint16_t
low_level, rmt_carrier_level_t carrier_level)
Configure RMT carrier for TX signal.
Set different values for carrier_high and carrier_low to set different frequency of carrier. The unit of car-
rier_high/low is the source clock tick, not the divided channel counter clock.
Espressif Systems 344
Submit Document Feedback
Release v4.4