-
Notifications
You must be signed in to change notification settings - Fork 0
/
lcd.h
78 lines (57 loc) · 1.69 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
* module: LCD
* description: header file for LCD driver
* file name: lcd.h
* Author: Mustafa Mahmoud
*/
#ifndef LCD_H_
#define LCD_H_
#include"common_header.h"
#include"common_macros.h"
#define PORT_RS_ID PORTD_ID
#define PIN_RS_NUM PIN0_NUM
#define PORT_EN_ID PORTD_ID
#define PIN_EN_NUM PIN2_NUM
#define PORT_DATA_ID PORTC_ID
#define CLEAR_DISPLAY 0x01
#define CURSOR_OFF 0x0C
#define CURSOR_N 0x0E
#define TWO_LINES_8_BITS 0x38
#define SET_CURSOR_LOCATION 0x80
/************************************************************************
* function prototypes
*************************************************************************/
/* description:
* intialize the LCD
* Set up the pins direction and set the settings of LCD (2-lines-8bit)
*/
void LCD_Init(void);
/*description:
* fucntion to send command to the LCD
*/
void LCD_sendCommand(uint8 command);
/*description:
* fucntion to send character to the LCD
*/
void LCD_displayCharacter(uint8 command);
/*description:
* fucntion to send string to the LCD
*/
void LCD_displayString(const char* str);
/*description:
* to move the cursor to a specified row and coloumn on the screen
*/
void LCD_moveCursor(uint8 row,uint8 coloumn);
/* description:
* display the required string in the required coloumn and row
*/
void LCD_displayStringrRowColoumn(uint8 row,uint8 coloumn,uint8 * str);
/* description:
* to clear the screen
*/
void LCD_clearScreen(void);
/* description:
* to display numbers on the screen
*/
void LCD_integerTostring(uint8 value);
#endif /* LCD_H_ */