11/* !
22 * @file hardware.h
33 *
4- * Hardware interface for pixel strands.
4+ * Hardware interface for NeoPixel/DotStar strands.
55 *
66 * Adafruit invests time and resources providing this open source code,
77 * please support Adafruit and open-source hardware by purchasing
1616#define WS_PIXELS_HARDWARE_H
1717#include " Wippersnapper_V2.h"
1818
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-
3319/* *************************************************************************/
3420/* !
35- @brief Interface for interacting with hardware's pixel strands.
21+ @brief Interface for interacting with NeoPixel or Dotstar
22+ pixel strands
3623*/
3724/* *************************************************************************/
3825class PixelsHardware {
@@ -46,12 +33,11 @@ class PixelsHardware {
4633 uint16_t GetPinData ();
4734 void FillStrand (uint32_t color);
4835 void RemoveStrand ();
49-
5036private:
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
5541 bool AddNeoPixel (uint16_t num_pixels, uint16_t pin_data, neoPixelType order,
5642 uint8_t brightness);
5743 bool AddDotStar (uint16_t num_pixels, uint16_t pin_data, uint16_t pin_clock,
0 commit comments