-
Notifications
You must be signed in to change notification settings - Fork 0
/
glcd.h
93 lines (86 loc) · 7.42 KB
/
glcd.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*******************************************************************************************************
* [FILE NAME] : <glcd.h> *
* [AUTHOR] : <Eslam EL-Naggar> *
* [DATE CREATED]: <JAN 1, 2020> *
* [Description} : <Header file for graphical lcd interface driver> *
******************************************************************************************************/
#ifndef GLCD_H_
#define GLCD_H_
/*-----------------------------------------------GLCD_TERMINOLIGY----------------------------------------------*/
/* RIGHT_PAGE */ /* LEFT_PAGE */
/*---------------------------------------------------COLUMNS---------------------------------------------------*/
/*0 1 2 3 4 5 .........................................63| 0 1 2 3 4 5 .........................................63*/
/*---------------------------------------------------------------------------------------------------------------*
* | *
* PAGE_0 | PAGE_0 *
* | *
* ------------------------------------------------------|-------------------------------------------------------*
* | *
* PAGE_1 | PAGE_1 *
* | *
* ------------------------------------------------------|-------------------------------------------------------*
* | *
* PAGE_2 | PAGE_2 *
* | *
* ------------------------------------------------------|-------------------------------------------------------*
* | *
* PAGE_3 | PAGE_3 *
* | *
* ------------------------------------------------------|-------------------------------------------------------*
* | *
* PAGE_4 | PAGE_4 *
* | *
* ------------------------------------------------------|-------------------------------------------------------*
* | *
* PAGE_5 | PAGE_5 *
* | *
* ------------------------------------------------------|-------------------------------------------------------*
* | *
* PAGE_6 | PAGE_6 *
* | *
* ------------------------------------------------------|-------------------------------------------------------*
* | *
* PAGE_7 | PAGE_7 *
* | *
*---------------------------------------------------------------------------------------------------------------*/
/*---------------------------------------EACH_PAGE_CONTAINS_EIGHT_BITS------------------------------------------*/
/*--------------------------------------------------------------------------------------------------------------*
* DB_0 | *
* DB_1 | *
* DB_2 | *
* DB_3 | *
* DB_4 | *
* DB_5 | *
* DB_6 | *
* DB_7 | *
* ------------------------------------------------------|-------------------------------------------------------*/
/*---------------------------------------INCLUDES-----------------------------------------------------*/
#include "micro_config.h"
#include "std_types.h"
#include "common_macros.h"
/*-------------------------------------DEFINITIONS----------------------------------------------------*/
#define GLCD_DATA_PORT PORTA /* Defines data port for GLCD data pins */
#define GLCD_DATA_PIN PINA
#define GLCD_CTRL_PORT PORTC /* Defines control port for GLCD control pins*/
#define GLCD_DATA_PORT_DIRECTION DDRA /* Defines data port for GLCD data pins */
#define GLCD_CTRL_PORT_DIRECTION DDRC /* Defines command port for GLCD control pins */
#define RS PC0 /* Defines RS pin */
#define RW PC1 /* Defines RW pin */
#define EN PC2 /* Defines EN pin */
#define CS1 PC3 /* Defines CS1 pin */
#define CS2 PC4 /* Defines CS2 pin */
#define RST PC5 /* Defines RST pin */
#define TotalPage 8
#define COLUMN_SETTING_ADDRESS 0x40
#define PAGE_SETTING_ADDRESS 0xB8
#define START_LINE_ADDRESS 0xC0
#define DISPLAY_ON 0x3F
/*------------------------------------FUNCTIONS PROTOTYPES-------------------------------------------*/
void GLCD_Init();
void GLCD_clearScreen();
void GLCD_displayImage(const char *image);
void GLCD_displayString(char page_no, char *str);
void GLCD_sendCommand(char Command);
void GLCD_sendData(char Data);
uint8 GLCD_readData();
#endif /* GLCD_H_ */