-
Notifications
You must be signed in to change notification settings - Fork 2
/
lcd.h
39 lines (33 loc) · 802 Bytes
/
lcd.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
#define LCD_REG_CMD 0
#define LCD_REG_KEY_LO 1
#define LCD_REG_KEY_HI 2
#define LCD_CMD_CURSOR_OFF 4
#define LCD_CMD_CURSOR_ON 5
#define LCD_CMD_CLEAR_SCR 12
#define LCD_CMD_BACKLIGHT_ON 19
#define LCD_CMD_BACKLIGHT_OFF 20
#define LCD_CMD_CURSOR_LOC 3
#define LCD_CMD_CR 13
#define I2C_LCD_ADDR (0xC6 >> 1)
struct window {
byte line;
byte offset;
byte length;
byte start;
char *text;
};
extern struct window scrollWindow;
char decodeKey(int code);
void cls();
void cursorOn();
void cursorOff();
void cmd(byte code);
char readKey();
void at(byte x,byte y);
void writeAt(byte x,byte y, const char *buf);
void writeAt_P(byte x,byte y,PGM_P buf);
void fmt2Digits(char *buf,int num);
void fmt2XDigits(char *buf,int num);
void scroll();
void write(const char *buf);
void write_P(PGM_P buf);