13#include "is31fl3733.hpp"
14#include "is31fl3733_color_utils.hpp"
26 static constexpr uint8_t
kRows = 4;
28 static constexpr uint8_t
kCols = 16;
40 uint8_t irqPin = 0xFF, ColorOrder order = ColorOrder::GRB)
55 return row >= 1 && row <=
kRows;
62 return col >= 1 && col <=
kCols;
73 void SetPixelColor32(uint8_t row, uint8_t col, uint32_t packedRgb,
bool gamma =
false) {
78 uint32_t color = gamma ? ColorUtils::Gamma32(packedRgb) : packedRgb;
80 const uint8_t r =
static_cast<uint8_t
>((color >> 16) & 0xFF);
81 const uint8_t g =
static_cast<uint8_t
>((color >> 8) & 0xFF);
82 const uint8_t b =
static_cast<uint8_t
>(color & 0xFF);
94 void SetPixelHSV(uint8_t row, uint8_t col, uint16_t hue, uint8_t sat = 255, uint8_t val = 255,
96 uint32_t color = ColorUtils::ColorHSV(hue, sat, val);
104 for (uint8_t row = 1; row <=
kRows; row++) {
105 for (uint8_t col = 1; col <=
kCols; col++) {
116 void FillHSV(uint16_t hue, uint8_t sat = 255, uint8_t val = 255,
bool gamma =
true) {
117 const uint32_t color = ColorUtils::ColorHSV(hue, sat, val);
Convenience RGB matrix API built on top of the core async driver.
static constexpr uint8_t kRows
Logical RGB matrix row count.
void SetPixelColor32(uint8_t row, uint8_t col, uint32_t packedRgb, bool gamma=false)
Set a logical RGB pixel from packed 0xRRGGBB value.
void FillHSV(uint16_t hue, uint8_t sat=255, uint8_t val=255, bool gamma=true)
Fill logical matrix with HSV color.
void FillColor32(uint32_t packedRgb, bool gamma=false)
Fill logical matrix with packed RGB color.
IS31FL3733RgbMatrix(TwoWire *wire, uint8_t addr=0x50, uint8_t sdbPin=0xFF, uint8_t irqPin=0xFF, ColorOrder order=ColorOrder::GRB)
Construct RGB matrix helper with same arguments as base driver.
static constexpr uint8_t kCols
Logical RGB matrix column count.
void SetPixelHSV(uint8_t row, uint8_t col, uint16_t hue, uint8_t sat=255, uint8_t val=255, bool gamma=true)
Set a logical RGB pixel from HSV.
static bool IsValidCol(uint8_t col)
Validate a logical RGB column index.
void SetColorOrder(ColorOrder order)
Set the color order for RGB pixel mapping.
static bool IsValidRow(uint8_t row)
Validate a logical RGB row index.
Asynchronous DMA-driven IS31FL3733 LED driver for SAMD SERCOM I2C.
ColorOrder GetColorOrder() const
Get the current color order.
void SetPixelColor(uint8_t row, uint8_t col, uint8_t r, uint8_t g, uint8_t b)
Set RGB color for a logical pixel (with color order mapping).
void SetColorOrder(ColorOrder order)
Set the color order for RGB pixel mapping.