ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
led_strip.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef USE_LN882X
4
5#include <cstddef>
6#include <cstdint>
7
12
14
16 public:
19 LN882xSPILEDStripLightOutput(uint8_t pin, uint16_t num_leds, light::ChannelColors channel_colors, uint8_t prescaler,
20 uint8_t bit0_high_bits, uint8_t bit1_high_bits, uint16_t reset_bytes);
21
22 void setup() override;
23 void dump_config() override;
24 float get_setup_priority() const override;
25
27 int32_t size() const override { return this->num_leds_; }
29 void write_state(light::LightState *state) override;
30
32 void set_max_refresh_rate(uint32_t interval_us) { this->max_refresh_rate_ = interval_us; }
33
34 protected:
36 const size_t color_data_bytes_;
37 const size_t dma_data_bytes_;
38 uint8_t *dma_data_{nullptr};
41
42 const uint16_t num_leds_;
43 const uint8_t pin_;
44 const uint8_t prescaler_;
45 const uint8_t bit0_high_bits_;
46 const uint8_t bit1_high_bits_;
47};
48
49} // namespace esphome::ln882x_spi_led_strip
50
51#endif // USE_LN882X
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.
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...
Definition light_state.h:68
This class is used to represent the capabilities of a light.
Definition light_traits.h:9
void set_max_refresh_rate(uint32_t interval_us)
Set a maximum refresh rate in µs as some lights do not like being updated too often.
Definition led_strip.h:32
LN882xSPILEDStripLightOutput(uint8_t pin, uint16_t num_leds, light::ChannelColors channel_colors, uint8_t prescaler, uint8_t bit0_high_bits, uint8_t bit1_high_bits, uint16_t reset_bytes)
The SPI encoding comes from light.py: SPI clock APB0 / 2^prescaler, the number of high SPI bits for a...
Definition led_strip.cpp:89
light::CorrectedBufferColorAccessor internal_accessor_
Definition led_strip.h:35
void write_state(light::LightState *state) override
bool state
Definition fan.h:2
static void uint32_t
Which byte of an addressable LED's data carries each colour.
LightTraits traits() const
Colour modes of a strip with this channel order.