Testing WS2801

Dependencies:   mbed

Fork of ws2801 by Thomas Olsson

ws2801.h

Committer:
wertyfrog
Date:
2011-06-14
Revision:
0:b964d673c7db
Child:
1:363dd100d793

File content as of revision 0:b964d673c7db:

#ifndef WS2801_H
#define WS2801_H

#include "mbed.h"
#include "HTML_color.h"

class ws2801 
{
public:
    /** Create a new ws2801 object
    * 
    * More details about the function goes here
    * and here
    *
    * @param CKI clock pin
    * @param SDI data  pin
    * @param STRIP_LENGTH number of ws2801 IC's i strip or array
    * @param reset_delay delay in us to allow latching data
    * @returns nothing   
    */
    ws2801(PinName CKI, PinName SDI, int STRIP_LENGTH = 32, int reset_delay = 800);
    /** write RGB color data to strip or array
    * 
    * More details about the function goes here
    * and here
    *
    * @param strip_colors array of color data, size must be 24xSTRIP_LENGHT bits
    */
    void post(int *strip_colors);
    /** clears the array or strip (all off)
    * 
    * More details about the function goes here
    * and here
    *
    */    
    void clear(void);
    /** dimms the entire array
    * 
    * More details about the function goes here
    * and here
    *
    * @param level level in percent
    * @returns current level
    */
    int setlevel(int level=100);
    /** set reset/write delay
    * 
    * More details about the function goes here
    * and here
    *
    * @param delay delay in us
    * @returns delay in us
    */    
    int setdelay(int reset_delay=800);
  
private:  
    DigitalOut _CKI;
    DigitalOut _SDI;
    int _STRIP_LENGTH;
    int _level;
    int _reset_delay;
};

#endif