More Speeds and Color Order (#423)

This commit is contained in:
Michael Miller
2021-02-10 13:36:05 -08:00
committed by GitHub
parent 923b0e2312
commit d07f7aa0ab
8 changed files with 77 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ NeoWrgbTm1814Feature KEYWORD1
DotStarBgrFeature KEYWORD1 DotStarBgrFeature KEYWORD1
DotStarLbgrFeature KEYWORD1 DotStarLbgrFeature KEYWORD1
Lpd6803GrbFeature KEYWORD1 Lpd6803GrbFeature KEYWORD1
Lpd6803GbrFeature KEYWORD1
Lpd6803BrgFeature KEYWORD1 Lpd6803BrgFeature KEYWORD1
Lpd8806GrbFeature KEYWORD1 Lpd8806GrbFeature KEYWORD1
Lpd8806BrgFeature KEYWORD1 Lpd8806BrgFeature KEYWORD1
@@ -399,26 +400,36 @@ DotStarSpiMethod KEYWORD1
DotStarSpi20MhzMethod KEYWORD1 DotStarSpi20MhzMethod KEYWORD1
DotStarSpi10MhzMethod KEYWORD1 DotStarSpi10MhzMethod KEYWORD1
DotStarSpi2MhzMethod KEYWORD1 DotStarSpi2MhzMethod KEYWORD1
DotStarSpi1MhzMethod KEYWORD1
DotStarSpi500KhzMethod KEYWORD1
NeoWs2801Method KEYWORD1 NeoWs2801Method KEYWORD1
NeoWs2801SpiMethod KEYWORD1 NeoWs2801SpiMethod KEYWORD1
NeoWs2801Spi20MhzMethod KEYWORD1 NeoWs2801Spi20MhzMethod KEYWORD1
NeoWs2801Spi10MhzMethod KEYWORD1 NeoWs2801Spi10MhzMethod KEYWORD1
NeoWs2801Spi2MhzMethod KEYWORD1 NeoWs2801Spi2MhzMethod KEYWORD1
NeoWs2801Spi1MhzMethod KEYWORD1
NeoWs2801Spi500KhzMethod KEYWORD1
Lpd6803SpiMethod KEYWORD1 Lpd6803SpiMethod KEYWORD1
Lpd6803Method KEYWORD1 Lpd6803Method KEYWORD1
Lpd6803Spi20MhzMethod KEYWORD1 Lpd6803Spi20MhzMethod KEYWORD1
Lpd6803Spi10MhzMethod KEYWORD1 Lpd6803Spi10MhzMethod KEYWORD1
Lpd6803Spi2MhzMethod KEYWORD1 Lpd6803Spi2MhzMethod KEYWORD1
Lpd6803Spi1MhzMethod KEYWORD1
Lpd6803Spi500KhzMethod KEYWORD1
Lpd8806Method KEYWORD1 Lpd8806Method KEYWORD1
Lpd8806SpiMethod KEYWORD1 Lpd8806SpiMethod KEYWORD1
Lpd8806Spi20MhzMethod KEYWORD1 Lpd8806Spi20MhzMethod KEYWORD1
Lpd8806Spi10MhzMethod KEYWORD1 Lpd8806Spi10MhzMethod KEYWORD1
Lpd8806Spi2MhzMethod KEYWORD1 Lpd8806Spi2MhzMethod KEYWORD1
Lpd8806Spi1MhzMethod KEYWORD1
Lpd8806Spi500KhzMethod KEYWORD1
P9813Method KEYWORD1 P9813Method KEYWORD1
P9813SpiMethod KEYWORD1 P9813SpiMethod KEYWORD1
P9813Spi20MhzMethod KEYWORD1 P9813Spi20MhzMethod KEYWORD1
P9813Spi10MhzMethod KEYWORD1 P9813Spi10MhzMethod KEYWORD1
P9813Spi2MhzMethod KEYWORD1 P9813Spi2MhzMethod KEYWORD1
P9813Spi1MhzMethod KEYWORD1
P9813Spi500KhzMethod KEYWORD1
NeoPixelAnimator KEYWORD1 NeoPixelAnimator KEYWORD1
AnimUpdateCallback KEYWORD1 AnimUpdateCallback KEYWORD1
AnimationParam KEYWORD1 AnimationParam KEYWORD1

View File

@@ -128,6 +128,9 @@ typedef DotStarMethodBase<TwoWireSpiImple<SpiSpeed40Mhz>> DotStarSpi40MhzMethod;
typedef DotStarMethodBase<TwoWireSpiImple<SpiSpeed20Mhz>> DotStarSpi20MhzMethod; typedef DotStarMethodBase<TwoWireSpiImple<SpiSpeed20Mhz>> DotStarSpi20MhzMethod;
typedef DotStarMethodBase<TwoWireSpiImple<SpiSpeed10Mhz>> DotStarSpi10MhzMethod; typedef DotStarMethodBase<TwoWireSpiImple<SpiSpeed10Mhz>> DotStarSpi10MhzMethod;
typedef DotStarMethodBase<TwoWireSpiImple<SpiSpeed2Mhz>> DotStarSpi2MhzMethod; typedef DotStarMethodBase<TwoWireSpiImple<SpiSpeed2Mhz>> DotStarSpi2MhzMethod;
typedef DotStarMethodBase<TwoWireSpiImple<SpiSpeed1Mhz>> DotStarSpi1MhzMethod;
typedef DotStarMethodBase<TwoWireSpiImple<SpiSpeed500Khz>> DotStarSpi500KhzMethod;
typedef DotStarSpi10MhzMethod DotStarSpiMethod; typedef DotStarSpi10MhzMethod DotStarSpiMethod;
#endif #endif

View File

@@ -211,5 +211,47 @@ public:
} }
}; };
class Lpd6803GbrFeature : public Lpd68033Elements
{
public:
static void applyPixelColor(uint8_t* pPixels, uint16_t indexPixel, ColorObject color)
{
uint8_t* p = getPixelAddress(pPixels, indexPixel);
uint16_t color555;
encodePixel(color.G, color.B, color.R, &color555);
*p++ = color555 >> 8;
*p = color555 & 0xff;
}
static ColorObject retrievePixelColor(const uint8_t* pPixels, uint16_t indexPixel)
{
ColorObject color;
const uint8_t* p = getPixelAddress(pPixels, indexPixel);
uint16_t color555;
color555 = ((*p++) << 8);
color555 |= (*p);
decodePixel(color555, &color.G, &color.B, &color.R);
return color;
}
static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel)
{
ColorObject color;
const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel);
uint16_t color555;
color555 = (pgm_read_byte(p++) << 8);
color555 |= pgm_read_byte(p);
decodePixel(color555, &color.G, &color.B, &color.R);
return color;
}
};

View File

@@ -123,6 +123,8 @@ typedef Lpd6803MethodBase<TwoWireBitBangImple> Lpd6803Method;
typedef Lpd6803MethodBase<TwoWireSpiImple<SpiSpeed20Mhz>> Lpd6803Spi20MhzMethod; typedef Lpd6803MethodBase<TwoWireSpiImple<SpiSpeed20Mhz>> Lpd6803Spi20MhzMethod;
typedef Lpd6803MethodBase<TwoWireSpiImple<SpiSpeed10Mhz>> Lpd6803Spi10MhzMethod; typedef Lpd6803MethodBase<TwoWireSpiImple<SpiSpeed10Mhz>> Lpd6803Spi10MhzMethod;
typedef Lpd6803MethodBase<TwoWireSpiImple<SpiSpeed2Mhz>> Lpd6803Spi2MhzMethod; typedef Lpd6803MethodBase<TwoWireSpiImple<SpiSpeed2Mhz>> Lpd6803Spi2MhzMethod;
typedef Lpd6803MethodBase<TwoWireSpiImple<SpiSpeed1Mhz>> Lpd6803Spi1MhzMethod;
typedef Lpd6803MethodBase<TwoWireSpiImple<SpiSpeed500Khz>> Lpd6803Spi500KhzMethod;
typedef Lpd6803Spi10MhzMethod Lpd6803SpiMethod; typedef Lpd6803Spi10MhzMethod Lpd6803SpiMethod;
#endif #endif

View File

@@ -123,6 +123,8 @@ typedef Lpd8806MethodBase<TwoWireBitBangImple> Lpd8806Method;
typedef Lpd8806MethodBase<TwoWireSpiImple<SpiSpeed20Mhz>> Lpd8806Spi20MhzMethod; typedef Lpd8806MethodBase<TwoWireSpiImple<SpiSpeed20Mhz>> Lpd8806Spi20MhzMethod;
typedef Lpd8806MethodBase<TwoWireSpiImple<SpiSpeed10Mhz>> Lpd8806Spi10MhzMethod; typedef Lpd8806MethodBase<TwoWireSpiImple<SpiSpeed10Mhz>> Lpd8806Spi10MhzMethod;
typedef Lpd8806MethodBase<TwoWireSpiImple<SpiSpeed2Mhz>> Lpd8806Spi2MhzMethod; typedef Lpd8806MethodBase<TwoWireSpiImple<SpiSpeed2Mhz>> Lpd8806Spi2MhzMethod;
typedef Lpd8806MethodBase<TwoWireSpiImple<SpiSpeed1Mhz>> Lpd8806Spi1MhzMethod;
typedef Lpd8806MethodBase<TwoWireSpiImple<SpiSpeed500Khz>> Lpd8806Spi500KhzMethod;
typedef Lpd8806Spi10MhzMethod Lpd8806SpiMethod; typedef Lpd8806Spi10MhzMethod Lpd8806SpiMethod;
#endif #endif

View File

@@ -119,6 +119,9 @@ typedef P9813MethodBase<TwoWireBitBangImple> P9813Method;
typedef P9813MethodBase<TwoWireSpiImple<SpiSpeed20Mhz>> P9813Spi20MhzMethod; typedef P9813MethodBase<TwoWireSpiImple<SpiSpeed20Mhz>> P9813Spi20MhzMethod;
typedef P9813MethodBase<TwoWireSpiImple<SpiSpeed10Mhz>> P9813Spi10MhzMethod; typedef P9813MethodBase<TwoWireSpiImple<SpiSpeed10Mhz>> P9813Spi10MhzMethod;
typedef P9813MethodBase<TwoWireSpiImple<SpiSpeed2Mhz>> P9813Spi2MhzMethod; typedef P9813MethodBase<TwoWireSpiImple<SpiSpeed2Mhz>> P9813Spi2MhzMethod;
typedef P9813MethodBase<TwoWireSpiImple<SpiSpeed1Mhz>> P9813Spi1MhzMethod;
typedef P9813MethodBase<TwoWireSpiImple<SpiSpeed500Khz>> P9813Spi500KhzMethod;
typedef P9813Spi10MhzMethod P9813SpiMethod; typedef P9813Spi10MhzMethod P9813SpiMethod;
#endif #endif

View File

@@ -52,6 +52,18 @@ public:
static const uint32_t Clock = 2000000L; static const uint32_t Clock = 2000000L;
}; };
class SpiSpeed1Mhz
{
public:
static const uint32_t Clock = 1000000L;
};
class SpiSpeed500Khz
{
public:
static const uint32_t Clock = 500000L;
};
template<typename T_SPISPEED> class TwoWireSpiImple template<typename T_SPISPEED> class TwoWireSpiImple
{ {
public: public:

View File

@@ -125,6 +125,8 @@ typedef Ws2801MethodBase<TwoWireBitBangImple> NeoWs2801Method;
typedef Ws2801MethodBase<TwoWireSpiImple<SpiSpeed20Mhz>> NeoWs2801Spi20MhzMethod; typedef Ws2801MethodBase<TwoWireSpiImple<SpiSpeed20Mhz>> NeoWs2801Spi20MhzMethod;
typedef Ws2801MethodBase<TwoWireSpiImple<SpiSpeed10Mhz>> NeoWs2801Spi10MhzMethod; typedef Ws2801MethodBase<TwoWireSpiImple<SpiSpeed10Mhz>> NeoWs2801Spi10MhzMethod;
typedef Ws2801MethodBase<TwoWireSpiImple<SpiSpeed2Mhz>> NeoWs2801Spi2MhzMethod; typedef Ws2801MethodBase<TwoWireSpiImple<SpiSpeed2Mhz>> NeoWs2801Spi2MhzMethod;
typedef Ws2801MethodBase<TwoWireSpiImple<SpiSpeed1Mhz>> NeoWs2801Spi1MhzMethod;
typedef Ws2801MethodBase<TwoWireSpiImple<SpiSpeed500Khz>> NeoWs2801Spi500KhzMethod;
typedef NeoWs2801Spi10MhzMethod NeoWs2801SpiMethod; typedef NeoWs2801Spi10MhzMethod NeoWs2801SpiMethod;
#endif #endif