5#include "pixel_iterator.h"
8#include "platforms/spi_output_template.h"
25template <
int DATA_PIN, fl::u8 CLOCK_PIN, EOrder RGB_ORDER = RGB, fl::u32 SPI_SPEED = DATA_RATE_MHZ(10)>
27 typedef fl::SPIOutput<DATA_PIN, CLOCK_PIN, SPI_SPEED>
SPI;
34 mSPI.writeByte(top);
mSPI.writeByte(b);
mSPI.writeByte(g);
mSPI.writeByte(r);
39 #if defined(FL_IS_ESP32)
56 while(pixels.has(1)) {
57 writeLed(pixels.loadAndScale0(), pixels.loadAndScale1(), pixels.loadAndScale2());
59 pixels.stepDithering();
63 mSPI.endTransaction();
76 static const fl::u8 frame[] = {
100 return 4 + (num_leds * 4) + 4;
CPixelLEDController(RegistrationMode mode) FL_NO_EXCEPT
virtual void showPixels(PixelController< RGB_ORDER > &pixels) FL_NO_EXCEPT
Send the LED data to the strip.
static fl::span< const fl::u8 > getPaddingLEDFrame() FL_NO_EXCEPT
Get a black LED frame for synchronized latching Used for quad-SPI lane padding to ensure all strips l...
static constexpr fl::u8 getPaddingByte() FL_NO_EXCEPT
Get the protocol-safe padding byte for P9813 Used for quad-SPI lane padding when strips have differen...
void writeBoundary() FL_NO_EXCEPT
FASTLED_FORCE_INLINE void writeLed(fl::u8 r, fl::u8 g, fl::u8 b) FL_NO_EXCEPT
virtual void init() FL_NO_EXCEPT
Initialize the LED controller.
static constexpr size_t getPaddingLEDFrameSize() FL_NO_EXCEPT
Get the size of the padding LED frame in bytes.
P9813Controller() FL_NO_EXCEPT
static constexpr size_t calculateBytes(size_t num_leds) FL_NO_EXCEPT
Calculate total byte count for P9813 protocol Used for quad-SPI buffer pre-allocation.
fl::SPIOutput< DATA_PIN, CLOCK_PIN, SPI_SPEED > SPI
CLEDController & setSpiBus(Esp32SpiBus bus) FL_NO_EXCEPT
Select an ESP-IDF SPI host for this clocked controller before init().
fl::CLEDController CLEDController
#define FASTLED_REGISTER
Helper macro to replace the deprecated 'register' keyword if we're using modern C++ where it's been r...
#define FASTLED_FORCE_INLINE
#define FL_DISABLE_WARNING_PUSH
#define FL_DISABLE_WARNING_POP
#define FL_DISABLE_WARNING_DEPRECATED_REGISTER
Esp32SpiBus
ESP-IDF SPI host selection for an individual clocked LED controller.
Includes defintions for RGB and HSV pixels.