EasyManua.ls Logo

Espressif ESP32-S2 - Page 353

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 2. API Reference
size is provided when calling rmt_driver_install() discussed above. To get a handle to this buffer call
rmt_get_ringbuf_handle().
With the above steps complete we can start the receiver by calling rmt_rx_start() and then move to checking
whats inside the buffer. To do so, you can use common FreeRTOS functions that interact with the ring buffer.
Please see an example how to do it in peripherals/rmt/ir_protocols.
To stop the receiver, call rmt_rx_stop().
Change Operation Parameters
Previously described function rmt_config() provides a convenient way to set several configuration parameters
in one shot. This is usually done on application start. Then, when the application is running, the API provides an
alternate way to update individual parameters by calling dedicated functions. Each function refers to the specific
RMT channel provided as the first input parameter. Most of the functions have _get_ counterpart to read back the
currently configured value.
Parameters Common to Transmit and Receive Mode
Selection of a GPIO pin number on the input or output of the RMT - rmt_set_gpio()
Number of memory blocks allocated for the incoming or outgoing data - rmt_set_mem_pd()
Setting of the clock divider - rmt_set_clk_div()
Selection of the clock source, note that currently one clock source is supported, the APB clock which is 80Mhz
- rmt_set_source_clk()
Transmit Mode Parameters
Enable or disable the loop back mode for the transmitter - rmt_set_tx_loop_mode()
Binary level on the output to apply the carrier - rmt_set_tx_carrier(), selected from
rmt_carrier_level_t
Determines the binary level on the output when transmitter is idle - rmt_set_idle_level(), selected
from rmt_idle_level_t
Enable or disable loop count feature to automatically transmit items for N iterations, then trigger an ISR callback
- rmt_set_tx_loop_count()
Enable automatically stopping when the number of iterations matches the set loop count. Note
this is not reliable for target that doesnt support SOC_RMT_SUPPORT_TX_LOOP_AUTOSTOP. -
rmt_enable_tx_loop_autostop()
Receive Mode Parameters
The filter setting - rmt_set_rx_filter()
The receiver threshold setting - rmt_set_rx_idle_thresh()
Whether the transmitter or receiver is entitled to access RMTs memory - rmt_set_memory_owner(),
selection is from rmt_mem_owner_t.
Use Interrupts
Registering of an interrupt handler for the RMT controller is done be calling rmt_isr_register().
Note: When calling 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 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:
The RMT receiver has finished receiving a signal - rmt_set_rx_intr_en()
Espressif Systems 342
Submit Document Feedback
Release v4.4

Table of Contents