-
Notifications
You must be signed in to change notification settings - Fork 0
/
lcd.h
executable file
·32 lines (27 loc) · 881 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
#ifndef LCD_H_
#define LCD_H_
#include "std_types.h"
#include "common_macros.h"
#include "micro_config.h"
#define RS PB1
#define RW PB2
#define E PB3
#define LCD_CTRL_PORT PORTB
#define LCD_CTRL_PORT_DIR DDRB
#define LCD_DATA_PORT PORTA
#define LCD_DATA_PORT_DIR DDRA
#define CLEAR_COMMAND 0x01
#define TWO_LINE_LCD_Eight_BIT_MODE 0x38 // 0x38 for 8-bit mode 0x28 for 4-bit mode
#define SINGLE_LINE_LCD_Four_BIT_MODE 0x02
#define CURSOR_OFF 0x0C
#define CURSOR_ON 0x0E
#define SET_CURSOR_LOCATION 0x80
void LCD_sendCommand(uint8 command);
void LCD_displayCharacter(uint8 data);
void LCD_displayString(const char *Str);
void LCD_init(void);
void LCD_clearScreen(void);
void LCD_displayStringRowColumn(uint8 row,uint8 col,const char *Str);
void LCD_goToRowColumn(uint8 row,uint8 col);
void LCD_intgerToString(int data);
#endif /* LCD_H_ */