driver for WS2812B LED, modified for better compatibility with LPC812 and LPC1549

Dependencies:   BurstSPI

Dependents:   RGB-balls cylon

Fork of wsDrive by Andy A

wsDrive.h

Committer:
AndyA
Date:
2014-11-05
Revision:
0:b3665f91bedc
Child:
1:741864ea11d4

File content as of revision 0:b3665f91bedc:

#ifndef __wsDrive_h__
#define __wsDrive_h__

#include "BurstSPI.h"


typedef struct pixelInfo {
    unsigned char G;
    unsigned char R;
    unsigned char B;
} pixelInfo;


class wsDrive : private BurstSPI
{
public:
    wsDrive(PinName mosi, PinName miso, PinName clk);
    void setData(pixelInfo *dataStart, uint16_t dataLen);
    void sendData();
    
private:

    void sendByte(unsigned char value);
    void sendPixel(pixelInfo *pixToSend);
    
    pixelInfo *pixArray;
    uint16_t pixelLen;

};

#endif