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,
80u32.MHz(),
&mut system.peripheral_clock_control,
&clocks,
)
.unwrap();
let led = <smartLedAdapter!(0, 1)>::new(rmt.channel0, io.pins.gpio0);
Macros
- Macro to generate adapters with an arbitrary buffer size fitting for a specific number of
$buffer_size
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