5#include "platforms/shared/spi_pixel_writer.h"
40template <
int DATA_PIN, fl::u8 CLOCK_PIN, EOrder RGB_ORDER = GRB, fl::u32 SPI_SPEED = DATA_RATE_MHZ(25)>
42 typedef fl::SPIOutput<DATA_PIN, CLOCK_PIN, SPI_SPEED>
SPI;
47 #if defined(FL_IS_ESP32)
63 for (
int i = 0; i < 8; i++)
mSPI.writeByte(0x00);
65 while (pixels.has(1)) {
68 pixels.loadAndScaleRGB(&c0_8, &c1_8, &c2_8);
82 constexpr fl::u8 r_gain = 31, g_gain = 31, b_gain = 31;
83 constexpr fl::u8 f0 =
fl::u8(0x80 | ((r_gain & 0x1F) << 2) | ((g_gain >> 3) & 0x03));
84 constexpr fl::u8 f1 =
fl::u8(((g_gain & 0x07) << 5) | (b_gain & 0x1F));
93 pixels.stepDithering();
100 const int latch = pixels.size() / 2 + 4;
101 for (
int i = 0; i < latch; i++)
mSPI.writeByte(0xFF);
102 mSPI.endTransaction();
CPixelLEDController(RegistrationMode mode) FL_NO_EXCEPT
void showPixels(PixelController< RGB_ORDER > &pixels) FL_NO_EXCEPT override
HD108Controller() FL_NO_EXCEPT
void init() FL_NO_EXCEPT override
Initialize the LED controller.
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
defines the templated version of the CLEDController class
Serial peripheral interface (SPI) definitions per platform.
Esp32SpiBus
ESP-IDF SPI host selection for an individual clocked LED controller.
u16 gamma_2_8(u8 value) FL_NO_EXCEPT