Adafruit Library
|
friend class More...
#include <ws_pixels.h>
Public Member Functions | |
~ws_pixels () | |
Destructor. | |
bool | addStrand (wippersnapper_pixels_v1_PixelsCreateRequest *pixelsCreateReqMsg) |
Initializes a strand of addressable RGB Pixels. More... | |
void | deleteStrand (wippersnapper_pixels_v1_PixelsDeleteRequest *pixelsDeleteMsg) |
Deletes a strand_t from strands , deinitializes a strand, and frees its resources. More... | |
void | fillStrand (wippersnapper_pixels_v1_PixelsWriteRequest *pixelsWriteMsg) |
Writes a color from Adafruit IO to a strand of addressable pixels. More... | |
int16_t | allocateStrand () |
Allocates an index of a free strand_t within the strand array. More... | |
void | deallocateStrand (int16_t strandIdx) |
Deallocates a strand_t within strands , provided an index. More... | |
int | getStrandIdx (int16_t pin, wippersnapper_pixels_v1_PixelsType type) |
Obtains the index of a strand_t within array of strands . More... | |
neoPixelType | getNeoPixelStrandOrder (wippersnapper_pixels_v1_PixelsOrder pixelOrder) |
Returns the neoPixelType provided the strand's pixelOrder. More... | |
uint8_t | getDotStarStrandOrder (wippersnapper_pixels_v1_PixelsOrder pixelOrder) |
Returns the color order of the DotStar strand. More... | |
void | publishAddStrandResponse (bool is_success, char *pixels_pin_data) |
Creates a PixelsResponse message and publishes it to IO. More... | |
uint32_t | getGammaCorrectedColor (uint32_t pixel_color, strand_s strand) |
Gets the gamma-corrected color, provided a pixel_color. More... | |
friend class
Class for managing and interfacing with strands of addressable RGB LED pixels.
bool ws_pixels::addStrand | ( | wippersnapper_pixels_v1_PixelsCreateRequest * | pixelsCreateReqMsg | ) |
Initializes a strand of addressable RGB Pixels.
pixelsCreateReqMsg | Pointer to strand init. request message |
void ws_pixels::deleteStrand | ( | wippersnapper_pixels_v1_PixelsDeleteRequest * | pixelsDeleteMsg | ) |
Deletes a strand_t
from strands
, deinitializes a strand, and frees its resources.
pixelsDeleteMsg | Protobuf message from Adafruit IO containing a wippersnapper_pixels_v1_PixelsDeleteRequest . |
void ws_pixels::fillStrand | ( | wippersnapper_pixels_v1_PixelsWriteRequest * | pixelsWriteMsg | ) |
Writes a color from Adafruit IO to a strand of addressable pixels.
pixelsWriteMsg | Protobuf message from Adafruit IO containing a wippersnapper_pixels_v1_PixelsWriteRequest . |
int16_t ws_pixels::allocateStrand | ( | ) |
Allocates an index of a free strand_t within the strand array.
void ws_pixels::deallocateStrand | ( | int16_t | strandIdx | ) |
Deallocates a strand_t
within strands
, provided an index.
strandIdx | The desired index of a strand_t within strands . |
int ws_pixels::getStrandIdx | ( | int16_t | dataPin, |
wippersnapper_pixels_v1_PixelsType | type | ||
) |
Obtains the index of a strand_t
within array of strands
.
dataPin | strand_t's data dataPin |
type | Type of strand_t, NeoPixel or DotStar. |
neoPixelType ws_pixels::getNeoPixelStrandOrder | ( | wippersnapper_pixels_v1_PixelsOrder | pixelOrder | ) |
Returns the neoPixelType
provided the strand's pixelOrder.
pixelOrder | Desired pixel order, from init. message. |
uint8_t ws_pixels::getDotStarStrandOrder | ( | wippersnapper_pixels_v1_PixelsOrder | pixelOrder | ) |
Returns the color order of the DotStar strand.
pixelOrder | Desired pixel order, from init. message. |
void ws_pixels::publishAddStrandResponse | ( | bool | is_success, |
char * | pixels_pin_data | ||
) |
Creates a PixelsResponse message and publishes it to IO.
is_success | True if addStrand() succeeded, False otherwise. |
pixels_pin_data | The strand's data pin.. |
uint32_t ws_pixels::getGammaCorrectedColor | ( | uint32_t | pixel_color, |
strand_s | strand | ||
) |
Gets the gamma-corrected color, provided a pixel_color.
pixel_color | Strand's color from Adafruit IO. |
strand | Desired strand struct. to access. |