5#ifndef PLATFORM_STRIPIMPL_HPP
6#define PLATFORM_STRIPIMPL_HPP
22template<
size_t LedCount, u
int8_t ChannelCount>
bool LampdaStrip<LedCount, ChannelCount>::begin(
void)
33template<
size_t LedCount, u
int8_t ChannelCount>
34void LampdaStrip<LedCount, ChannelCount>::setPixelColor(uint16_t n, uint32_t c)
38 uint8_t *p, r = (uint8_t)(c >> 16), g = (uint8_t)(c >> 8), b = (uint8_t)c;
39 if (wOffset == rOffset)
46 uint8_t w = (uint8_t)(c >> 24);
55template<
size_t LedCount, u
int8_t ChannelCount>
56uint32_t LampdaStrip<LedCount, ChannelCount>::getPixelColor(uint16_t n)
const
61 if (wOffset == rOffset)
63 uint8_t
const* p = &pixels[n * 3];
65 return ((uint32_t)p[rOffset] << 16) | ((uint32_t)p[gOffset] << 8) | (uint32_t)p[bOffset];
69 uint8_t
const* p = &pixels[n * 4];
70 return ((uint32_t)p[wOffset] << 24) | ((uint32_t)p[rOffset] << 16) | ((uint32_t)p[gOffset] << 8) |
75template<
size_t LedCount, u
int8_t ChannelCount>
bool LampdaStrip<LedCount, ChannelCount>::canShow(
void)
97 return (now - endTime) >= 300L;
100template<
size_t LedCount, u
int8_t ChannelCount>
void LampdaStrip<LedCount, ChannelCount>::updateType(
neoPixelType t)
102 wOffset = (t >> 6) & 0b11;
103 rOffset = (t >> 4) & 0b11;
104 gOffset = (t >> 2) & 0b11;
107 if (wOffset == rOffset)
109 assert(ChannelCount == 3);
113 assert(ChannelCount == 4);
117template<
size_t LedCount, u
int8_t ChannelCount>
void LampdaStrip<LedCount, ChannelCount>::setPin(int16_t p) {}
Define commonly used color spaces.
Program scope.
Definition: control_fixed_modes.hpp:12
Implement a led strip object.
uint8_t neoPixelType
3rd arg to Adafruit_NeoPixel constructor
Definition: strip_impl.h:17
Define all time related platform functions.