Remote Control (RMT) module driver.
The RMT (Remote Control) module driver can be used to send infrared remote control signals. Due to flexibility of RMT module, the driver can also be used to generate or receive many other types of signals.
This module is an abstraction around the IDF RMT implementation. It is recommended to read before using this module.
This is implementation currently supports transmission only.
- Change of config after initialisation.
// Prepare the config. let config = Config::new().clock_divider(1); // Retrieve the output pin and channel from peripherals. let peripherals = Peripherals::take().unwrap(); let channel = peripherals.rmt.channel0; let pin = peripherals.pins.gpio18; // Create an RMT transmitter. let tx = TxRmtDriver::new(channel, pin, &config)?; // Prepare signal pulse signal to be sent. let low = Pulse::new(PinState::Low, PulseTicks::new(10)?); let high = Pulse::new(PinState::High, PulseTicks::new(10)?); let mut signal = FixedLengthSignal::<2>::new(); signal.set(0, &(low, high))?; signal.set(1, &(high, low))?; // Transmit the signal. tx.start(signal)?;
examples/ folder of this repository for more.
VariableLengthSignal allows you to use the heap and incrementally add pulse items without knowing the size ahead of time.
- Types used for configuring the
- Stack based signal storage for an RMT signal.
Pulsecontains a pin state and a tick count, used in creating a
- Number of ticks, restricting the range to 0 to 32,767.
- The RMT receiver.
- The RMT transmitter driver.
Vecheap based storage for an RMT signal.
High(1) state for a pin.
- RMT peripheral channel.
- Signal storage for [
Transmit] in a format ready for the RMT driver.
- A utility to convert a duration into ticks, depending on the clock ticks.
- A utility to convert ticks into duration, depending on the clock ticks.