Routines to drive a chain of APA102 Leds.
Fork of APA102 by
APA102a Class Reference
Create an APA102 Object. More...
#include <APA102a.h>
Public Member Functions | |
APA102a (PinName mosi, PinName miso, PinName sclk, int rate) | |
Create an APA102 object connected to the specified mosi,miso,sclk pins. | |
void | SetBuffer (unsigned int Buffer[], int Rows, int Cols, int Stride, int Offset, bool ZigZag, bool Wrap) |
Set the Buffer. | |
void | Repaint () |
Repaint the Strip Sends to the Buffer to the Strip. | |
unsigned int | IRGB (unsigned char I, unsigned char R, unsigned char G, unsigned char B) |
Create an IRGB helper function to construct a 4 byte LED Frame. |
Detailed Description
Create an APA102 Object.
Definition at line 11 of file APA102a.h.
Constructor & Destructor Documentation
APA102a | ( | PinName | mosi, |
PinName | miso, | ||
PinName | sclk, | ||
int | rate | ||
) |
Create an APA102 object connected to the specified mosi,miso,sclk pins.
- Parameters:
-
mosi : SPI Master Out Slave In pin miso : SPI Master In Slave Out pin (ignored) sclk : SPI Clock rate : SPI Rate
Definition at line 4 of file APA102a.cpp.
Member Function Documentation
unsigned int IRGB | ( | unsigned char | I, |
unsigned char | R, | ||
unsigned char | G, | ||
unsigned char | B | ||
) |
void Repaint | ( | ) |
Repaint the Strip Sends to the Buffer to the Strip.
- Parameters:
-
none
Definition at line 25 of file APA102a.cpp.
void SetBuffer | ( | unsigned int | Buffer[], |
int | Rows, | ||
int | Cols, | ||
int | Stride, | ||
int | Offset, | ||
bool | ZigZag, | ||
bool | Wrap | ||
) |
Set the Buffer.
- Parameters:
-
buffer[] : a buffer of unsigned integers (4 bytes) *Rows*Stride in size Rows : Number of Rows Cols : Number of Columns Stride : The actual number of columns (useful for data alignment) Offset : The offset into a row ZigZag : A boolean, do we alternate count up/ count down per row? Wrap : A boolean, do we wrap if (Offset+Cols) > Stride? (handy for scrolling messages)
Definition at line 14 of file APA102a.cpp.
Generated on Sat Jul 16 2022 21:36:05 by 1.7.2