24 lines
447 B
C
24 lines
447 B
C
#ifndef __LED_H__
|
|
#define __LED_H__
|
|
|
|
#include <global.h>
|
|
|
|
struct apa102_pkt {
|
|
uint8_t global;
|
|
uint8_t b; /* each channel 8 bit 0-255 */
|
|
uint8_t g;
|
|
uint8_t r;
|
|
} __attribute__((packed));
|
|
|
|
struct led_state {
|
|
uint32_t _zeros;
|
|
struct apa102_pkt led[10];
|
|
uint32_t _ones;
|
|
} __attribute__((packed));
|
|
|
|
extern struct led_state st_led;
|
|
|
|
void led_init(void);
|
|
void led_set_global_brightness(int brightness);
|
|
|
|
#endif /* __LED_H__ */
|