30 lines
538 B
C++
30 lines
538 B
C++
/*
|
|
* ws2801.h
|
|
*
|
|
* Created: 26-12-16 21:57:26
|
|
* Author: Adrien
|
|
*/
|
|
|
|
|
|
#ifndef WS2801_H_
|
|
#define WS2801_H_
|
|
|
|
typedef enum {RED, GREEN, BLUE} Color;
|
|
|
|
class ws2801
|
|
{
|
|
private:
|
|
uint8_t pin_ckl, pin_data;
|
|
uint8_t *data;
|
|
uint8_t nbr_ci;
|
|
uint8_t *port, *ddr;
|
|
public:
|
|
ws2801(uint8_t pin_clk, uint8_t pin_data, uint8_t *port);
|
|
void conf(uint8_t pin_clk, uint8_t pin_data, uint8_t *port);
|
|
void toSend(uint8_t ciN, uint8_t val, Color couleur);
|
|
void send();
|
|
void senRaw(uint8_t *data,uint8_t size);
|
|
};
|
|
|
|
|
|
#endif /* WS2801_H_ */ |