43 lines
646 B
C
43 lines
646 B
C
/*
|
|
hackspacecon wand firmware
|
|
|
|
rgb led control and programs
|
|
*/
|
|
|
|
#ifndef __RGBLED_H__
|
|
#define __RGBLED_H__
|
|
|
|
|
|
|
|
#include <tinyNeoPixel_Static.h>
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#define RGB_COUNT 5
|
|
#define PROG_COUNT 2
|
|
|
|
|
|
|
|
#define enable_rgb_timer() {TCB0.CNT = 0; TCB0.INTFLAGS = 0xff; \
|
|
TCB0.INTCTRL = TCB_CAPT_bm; TCB0.CTRLA |= TCB_ENABLE_bm;};
|
|
#define disable_rgb_timer() {TCB0.INTCTRL = 0; TCB0.CTRLA &= ~TCB_ENABLE_bm;};
|
|
|
|
|
|
|
|
extern tinyNeoPixel rgb;
|
|
|
|
extern uint8_t rgbled[3 * RGB_COUNT];
|
|
extern uint8_t (*rgb_program[PROG_COUNT])(uint8_t);
|
|
|
|
|
|
|
|
extern volatile uint8_t rgb_run_next;
|
|
|
|
|
|
|
|
void conf_rgb_timer();
|
|
|
|
|
|
#endif
|