ws2801/ws2801.h

33 lines
632 B
C++

/*
* ws2801.h
*
* Created: 26-12-16 21:57:26
* Author: Adrien
*/
#ifndef WS2801_H_
#define WS2801_H_
#include <stdint.h>
typedef enum {RED, GREEN, BLUE} Color;
class ws2801
{
private:
uint8_t pin_clk, 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, uint8_t nbr_ci);
void conf(uint8_t pin_clk, uint8_t pin_data, uint8_t *port, uint8_t nbr_ci);
void toSend(uint8_t LEDn, uint8_t val, Color couleur);
void toSend(uint8_t LEDn, uint8_t val);
void send();
void sendRaw(uint8_t *data,uint8_t size);
};
#endif /* WS2801_H_ */