Crate esp_hal_smartled
source ·Expand description
This adapter allows for the use of an RMT output channel to easily interact
with RGB LEDs and use the convenience functions of the
smart-leds
crate.
This is a simple implementation where every LED is adressed in an individual RMT operation. This is working perfectly fine in blocking mode, but in case this is used in combination with interrupts that might disturb the sequential sending, an alternative implementation (addressing the LEDs in a sequence in a single RMT send operation) might be required!
§Example
ⓘ
let io = IO::new(peripherals.GPIO, peripherals.IO_MUX);
let rmt = Rmt::new(peripherals.RMT, 80.MHz(), &clocks).unwrap();
let rmt_buffer = smartLedBuffer!(1);
let mut led = SmartLedsAdapter::new(rmt.channel0, io.pins.gpio2, rmt_buffer);
§Feature Flags
defmt
— Implementdefmt::Format
on certain types.
§Chip Support Feature Flags
esp32
— Target the ESP32.esp32c3
— Target the ESP32-C3.esp32c6
— Target the ESP32-C6.esp32h2
— Target the ESP32-H2.esp32s2
— Target the ESP32-S2.esp32s3
— Target the ESP32-S3.
Macros§
- Macro to allocate a buffer sized for a specific number of LEDs to be addressed.
Structs§
- Adapter taking an RMT channel and a specific pin and providing RGB LED interaction functionality using the
smart-leds
crate
Enums§
- All types of errors that can happen during the conversion and transmission of LED commands