3#if defined(USE_ARDUINO) && !defined(USE_RP2) && !defined(USE_LIBRETINY)
9#define FASTLED_ESP8266_RAW_PIN_ORDER
10#define FASTLED_ESP32_RAW_PIN_ORDER
11#define FASTLED_RMT_BUILTIN_DRIVER true
14#define FASTLED_INTERNAL
31 CLEDController &
add_leds(CLEDController *controller,
int num_leds) {
34 this->
leds_ =
new CRGB[num_leds];
37 this->
leds_[i] = CRGB::Black;
42 template<ESPIChipsets CHIPSET, u
int8_t DATA_PIN, u
int8_t CLOCK_PIN, EOrder RGB_ORDER, u
int32_t SPI_DATA_RATE>
46 static LPD8806Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_DATA_RATE> controller;
47 return add_leds(&controller, num_leds);
50 static WS2801Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_DATA_RATE> controller;
51 return add_leds(&controller, num_leds);
54 static WS2803Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_DATA_RATE> controller;
55 return add_leds(&controller, num_leds);
58 static SM16716Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_DATA_RATE> controller;
59 return add_leds(&controller, num_leds);
62 static P9813Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_DATA_RATE> controller;
63 return add_leds(&controller, num_leds);
67 static APA102Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_DATA_RATE> controller;
68 return add_leds(&controller, num_leds);
71 static SK9822Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_DATA_RATE> controller;
72 return add_leds(&controller, num_leds);
77 template<ESPIChipsets CHIPSET, u
int8_t DATA_PIN, u
int8_t CLOCK_PIN> CLEDController &
add_leds(
int num_leds) {
80 static LPD8806Controller<DATA_PIN, CLOCK_PIN> controller;
81 return add_leds(&controller, num_leds);
84 static WS2801Controller<DATA_PIN, CLOCK_PIN> controller;
85 return add_leds(&controller, num_leds);
88 static WS2803Controller<DATA_PIN, CLOCK_PIN> controller;
89 return add_leds(&controller, num_leds);
92 static SM16716Controller<DATA_PIN, CLOCK_PIN> controller;
93 return add_leds(&controller, num_leds);
96 static P9813Controller<DATA_PIN, CLOCK_PIN> controller;
97 return add_leds(&controller, num_leds);
101 static APA102Controller<DATA_PIN, CLOCK_PIN> controller;
102 return add_leds(&controller, num_leds);
105 static SK9822Controller<DATA_PIN, CLOCK_PIN> controller;
106 return add_leds(&controller, num_leds);
111 template<ESPIChipsets CHIPSET, u
int8_t DATA_PIN, u
int8_t CLOCK_PIN, EOrder RGB_ORDER>
115 static LPD8806Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER> controller;
116 return add_leds(&controller, num_leds);
119 static WS2801Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER> controller;
120 return add_leds(&controller, num_leds);
123 static WS2803Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER> controller;
124 return add_leds(&controller, num_leds);
127 static SM16716Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER> controller;
128 return add_leds(&controller, num_leds);
131 static P9813Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER> controller;
132 return add_leds(&controller, num_leds);
136 static APA102Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER> controller;
137 return add_leds(&controller, num_leds);
140 static SK9822Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER> controller;
141 return add_leds(&controller, num_leds);
146 template<
template<u
int8_t DATA_PIN, EOrder RGB_ORDER>
class CHIPSET, uint8_t DATA_PIN, EOrder RGB_ORDER>
148 static CHIPSET<DATA_PIN, RGB_ORDER> controller;
149 return add_leds(&controller, num_leds);
152 template<
template<u
int8_t DATA_PIN, EOrder RGB_ORDER>
class CHIPSET, uint8_t DATA_PIN>
154 static CHIPSET<DATA_PIN, RGB> controller;
155 return add_leds(&controller, num_leds);
158 template<
template<u
int8_t DATA_PIN>
class CHIPSET, uint8_t DATA_PIN> CLEDController &
add_leds(
int num_leds) {
159 static CHIPSET<DATA_PIN> controller;
160 return add_leds(&controller, num_leds);
163 template<
template<EOrder RGB_ORDER>
class CHIPSET, EOrder RGB_ORDER> CLEDController &
add_leds(
int num_leds) {
164 static CHIPSET<RGB_ORDER> controller;
165 return add_leds(&controller, num_leds);
168 template<
template<EOrder RGB_ORDER>
class CHIPSET> CLEDController &
add_leds(
int num_leds) {
169 static CHIPSET<RGB> controller;
170 return add_leds(&controller, num_leds);
173#ifdef FASTLED_HAS_BLOCKLESS
174 template<EBlockChipsets CHIPSET,
int NUM_LANES, EOrder RGB_ORDER> CLEDController &
add_leds(
int num_leds) {
176#ifdef PORTA_FIRST_PIN
179 new InlineBlockClocklessController<NUM_LANES, PORTA_FIRST_PIN, NS(320), NS(320), NS(640), RGB_ORDER>(),
181 case WS2811_400_PORTA:
183 new InlineBlockClocklessController<NUM_LANES, PORTA_FIRST_PIN, NS(800), NS(800), NS(900), RGB_ORDER>(),
186 return add_leds(
new InlineBlockClocklessController<NUM_LANES, PORTA_FIRST_PIN, NS(320), NS(320), NS(640),
187 RGB_ORDER, 0,
false, 300>(),
191 new InlineBlockClocklessController<NUM_LANES, PORTA_FIRST_PIN, NS(700), NS(1100), NS(700), RGB_ORDER>(),
195 new InlineBlockClocklessController<NUM_LANES, PORTA_FIRST_PIN, NS(500), NS(1500), NS(500), RGB_ORDER>(),
201 template<EBlockChipsets CHIPSET,
int NUM_LANES> CLEDController &
add_leds(
int num_leds) {
213 void setup()
override;
222 nullptr,
nullptr, {offsetof(CRGB, r), offsetof(CRGB, g), offsetof(CRGB, b)}, &this->
correction_};
light::LightTraits get_traits() override
void clear_effect_data() override
void write_state(light::LightState *state) override
CLEDController & add_leds(CLEDController *controller, int num_leds)
Add some LEDS, can only be called once.
CLEDController & add_leds(int num_leds)
light::CorrectedBufferColorAccessor internal_accessor_
void dump_config() override
CLEDController * get_controller() const
Only for custom effects: Get the internal controller.
CLEDController & add_leds(int num_leds)
CLEDController & add_leds(int num_leds)
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.
CLEDController * controller_
float get_setup_priority() const override
CLEDController & add_leds(int num_leds)
int32_t size() const override
CLEDController & add_leds(int num_leds)
optional< uint32_t > max_refresh_rate_
ESPColorCorrection correction_
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...
This class is used to represent the capabilities of a light.
constexpr float HARDWARE
For components that deal with hardware and are very important like GPIO switch.