FastLED 3.10.6
Loading...
Searching...
No Matches
my9221.h File Reference

Detailed Description

MY9221 12-channel LED driver controller.

The MY9221 is a 12-channel constant-current LED driver with a 2-wire DI/DCKI interface. Unlike typical SPI LED chipsets, it samples data on every clock edge (dual-edge / DDR clocking), so this controller bit-bangs via FastPin rather than using FastLED's SPI abstraction.

Channel mapping (chained RGB modules such as Grove Chainable RGB LED): 12 channels = 4 RGB LEDs per chip. addLeds<MY9221, DATA, CLOCK>(leds, N) drives ceil(N/4) chained chips, padding the last chip's unused channels with zero.

Grove LED Bar (10 monochrome channels) is out of scope.

Default command word is 0x0010: 8-bit grayscale + APDM waveform. This matches a bench-verified ESP32 driver and maps natively onto 8-bit CRGB. 16-bit grayscale mode is left as future work.

Protocol per chip (208 bits): 16-bit command word, then 12 x 16-bit grayscale words in OUT3..OUT0 order (each OUT is DA/DB/DC = RGB_ORDER channels 0/1/2), then a pin-level latch.

Definition in file my9221.h.

#include "pixeltypes.h"
#include "crgb.h"
#include "eorder.h"
#include "fl/stl/noexcept.h"
#include "fl/system/fastpin.h"
#include "fl/system/delay.h"
+ Include dependency graph for my9221.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  MY9221Controller< DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_SPEED >
 MY9221 controller class. More...