Unified handler for WS2812 addressable LED strips.
More...
#include <Ws2812Handler.h>
|
| struct | Config |
| | Configuration structure for the WS2812 handler. More...
|
| |
Unified handler for WS2812 addressable LED strips.
Provides thread-safe access to LED strip control and animation effects.
◆ Ws2812Handler() [1/3]
| Ws2812Handler::Ws2812Handler |
( |
const Config & | config | ) |
|
|
explicitnoexcept |
Construct WS2812 handler with configuration.
- Parameters
-
| config | LED strip configuration. |
◆ ~Ws2812Handler()
| Ws2812Handler::~Ws2812Handler |
( |
| ) |
|
|
noexcept |
◆ Ws2812Handler() [2/3]
◆ Ws2812Handler() [3/3]
◆ Deinitialize()
| bool Ws2812Handler::Deinitialize |
( |
| ) |
|
|
noexcept |
Deinitialize and release RMT resources.
◆ DumpDiagnostics()
| void Ws2812Handler::DumpDiagnostics |
( |
| ) |
|
|
noexcept |
Dump diagnostics to logger.
◆ EnsureInitialized()
| bool Ws2812Handler::EnsureInitialized |
( |
| ) |
|
|
noexcept |
Ensure strip resources are initialized (lazy init entrypoint).
- Returns
- true if initialized and ready.
◆ EnsureInitializedLocked()
| bool Ws2812Handler::EnsureInitializedLocked |
( |
| ) |
|
|
privatenoexcept |
◆ GetAnimator() [1/2]
| const WS2812Animator * Ws2812Handler::GetAnimator |
( |
| ) |
const |
|
noexcept |
◆ GetAnimator() [2/2]
| WS2812Animator * Ws2812Handler::GetAnimator |
( |
| ) |
|
|
noexcept |
Get the animator object.
- Returns
- Pointer to WS2812Animator, or nullptr if not initialized.
- Warning
- Raw pointer — NOT mutex-protected. Prefer visitAnimator().
◆ GetDefaultConfig()
| static Config Ws2812Handler::GetDefaultConfig |
( |
| ) |
|
|
inlinestaticnoexcept |
Get a sensible default Config.
- Returns
- Default Config structure.
◆ GetDescription()
| const char * Ws2812Handler::GetDescription |
( |
| ) |
const |
|
noexcept |
Get a human-readable description of the handler.
- Returns
- String e.g. "WS2812 LED Strip (GPIO48, 30 LEDs)"
◆ GetDriver() [1/2]
| const WS2812Strip * Ws2812Handler::GetDriver |
( |
| ) |
const |
|
noexcept |
◆ GetDriver() [2/2]
| WS2812Strip * Ws2812Handler::GetDriver |
( |
| ) |
|
|
noexcept |
◆ GetNumLeds()
| uint32_t Ws2812Handler::GetNumLeds |
( |
| ) |
const |
|
inlinenoexcept |
Get the number of LEDs in the strip.
◆ GetStrip() [1/2]
| const WS2812Strip * Ws2812Handler::GetStrip |
( |
| ) |
const |
|
noexcept |
◆ GetStrip() [2/2]
| WS2812Strip * Ws2812Handler::GetStrip |
( |
| ) |
|
|
noexcept |
Get the underlying LED strip object.
- Returns
- Pointer to WS2812Strip, or nullptr if not initialized.
- Warning
- Raw pointer — NOT mutex-protected. Caller is responsible for external synchronization in multi-task environments. Prefer visitDriver() for thread-safe access.
◆ Initialize()
| esp_err_t Ws2812Handler::Initialize |
( |
| ) |
|
|
noexcept |
Initialize the RMT channel and LED strip.
- Returns
- ESP_OK on success, or esp_err_t error code from the RMT driver.
◆ IsInitialized()
| bool Ws2812Handler::IsInitialized |
( |
| ) |
const |
|
inlinenoexcept |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ visitAnimator()
template<typename Fn >
| auto Ws2812Handler::visitAnimator |
( |
Fn && | fn | ) |
-> decltype(fn(std::declval<WS2812Animator&>())) |
|
inlinenoexcept |
Visit animator object with a callable.
- Returns
- Callable result or default-constructed value if unavailable.
◆ visitDriver()
template<typename Fn >
| auto Ws2812Handler::visitDriver |
( |
Fn && | fn | ) |
-> decltype(fn(std::declval<WS2812Strip&>())) |
|
inlinenoexcept |
Visit strip driver with a callable.
- Returns
- Callable result or default-constructed value if unavailable.
◆ animator_
| std::unique_ptr<WS2812Animator> Ws2812Handler::animator_ |
|
private |
◆ config_
◆ description_
| char Ws2812Handler::description_[64] {} |
|
private |
Human-readable handler description.
◆ initialized_
| bool Ws2812Handler::initialized_ {false} |
|
private |
◆ mutex_
| RtosMutex Ws2812Handler::mutex_ |
|
mutableprivate |
◆ strip_
| std::unique_ptr<WS2812Strip> Ws2812Handler::strip_ |
|
private |
The documentation for this class was generated from the following files: