4#include <soc/soc_caps.h>
7#if defined(USE_ESP32) && SOC_I2S_SUPPORTS_TDM
18#include <driver/i2s_types.h>
23static constexpr size_t I2S_BYTES_PER_SAMPLE = 3;
25static constexpr size_t i2s_data_offset(uint16_t num_leds, uint8_t bytes_per_led) {
29static constexpr size_t buffer_bytes(uint16_t num_leds, uint8_t bytes_per_led) {
30 return i2s_data_offset(num_leds, bytes_per_led) + num_leds * bytes_per_led * I2S_BYTES_PER_SAMPLE;
41 void setup()
override;
I2SClocklessLedStrip(uint8_t *buffer, uint8_t pin, uint16_t num_leds, light::ChannelColors channel_colors)
buffer is a word aligned block of buffer_bytes().
std::atomic< bool > i2s_data_ready_
light::CorrectedBufferColorAccessor internal_accessor_
void clear_effect_data() override
int32_t size() const override
void dump_config() override
i2s_chan_handle_t tx_handle_
void write_state(light::LightState *state) override
const size_t color_data_bytes_
float get_setup_priority() const override
light::LightTraits get_traits() override
static bool i2s_on_sent_callback(i2s_chan_handle_t handle, i2s_event_data_t *event, void *user_ctx)
static constexpr size_t buffer_bytes(size_t num_leds, uint8_t bytes_per_led)
The color data of num_leds LEDs followed by one effect byte per LED.
void clear_effect_data(size_t num_leds)
Zero the effect data of the first num_leds LEDs; does nothing before the effect data is allocated.
ChannelColors channel_colors
Color accessor backed by a buffer whose contents have color correction applied.
This class represents the communication layer between the front-end MQTT layer and the hardware outpu...
This class is used to represent the capabilities of a light.
Which byte of an addressable LED's data carries each colour.
LightTraits traits() const
Colour modes of a strip with this channel order.
spi_device_handle_t handle