| 329 |
Kevin |
1 |
#ifndef LED_BACKPACK_H
|
|
|
2 |
#define LED_BACKPACK_H
|
|
|
3 |
|
|
|
4 |
#include "defines.h"
|
|
|
5 |
|
|
|
6 |
#define HT16K33_ADDRESS 0x70
|
|
|
7 |
|
|
|
8 |
#define HT16K33_BLINK_CMD 0x80
|
|
|
9 |
#define HT16K33_BLINK_DISPLAYON 0x01
|
|
|
10 |
#define HT16K33_BLINK_OFF 0
|
|
|
11 |
#define HT16K33_BLINK_2HZ 1
|
|
|
12 |
#define HT16K33_BLINK_1HZ 2
|
|
|
13 |
#define HT16K33_BLINK_HALFHZ 3
|
|
|
14 |
|
|
|
15 |
#define HT16K33_CMD_BRIGHTNESS 0x0E
|
|
|
16 |
|
|
|
17 |
typedef struct {
|
|
|
18 |
uint8_t i2c_address;
|
|
|
19 |
uint8_t display_buffer[17];
|
|
|
20 |
} LED_DATA;
|
|
|
21 |
|
|
|
22 |
void LED_Init(LED_DATA *data);
|
|
|
23 |
void LED_Start(void);
|
|
|
24 |
void LED_Set_Brightness(uint8_t c);
|
|
|
25 |
void LED_Blink_Rate(uint8_t c);
|
|
|
26 |
void LED_Write_Display(void);
|
|
|
27 |
void LED_Clear(void);
|
|
|
28 |
void LED_Draw_Colon(uint8_t c);
|
|
|
29 |
void LED_Write_Digit_Raw(uint8_t loc, uint8_t bitmask);
|
|
|
30 |
void LED_Write_Digit_Num(uint8_t loc, uint8_t num, uint8_t dot);
|
|
|
31 |
void LED_Write_Digit_Alpha(uint8_t loc, uint8_t alpha, uint8_t dot);
|
|
|
32 |
void LED_Write_Num(uint16_t i);
|
|
|
33 |
|
|
|
34 |
|
|
|
35 |
#endif /* LED_BACKPACK_H */
|
|
|
36 |
|