ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
spi_led_strip.h
Go to the documentation of this file.
1#pragma once
2
4#include "esphome/core/log.h"
7
9
10ESPHOME_LOG_TAG(TAG, "spi_led_strip");
12 public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_HIGH,
13 spi::CLOCK_PHASE_TRAILING, spi::DATA_RATE_1MHZ> {
14 public:
15 SpiLedStrip(uint16_t num_leds);
16 void setup() override;
17 float get_setup_priority() const override { return setup_priority::IO; }
18
19 int32_t size() const override { return this->num_leds_; }
20
22
23 void dump_config() override;
24
25 void write_state(light::LightState *state) override;
26
28
29 protected:
32 size_t buffer_size_{};
33 uint16_t num_leds_;
34};
35
36} // namespace esphome::spi_led_strip
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
The SPIDevice is what components using the SPI will create.
Definition spi.h:456
float get_setup_priority() const override
light::LightTraits get_traits() override
int32_t size() const override
light::CorrectedBufferColorAccessor internal_accessor_
void write_state(light::LightState *state) override
bool state
Definition fan.h:2
constexpr float IO
For components that represent GPIO pins like PCF8573.
Definition component.h:41
ESPHOME_LOG_TAG(TAG, "spi_led_strip")
static constexpr uint8_t RESERVED_WHITE
Value of w for an RGB LED strip that uses 4 bytes per led where the 4th byte is reserved.