-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathHaD_Badge.h
46 lines (35 loc) · 1.21 KB
/
HaD_Badge.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <inttypes.h>
#define TOTPIXELX 8
#define TOTPIXELY 16
extern uint8_t Buffer[16];
//LED Control definitions
#define OFF 0
#define ON 1
#ifdef __cplusplus
extern "C"{
#endif
//Directions of travel
#define UP 0
#define DOWN 1
#define LEFT 2
#define RIGHT 3
//Miscellaneous
#define ESCAPE 4
#define NOINPUT 5
#define BUTTON 6
/*---- Display Prototypes ----*/
void initDisplay(void); //Turn on display and set all LEDs off
void displayClear(void); //Turn all LEDs off
void displayPixel(uint8_t x, uint8_t y, uint8_t state); //Set LED to state (ON|OFF)
void displayClose(void); //Close the display (used for SDL2 emulator window)
void displayLatch(void); //Make display changes visible (used for SDL2 emulator)
/*--------------------*/
/*---- Control Prototypes ----*/
void initControl(void); //Setup button input
uint8_t getControl(void); //Return last pressed button
void initTime(void); //Initialize timekeeping hardware
uint32_t getTime(void); //Return milliseconds (upcounting)
void controlDelayMs(uint16_t ms); //Delay milliseconds (blocking)
#ifdef __cplusplus
} // extern "C"
#endif