10#include "ws2812_version.h"
34 explicit WS2812Strip(gpio_num_t gpio = (gpio_num_t)CONFIG_WS2812_LED_RMT_TX_GPIO,
35 int channel = CONFIG_WS2812_LED_RMT_TX_CHANNEL, uint32_t num_leds =
NUM_LEDS,
36#
if CONFIG_WS2812_LED_TYPE_RGBW
63 void SetPixel(uint32_t index, uint32_t rgbw);
98 void SetTimings(uint16_t t0h, uint16_t t1h, uint16_t t0l, uint16_t t1l);
117 return HF_WS2812_RMT_VERSION_STRING;
122 return HF_WS2812_RMT_VERSION_MAJOR;
127 return HF_WS2812_RMT_VERSION_MINOR;
132 return HF_WS2812_RMT_VERSION_PATCH;
136 static constexpr uint16_t kResetTicks =
kResetTimeUs * 10;
138 std::vector<uint32_t> pixels_;
139 std::vector<rmt_symbol_word_t> buffer_;
154 return HF_WS2812_RMT_VERSION_STRING;
C++ convenience wrapper for a chain of WS2812 LEDs.
Definition ws2812_cpp.hpp:26
void SetPixel(uint32_t index, uint32_t rgbw)
Set the colour of a single LED.
Definition ws2812_cpp.cpp:30
void SetTimings(uint16_t t0h, uint16_t t1h, uint16_t t0l, uint16_t t1l)
Update the bit timing parameters.
Definition ws2812_cpp.cpp:92
static constexpr uint32_t kResetTimeUs
Definition ws2812_cpp.hpp:109
uint32_t Length() const
Definition ws2812_cpp.cpp:36
esp_err_t Begin()
Report whether the strip's RMT channel is ready, retrying its set-up if it failed.
Definition ws2812_cpp.cpp:26
static constexpr uint8_t GetDriverVersionMinor() noexcept
Get the compiled driver minor version number.
Definition ws2812_cpp.hpp:126
esp_err_t Show()
Send the currently stored colours to the LED strip.
Definition ws2812_cpp.cpp:40
static constexpr const char * GetDriverVersion() noexcept
Get the compiled driver version string.
Definition ws2812_cpp.hpp:116
static uint32_t ColorWheel(uint8_t pos)
Generate a colour from a 0-255 position on a colour wheel.
Definition ws2812_cpp.cpp:99
static constexpr uint8_t GetDriverVersionMajor() noexcept
Get the compiled driver major version number.
Definition ws2812_cpp.hpp:121
void SetNumLeds(uint32_t num_leds)
Resize the strip to a new LED count at runtime.
Definition ws2812_cpp.cpp:86
static constexpr uint8_t GetDriverVersionPatch() noexcept
Get the compiled driver patch version number.
Definition ws2812_cpp.hpp:131
void SetBrightness(uint8_t value)
Set global brightness for the strip.
Definition ws2812_cpp.cpp:82
Definition rmt_wrapper.hpp:52
A modern C++17 header‑only wrapper around the ESP‑IDF v5.3 “new” RMT.
ESP-IDF RMT backend for WS2812 / NeoPixel LED chains.
#define WS2812_T1L
Definition ws2812_control.h:43
#define WS2812_T0L
Definition ws2812_control.h:42
#define NUM_LEDS
Definition ws2812_control.h:26
#define WS2812_T0H
Definition ws2812_control.h:38
#define WS2812_DEFAULT_BRIGHTNESS
Definition ws2812_control.h:46
#define WS2812_T1H
Definition ws2812_control.h:40
const char * GetWS2812DriverVersion() noexcept
Get the WS2812 driver version string (free function).
Definition ws2812_cpp.hpp:153
LedType
Definition ws2812_cpp.hpp:17