FastLED 3.9.15
Loading...
Searching...
No Matches

◆ calculateBytes()

template<fl::u8 DATA_PIN, fl::u8 CLOCK_PIN, EOrder RGB_ORDER = RGB, fl::u32 SPI_SPEED = DATA_RATE_MHZ(6), fl::FiveBitGammaCorrectionMode GAMMA_CORRECTION_MODE = fl::FiveBitGammaCorrectionMode::kFiveBitGammaCorrectionMode_Null, fl::u32 START_FRAME = 0x00000000, fl::u32 END_FRAME = 0xFF000000>
static constexpr size_t APA102Controller< DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_SPEED, GAMMA_CORRECTION_MODE, START_FRAME, END_FRAME >::calculateBytes ( size_t num_leds)
inlinestaticconstexpr

Calculate total byte count for APA102 protocol Used for quad-SPI buffer pre-allocation.

Parameters
num_ledsNumber of LEDs in the strip
Returns
Total bytes needed (start frame + LED data + end frame)

Definition at line 261 of file apa102.h.

261 {
262 // APA102 protocol:
263 // - Start frame: 4 bytes (0x00000000)
264 // - LED data: 4 bytes per LED (brightness + RGB)
265 // - End frame: (num_leds / 32) + 1 DWords = 4 * ((num_leds / 32) + 1) bytes
266 return 4 + (num_leds * 4) + (4 * ((num_leds / 32) + 1));
267 }
APA102 controller class.
Definition apa102.h:38