Skip to main content

Module rmt

Module rmt 

Source
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§

config
encoder

Structs§

Pulse
A Pulse defines for how long the output pin should be high or low.
PulseTicks
Number of ticks, restricting the range to 0 to 32,767.
RxChannelDriver
RxDoneEventData
Type of RMT RX done event data.
Symbol
A Symbol constists of two Pulses, where each pulse defines a level of the pin (high or low) and a duration (PulseTicks).
SyncManager
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.
TxChannelDriver
TxDoneEventData
Type of RMT TX done event data.
TxQueue
A queue to efficiently transmit multiple signals, reusing encoders when possible.

Enums§

ClockSource
Clock source for RMT channels.
PinState
A Low (0) or High (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.