1
1
/* !
2
2
* @file hardware.h
3
3
*
4
- * Hardware interface for pixel strands.
4
+ * Hardware interface for NeoPixel/DotStar strands.
5
5
*
6
6
* Adafruit invests time and resources providing this open source code,
7
7
* please support Adafruit and open-source hardware by purchasing
16
16
#define WS_PIXELS_HARDWARE_H
17
17
#include " Wippersnapper_V2.h"
18
18
19
- // TODO: Do we need this?
20
- /* *
21
- * @struct PixelStrand
22
- * @brief This struct represents a NeoPixel or DotStar strand.
23
- */
24
- struct PixelStrand {
25
- uint8_t pin_data; // /< Data pin
26
- uint8_t pin_clock; // /< Clock pin (for DotStar)
27
- wippersnapper_pixels_PixelsType type; // /< Pixel type
28
- wippersnapper_pixels_PixelsOrder order; // /< Color ordering
29
- uint32_t num_pixels; // /< Number of pixels
30
- uint32_t brightness; // /< Current brightness (0-255)
31
- };
32
-
33
19
/* *************************************************************************/
34
20
/* !
35
- @brief Interface for interacting with hardware's pixel strands.
21
+ @brief Interface for interacting with NeoPixel or Dotstar
22
+ pixel strands
36
23
*/
37
24
/* *************************************************************************/
38
25
class PixelsHardware {
@@ -46,12 +33,11 @@ class PixelsHardware {
46
33
uint16_t GetPinData ();
47
34
void FillStrand (uint32_t color);
48
35
void RemoveStrand ();
49
-
50
36
private:
51
- Adafruit_NeoPixel *_neopixel = nullptr ; // /< Used for NeoPixel pixel strands
52
- Adafruit_DotStar *_dotstar = nullptr ; // /< Used for DotStar pixel strands
53
- wippersnapper_pixels_PixelsType _type;
54
- uint16_t _pin_data; // /< Data pin for the pixel strand
37
+ Adafruit_NeoPixel *_neopixel = nullptr ; // /< Used for NeoPixel strands
38
+ Adafruit_DotStar *_dotstar = nullptr ; // /< Used for DotStar strands
39
+ wippersnapper_pixels_PixelsType _type; // /< Holds the type of strand
40
+ uint16_t _pin_data; // /< Data pin for the strand
55
41
bool AddNeoPixel (uint16_t num_pixels, uint16_t pin_data, neoPixelType order,
56
42
uint8_t brightness);
57
43
bool AddDotStar (uint16_t num_pixels, uint16_t pin_data, uint16_t pin_clock,
0 commit comments