ws2812b sample firmware.

Dependencies:   BurstSPI

Dependents:   mbed_ws2812b mbed_ws2812b

Fork of PixelArray by Jacob Bramley

Committer:
JacobBramley
Date:
Thu Jul 24 12:19:20 2014 +0000
Revision:
0:38eeab21a162
Basic (untested) NeoPixel driver.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
JacobBramley 0:38eeab21a162 1 #ifndef NEOPIXEL_SPI
JacobBramley 0:38eeab21a162 2 #define NEOPIXEL_SPI
JacobBramley 0:38eeab21a162 3
JacobBramley 0:38eeab21a162 4 #include <stdint.h>
JacobBramley 0:38eeab21a162 5 #include "mbed.h"
JacobBramley 0:38eeab21a162 6 #include "BurstSPI.h"
JacobBramley 0:38eeab21a162 7
JacobBramley 0:38eeab21a162 8 namespace neopixel {
JacobBramley 0:38eeab21a162 9
JacobBramley 0:38eeab21a162 10 struct Pixel {
JacobBramley 0:38eeab21a162 11 uint8_t red;
JacobBramley 0:38eeab21a162 12 uint8_t green;
JacobBramley 0:38eeab21a162 13 uint8_t blue;
JacobBramley 0:38eeab21a162 14 };
JacobBramley 0:38eeab21a162 15
JacobBramley 0:38eeab21a162 16 // Drive a chain of NeoPixels. The 'count' parameter specifies the length of the chain.
JacobBramley 0:38eeab21a162 17 class Array {
JacobBramley 0:38eeab21a162 18 public:
JacobBramley 0:38eeab21a162 19 Array(PinName out);
JacobBramley 0:38eeab21a162 20
JacobBramley 0:38eeab21a162 21 void Update(Pixel buffer[], size_t length);
JacobBramley 0:38eeab21a162 22
JacobBramley 0:38eeab21a162 23 private:
JacobBramley 0:38eeab21a162 24 BurstSPI spi_;
JacobBramley 0:38eeab21a162 25 };
JacobBramley 0:38eeab21a162 26
JacobBramley 0:38eeab21a162 27 }
JacobBramley 0:38eeab21a162 28
JacobBramley 0:38eeab21a162 29 #endif