| Crates.io | esp-hal-smartled2 |
| lib.rs | esp-hal-smartled2 |
| version | 0.28.1 |
| created_at | 2025-11-04 23:23:32.971963+00 |
| updated_at | 2025-11-11 16:57:43.541663+00 |
| description | smart-leds driver for esp-hal using RMT peripheral. |
| homepage | |
| repository | https://github.com/kleinesfilmroellchen/esp-hal-smartled |
| max_upload_size | |
| id | 1917127 |
| size | 85,354 |
NOTE: This is an enhanced up-to-date fork of esp-hal-smartled, which seems abandoned. Users of
esp-hal-smartledcan migrate toesp-hal-smartled2with some effort.
Allows for the use of an RMT output channel on the ESP32 family to easily drive smart RGB LEDs. This is a driver for the smart-leds framework and allows using the utility functions from this crate as well as higher-level libraries based on smart-leds.
Different from ws2812-esp32-rmt-driver, which is based on the unofficial esp-idf SDK, this crate is based on the official no-std esp-hal. The RMT peripheral approach is common across many smart LED drivers on ESP32, like Arduino FastLED.
Configurability: esp-hal-smartled2 works with:
smart-led color type, including RGB, RGBW, RGBCCT, CCT, in 8, 16, 32 or 64 bits.This makes esp-hal-smartled2 compatible with many configurations of LEDs, and almost the entire smart-leds featureset. Since all of these are determined at compile-time, the driver is always well-optimized for your specific LED type.
Async support: The SmartLedsWriteAsync trait of smart-leds is supported, allowing you to use the driver without waiting for the LED write to complete.
No Allocation: The driver uses only static buffers based on the maximum number of LEDs to drive, so you can use it without an allocator.
smart-leds and embedded-graphics ecosystem: Thanks to implementing smart-leds, this crate allows you to write and use generic code compatible with any smart-leds driver. Furthermore, using smart-leds-matrix, you can set up a 2D LED matrix using this driver and use it with the 2D graphics routines from embedded-graphics and its ecosystem. Note that this is only supported for RGB LED strips.
Also have a look at the examples.
This crate is guaranteed to compile on whatever Rust version esp-hal requires, which is the latest stable version at the time of release. It might compile with older versions but that may change in any new patch release.
This crate uses the unstable RMT peripheral from esp-hal. Therefore, it is compatible with exactly esp-hal 1.0.0, as the peripheral API might change in any future release and is likely to go through significant changes before stabilization. In order to use this crate, you have to enable the unstable feature on esp-hal.
0.28
SmartLedsAdapter to the more descriptive RmtSmartLeds to emphasize the use of the RMT peripheral.SmartLedsAdapter::flush function that sends the previously created RMT data again (only in blocking mode).0.27
RmtSmartLeds and buffer_size now take a Color type parameter (after the transmit mode). This allows you to use color types other than RGB8, including ones with larger bit widths. Rgb8RmtSmartLeds is a convenience alias for common RGB8-based LEDs, and works like RmtSmartLeds did before.ColorOrder is now a generic trait over a color type, since some color orders work with multiple color types (e.g. all RGB orders work with all RGB color types, regardless of bit width). The existing order types work as before.Channel has been removed, as the channel count can now be larger or smaller depending on the color type. Since this is not really enforceable at compile time, care must be taken when passing channel numbers to ColorOrder::get_channel_data().write function now, it immediately prepares the driver for sending. The actual send is still only dispatched once you await it. The rewritten async example shows how this can be used in practice to prepare the buffer in advance, and dispatch multiple LED writes simultaneously using join.0.26
RmtSmartLeds::new now returns Result<RmtSmartLeds, RmtError>, so that you can handle configuration errors if desired.RmtSmartLeds::new_with_memsize was added to specify a larger RMT memory size when desired.0.25
Ws2811LowSpeedTiming. If you experience issues with WS2811, switch to the low-speed timing.0.24
SmartLedsWriteAsync is now implemented for async RMT channels. Refer to the async example for more information.0.23 (from esp-hal-smartled):
SmartLedAdapter now takes type parameters describing the timing and LED buffer size.new. The smartLedBuffer! macro has been removed, and the buffer_size function can be used instead to calculate the correct buffer size.esp-hal, where such work is explicitly planned.If you really need one of them, please tell me about it!
Licensed under either of:
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.