|
44 | 44 | /*! |
45 | 45 | @brief DotStar constructor for hardware SPI. Must be connected to |
46 | 46 | MOSI, SCK pins. |
47 | | - @param n Number of DotStars in strand. |
48 | | - @param o Pixel type -- one of the DOTSTAR_* constants defined in |
49 | | - Adafruit_DotStar.h, for example DOTSTAR_BRG for DotStars |
50 | | - expecting color bytes expressed in blue, red, green order |
51 | | - per pixel. Default if unspecified is DOTSTAR_BRG. |
| 47 | + @param n Number of DotStars in strand. |
| 48 | + @param o Pixel type -- one of the DOTSTAR_* constants defined in |
| 49 | + Adafruit_DotStar.h, for example DOTSTAR_BRG for DotStars |
| 50 | + expecting color bytes expressed in blue, red, green order |
| 51 | + per pixel. Default if unspecified is DOTSTAR_BRG. |
| 52 | + @param spi Pointer to hardware SPIClass object (default is primary |
| 53 | + SPI device 'SPI' if defined, else MUST pass in device). |
52 | 54 | @return Adafruit_DotStar object. Call the begin() function before use. |
53 | 55 | */ |
54 | | -Adafruit_DotStar::Adafruit_DotStar(uint16_t n, uint8_t o) |
| 56 | +Adafruit_DotStar::Adafruit_DotStar(uint16_t n, uint8_t o, SPIClass *spi) |
55 | 57 | : numLEDs(n), brightness(0), pixels(NULL), rOffset(o & 3), |
56 | 58 | gOffset((o >> 2) & 3), bOffset((o >> 4) & 3) { |
57 | | - spi_dev = new Adafruit_SPIDevice(-1, 8000000); |
| 59 | + spi_dev = new Adafruit_SPIDevice(-1, 8000000, SPI_BITORDER_MSBFIRST, |
| 60 | + SPI_MODE0, spi); |
58 | 61 | updateLength(n); |
59 | 62 | } |
60 | 63 |
|
|
0 commit comments