Expand description
RMT (Remote Control) peripheral support.
The RMT (Remote Control Transceiver) peripheral was designed to act as an infrared transceiver.
However, due to the flexibility of its data format, RMT can be extended to a versatile and
general-purpose transceiver, transmitting or receiving many other types of signals.
From the perspective of network layering, the RMT hardware contains both physical and data
link layers. The physical layer defines the communication media and bit signal representation.
The data link layer defines the format of an RMT frame. The minimal data unit in the frame is
called the RMT symbol, which is represented by Symbol in the driver.
ESP32 contains multiple channels in the RMT peripheral. Each channel can be independently configured as either transmitter or receiver.
Typically, the RMT peripheral can be used in the following scenarios:
- Transmit or receive infrared signals, with any IR protocols, e.g., NEC
- General-purpose sequence generator
- Transmit signals in a hardware-controlled loop, with a finite or infinite number of times
- Multi-channel simultaneous transmission
- Modulate the carrier to the output signal or demodulate the carrier from the input signal
§Driver redesign in ESP-IDF 5.0
In ESP-IDF 5.0, the RMT API was redesigned to simplify and unify the usage of the RMT peripheral.
It is recommended to use the new API, but for now the old API is available through
the rmt-legacy feature. The ESP-IDF 6.0 release will remove support for the legacy API.
Modules§
Structs§
- Pulse
- A
Pulsedefines for how long the output pin should be high or low. - Pulse
Ticks - Number of ticks, restricting the range to 0 to 32,767.
- RxChannel
Driver - RxDone
Event Data - Type of RMT RX done event data.
- Symbol
- A
Symbolconstists of twoPulses, where each pulse defines a level of the pin (high or low) and a duration (PulseTicks). - Sync
Manager - In some real-time control applications (e.g., to make two robotic arms move simultaneously), you do not want any time drift between different channels. The RMT driver can help to manage this by creating a so-called Sync Manager.
- TxChannel
Driver - TxDone
Event Data - Type of RMT TX done event data.
- TxQueue
- A queue to efficiently transmit multiple signals, reusing encoders when possible.
Enums§
- Clock
Source - Clock source for RMT channels.
- PinState
- A
Low(0) orHigh(1) state for a pin.
Traits§
- RmtChannel
- A trait implemented by an RMT channel that provides common functionality.
Functions§
- duration_
to_ ticks - A utility to convert a duration into ticks, depending on the clock ticks.
- ticks_
to_ duration - A utility to convert ticks into duration, depending on the clock ticks.