Chapter 2. API Reference
Public Members
rmt_tx_end_fn_t function
Function which is called on RMT TX end
void *arg
Optional argument passed to function
Macros
RMT_CHANNEL_FLAGS_AWARE_DFS
Channel can work during APB clock scaling
RMT_CHANNEL_FLAGS_INVERT_SIG
Invert RMT signal
RMT_MEM_ITEM_NUM
Define memory space of each RMT channel (in words = 4 bytes)
RMT_DEFAULT_CONFIG_TX(gpio, channel_id)
Default configuration for Tx channel.
RMT_DEFAULT_CONFIG_RX(gpio, channel_id)
Default configuration for RX channel.
Type Definitions
typedef intr_handle_t rmt_isr_handle_t
RMT interrupt handle.
typedef void (*rmt_tx_end_fn_t)(rmt_channel_t channel, void *arg)
Type of RMT Tx End callback function.
typedef void (*sample_to_rmt_t)(const void *src, rmt_item32_t *dest, size_t src_size, size_t
wanted_num, size_t *translated_size, size_t *item_num)
User callback function to convert uint8_t type data to rmt format(rmt_item32_t).
This function may be called from an ISR, so, the code should be short and efficient.
Note In fact, item_num should be a multiple of translated_size, e.g. : When we convert each byte of uint8_t
type data to rmt format data, the relation between item_num and translated_size should be item_num
= translated_size*8.
Parameters
• src: Pointer to the buffer storing the raw data that needs to be converted to rmt format.
• [out] dest: Pointer to the buffer storing the rmt format data.
• src_size: The raw data size.
• wanted_num: The number of rmt format data that wanted to get.
• [out] translated_size: The size of the raw data that has been converted to rmt format, it
should return 0 if no data is converted in user callback.
• [out] item_num: The number of the rmt format data that actually converted to, it can be less
than wanted_num if there is not enough raw data, but cannot exceed wanted_num. it should return
0 if no data was converted.
Header File
• components/hal/include/hal/rmt_types.h
Structures
struct rmt_channel_status_result_t
Data struct of RMT channel status.
Espressif Systems 355
Submit Document Feedback
Release v4.4