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 19 namespace fastled_base {
32 CLEDController &
add_leds(CLEDController *controller,
int num_leds) {
35 this->
leds_ =
new CRGB[num_leds];
38 this->
leds_[i] = CRGB::Black;
43 template<ESPIChipsets CHIPSET, u
int8_t DATA_PIN, u
int8_t CLOCK_PIN, EOrder RGB_ORDER, u
int32_t SPI_DATA_RATE>
47 static LPD8806Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_DATA_RATE> controller;
48 return add_leds(&controller, num_leds);
51 static WS2801Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_DATA_RATE> controller;
52 return add_leds(&controller, num_leds);
55 static WS2803Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_DATA_RATE> controller;
56 return add_leds(&controller, num_leds);
59 static SM16716Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_DATA_RATE> controller;
60 return add_leds(&controller, num_leds);
63 static P9813Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_DATA_RATE> controller;
64 return add_leds(&controller, num_leds);
68 static APA102Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_DATA_RATE> controller;
69 return add_leds(&controller, num_leds);
72 static SK9822Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_DATA_RATE> controller;
73 return add_leds(&controller, num_leds);
78 template<ESPIChipsets CHIPSET, u
int8_t DATA_PIN, u
int8_t CLOCK_PIN> CLEDController &
add_leds(
int num_leds) {
81 static LPD8806Controller<DATA_PIN, CLOCK_PIN> controller;
82 return add_leds(&controller, num_leds);
85 static WS2801Controller<DATA_PIN, CLOCK_PIN> controller;
86 return add_leds(&controller, num_leds);
89 static WS2803Controller<DATA_PIN, CLOCK_PIN> controller;
90 return add_leds(&controller, num_leds);
93 static SM16716Controller<DATA_PIN, CLOCK_PIN> controller;
94 return add_leds(&controller, num_leds);
97 static P9813Controller<DATA_PIN, CLOCK_PIN> controller;
98 return add_leds(&controller, num_leds);
102 static APA102Controller<DATA_PIN, CLOCK_PIN> controller;
103 return add_leds(&controller, num_leds);
106 static SK9822Controller<DATA_PIN, CLOCK_PIN> controller;
107 return add_leds(&controller, num_leds);
112 template<ESPIChipsets CHIPSET, u
int8_t DATA_PIN, u
int8_t CLOCK_PIN, EOrder RGB_ORDER>
116 static LPD8806Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER> controller;
117 return add_leds(&controller, num_leds);
120 static WS2801Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER> controller;
121 return add_leds(&controller, num_leds);
124 static WS2803Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER> controller;
125 return add_leds(&controller, num_leds);
128 static SM16716Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER> controller;
129 return add_leds(&controller, num_leds);
132 static P9813Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER> controller;
133 return add_leds(&controller, num_leds);
137 static APA102Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER> controller;
138 return add_leds(&controller, num_leds);
141 static SK9822Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER> controller;
142 return add_leds(&controller, num_leds);
147 #ifdef FASTLED_HAS_CLOCKLESS 148 template<
template<u
int8_t DATA_PIN, EOrder RGB_ORDER>
class CHIPSET, uint8_t DATA_PIN, EOrder RGB_ORDER>
150 static CHIPSET<DATA_PIN, RGB_ORDER> controller;
151 return add_leds(&controller, num_leds);
154 template<
template<u
int8_t DATA_PIN, EOrder RGB_ORDER>
class CHIPSET, uint8_t DATA_PIN>
156 static CHIPSET<DATA_PIN, RGB> controller;
157 return add_leds(&controller, num_leds);
160 template<
template<u
int8_t DATA_PIN>
class CHIPSET, uint8_t DATA_PIN> CLEDController &
add_leds(
int num_leds) {
161 static CHIPSET<DATA_PIN> controller;
162 return add_leds(&controller, num_leds);
166 template<
template<EOrder RGB_ORDER>
class CHIPSET, EOrder RGB_ORDER> CLEDController &
add_leds(
int num_leds) {
167 static CHIPSET<RGB_ORDER> controller;
168 return add_leds(&controller, num_leds);
171 template<
template<EOrder RGB_ORDER>
class CHIPSET> CLEDController &
add_leds(
int num_leds) {
172 static CHIPSET<RGB> controller;
173 return add_leds(&controller, num_leds);
176 #ifdef FASTLED_HAS_BLOCKLESS 177 template<EBlockChipsets CHIPSET,
int NUM_LANES, EOrder RGB_ORDER> CLEDController &
add_leds(
int num_leds) {
179 #ifdef PORTA_FIRST_PIN 182 new InlineBlockClocklessController<NUM_LANES, PORTA_FIRST_PIN, NS(320), NS(320), NS(640), RGB_ORDER>(),
184 case WS2811_400_PORTA:
186 new InlineBlockClocklessController<NUM_LANES, PORTA_FIRST_PIN, NS(800), NS(800), NS(900), RGB_ORDER>(),
189 return add_leds(
new InlineBlockClocklessController<NUM_LANES, PORTA_FIRST_PIN, NS(320), NS(320), NS(640),
190 RGB_ORDER, 0,
false, 300>(),
194 new InlineBlockClocklessController<NUM_LANES, PORTA_FIRST_PIN, NS(700), NS(1100), NS(700), RGB_ORDER>(),
198 new InlineBlockClocklessController<NUM_LANES, PORTA_FIRST_PIN, NS(500), NS(1500), NS(500), RGB_ORDER>(),
204 template<EBlockChipsets CHIPSET,
int NUM_LANES> CLEDController &
add_leds(
int num_leds) {
205 return add_leds<CHIPSET, NUM_LANES, GRB>(num_leds);
216 void setup()
override;
222 for (
int i = 0; i < this->
size(); i++)
228 return {&this->
leds_[index].r, &this->
leds_[index].g, &this->
leds_[index].b,
nullptr,
243 #endif // USE_ARDUINO CLEDController & add_leds(CLEDController *controller, int num_leds)
Add some LEDS, can only be called once.
CLEDController & add_leds(int num_leds)
This class represents the communication layer between the front-end MQTT layer and the hardware outpu...
CLEDController * controller_
CLEDController & add_leds(int num_leds)
CLEDController & add_leds(int num_leds)
CLEDController & add_leds(int num_leds)
float get_setup_priority() const override
CLEDController & add_leds(int num_leds)
light::LightTraits get_traits() override
This class is used to represent the capabilities of a light.
CLEDController * get_controller() const
Only for custom effects: Get the internal controller.
void dump_config() override
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
light::ESPColorView get_view_internal(int32_t index) const override
ESPColorCorrection correction_
optional< uint32_t > max_refresh_rate_
int32_t size() const override
Implementation of SPI Controller mode.
Color can be controlled using RGB format (includes a brightness control for the color).
void clear_effect_data() override
void write_state(light::LightState *state) override
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.