@@ -31,6 +31,20 @@ PixelsHardware::PixelsHardware() {
31
31
/* *************************************************************************/
32
32
PixelsHardware::~PixelsHardware () {}
33
33
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
+ /* *************************************************************************/
34
48
bool PixelsHardware::AddNeoPixel (uint16_t num_pixels, uint16_t pin_data,
35
49
neoPixelType order, uint8_t brightness) {
36
50
if (getStatusNeoPixelPin () == pin_data && WsV2.lockStatusNeoPixelV2 )
@@ -50,6 +64,22 @@ bool PixelsHardware::AddNeoPixel(uint16_t num_pixels, uint16_t pin_data,
50
64
return true ;
51
65
}
52
66
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
+ /* *************************************************************************/
53
83
bool PixelsHardware::AddDotStar (uint16_t num_pixels, uint16_t pin_data,
54
84
uint16_t pin_clock,
55
85
wippersnapper_pixels_PixelsOrder order,
@@ -75,6 +105,24 @@ bool PixelsHardware::AddDotStar(uint16_t num_pixels, uint16_t pin_data,
75
105
WS_DEBUG_PRINT (pin_clock);
76
106
}
77
107
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
+ /* *************************************************************************/
78
126
bool PixelsHardware::AddStrand (wippersnapper_pixels_PixelsType type,
79
127
wippersnapper_pixels_PixelsOrder order,
80
128
uint32_t num_pixels, uint32_t brightness,
@@ -105,8 +153,6 @@ bool PixelsHardware::AddStrand(wippersnapper_pixels_PixelsType type,
105
153
/* *************************************************************************/
106
154
/* !
107
155
@brief Sets the color of all pixels in the strand
108
- @param pin_data
109
- Data pin for the pixel strand
110
156
@param color
111
157
32-bit color value
112
158
*/
@@ -127,6 +173,14 @@ void PixelsHardware::FillStrand(uint32_t color) {
127
173
}
128
174
}
129
175
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
+ /* *************************************************************************/
130
184
uint32_t PixelsHardware::ApplyGammaCorrection (uint32_t color) {
131
185
if (_type == wippersnapper_pixels_PixelsType_PIXELS_TYPE_NEOPIXEL) {
132
186
return _neopixel->gamma32 (color);
@@ -141,8 +195,6 @@ uint32_t PixelsHardware::ApplyGammaCorrection(uint32_t color) {
141
195
/* *************************************************************************/
142
196
/* !
143
197
@brief Deinitializes a pixel strand
144
- @param pin_data
145
- Data pin for the pixel strand
146
198
*/
147
199
/* *************************************************************************/
148
200
void PixelsHardware::RemoveStrand () {
@@ -174,8 +226,15 @@ void PixelsHardware::RemoveStrand() {
174
226
/* *************************************************************************/
175
227
uint16_t PixelsHardware::GetPinData () { return _pin_data; }
176
228
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) {
179
238
switch (order) {
180
239
case wippersnapper_pixels_PixelsOrder_PIXELS_ORDER_GRB:
181
240
return NEO_GRB + NEO_KHZ800;
@@ -192,8 +251,15 @@ PixelsHardware::GetStrandOrderNeoPixel(wippersnapper_pixels_PixelsOrder order) {
192
251
}
193
252
}
194
253
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) {
197
263
switch (order) {
198
264
case wippersnapper_pixels_PixelsOrder_PIXELS_ORDER_GRB:
199
265
return DOTSTAR_GRB;
0 commit comments