@@ -31,6 +31,20 @@ PixelsHardware::PixelsHardware() {
3131/* *************************************************************************/
3232PixelsHardware::~PixelsHardware () {}
3333
34+ /* *************************************************************************/
35+ /* !
36+ @brief Initializes a new NeoPixel strand on a desired pin.
37+ @param num_pixels
38+ Number of pixels in the strand.
39+ @param pin_data
40+ The desired data pin for the pixel strand.
41+ @param order
42+ The desired color ordering for the pixel strand.
43+ @param brightness
44+ The desired brightness of the pixel strand (0-255).
45+ @returns True if successful, False otherwise.
46+ */
47+ /* *************************************************************************/
3448bool PixelsHardware::AddNeoPixel (uint16_t num_pixels, uint16_t pin_data,
3549 neoPixelType order, uint8_t brightness) {
3650 if (getStatusNeoPixelPin () == pin_data && WsV2.lockStatusNeoPixelV2 )
@@ -50,6 +64,22 @@ bool PixelsHardware::AddNeoPixel(uint16_t num_pixels, uint16_t pin_data,
5064 return true ;
5165}
5266
67+ /* *************************************************************************/
68+ /* !
69+ @brief Initializes a new DotStar strand on a desired pin.
70+ @param num_pixels
71+ Number of pixels in the strand.
72+ @param pin_data
73+ The desired data pin for the pixel strand.
74+ @param pin_clock
75+ The desired clock pin for the pixel strand.
76+ @param order
77+ The desired color ordering for the pixel strand.
78+ @param brightness
79+ The desired brightness of the pixel strand (0-255).
80+ @returns True if successful, False otherwise.
81+ */
82+ /* *************************************************************************/
5383bool PixelsHardware::AddDotStar (uint16_t num_pixels, uint16_t pin_data,
5484 uint16_t pin_clock,
5585 wippersnapper_pixels_PixelsOrder order,
@@ -75,6 +105,24 @@ bool PixelsHardware::AddDotStar(uint16_t num_pixels, uint16_t pin_data,
75105 WS_DEBUG_PRINT (pin_clock);
76106}
77107
108+ /* *************************************************************************/
109+ /* !
110+ @brief Initializes a new pixel strand on a desired pin.
111+ @param type
112+ The desired pixel type (NeoPixel or DotStar).
113+ @param order
114+ The desired color ordering for the pixel strand.
115+ @param num_pixels
116+ Number of pixels in the strand.
117+ @param brightness
118+ The desired brightness of the pixel strand (0-255).
119+ @param pin_data
120+ The desired data pin for the pixel strand.
121+ @param pin_clock
122+ The desired clock pin for the pixel strand (for DotStar).
123+ @returns True if successful, False otherwise.
124+ */
125+ /* *************************************************************************/
78126bool PixelsHardware::AddStrand (wippersnapper_pixels_PixelsType type,
79127 wippersnapper_pixels_PixelsOrder order,
80128 uint32_t num_pixels, uint32_t brightness,
@@ -105,8 +153,6 @@ bool PixelsHardware::AddStrand(wippersnapper_pixels_PixelsType type,
105153/* *************************************************************************/
106154/* !
107155 @brief Sets the color of all pixels in the strand
108- @param pin_data
109- Data pin for the pixel strand
110156 @param color
111157 32-bit color value
112158*/
@@ -127,6 +173,14 @@ void PixelsHardware::FillStrand(uint32_t color) {
127173 }
128174}
129175
176+ /* *************************************************************************/
177+ /* !
178+ @brief Applies gamma correction to a color value to match IO Web.
179+ @param color
180+ The color value to be corrected
181+ @returns The gamma-corrected color value
182+ */
183+ /* *************************************************************************/
130184uint32_t PixelsHardware::ApplyGammaCorrection (uint32_t color) {
131185 if (_type == wippersnapper_pixels_PixelsType_PIXELS_TYPE_NEOPIXEL) {
132186 return _neopixel->gamma32 (color);
@@ -141,8 +195,6 @@ uint32_t PixelsHardware::ApplyGammaCorrection(uint32_t color) {
141195/* *************************************************************************/
142196/* !
143197 @brief Deinitializes a pixel strand
144- @param pin_data
145- Data pin for the pixel strand
146198*/
147199/* *************************************************************************/
148200void PixelsHardware::RemoveStrand () {
@@ -174,8 +226,15 @@ void PixelsHardware::RemoveStrand() {
174226/* *************************************************************************/
175227uint16_t PixelsHardware::GetPinData () { return _pin_data; }
176228
177- neoPixelType
178- PixelsHardware::GetStrandOrderNeoPixel (wippersnapper_pixels_PixelsOrder order) {
229+ /* *************************************************************************/
230+ /* !
231+ @brief Gets the color ordering for NeoPixel strands
232+ @param order
233+ The desired color ordering for the pixel strand.
234+ @returns The color ordering for NeoPixel strands
235+ */
236+ /* *************************************************************************/
237+ neoPixelType PixelsHardware::GetStrandOrderNeoPixel (wippersnapper_pixels_PixelsOrder order) {
179238 switch (order) {
180239 case wippersnapper_pixels_PixelsOrder_PIXELS_ORDER_GRB:
181240 return NEO_GRB + NEO_KHZ800;
@@ -192,8 +251,15 @@ PixelsHardware::GetStrandOrderNeoPixel(wippersnapper_pixels_PixelsOrder order) {
192251 }
193252}
194253
195- uint8_t
196- PixelsHardware::GetStrandOrderDotStar (wippersnapper_pixels_PixelsOrder order) {
254+ /* *************************************************************************/
255+ /* !
256+ @brief Gets the color ordering for DotStar strands
257+ @param order
258+ The desired color ordering for the pixel strand.
259+ @returns The color ordering for DotStar strands
260+ */
261+ /* *************************************************************************/
262+ uint8_t PixelsHardware::GetStrandOrderDotStar (wippersnapper_pixels_PixelsOrder order) {
197263 switch (order) {
198264 case wippersnapper_pixels_PixelsOrder_PIXELS_ORDER_GRB:
199265 return DOTSTAR_GRB;
0 commit comments