-
Notifications
You must be signed in to change notification settings - Fork 0
/
hd4478.h
277 lines (195 loc) · 6.07 KB
/
hd4478.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<<<<<<< HEAD
/*
************************************************************************
Filename - hd4478.h
Author - BESEA Robotics
Data - 20-10-2008
Processor - Atmel ATmega32/16/8 and similar
Description :
HD4478 driver based display library.
User definined:
Communication
Licencja - GPL
Ostania modyfikacja -
************************************************************************
*/
#ifndef _HD4478_H_
#define _HD4478_H_
//included files
#include <avr/io.h>
#include <util/delay.h>
//data port upravit podla aktulane pouziteho
#define DATAPORT PORTB
//control port
#define CONTROLPORT PORTD
#define CONTROLPORT_RS PORTB
//lcd pins
#define LCD_PIN_RS 4
#define LCD_PIN_E 7
#define LCD_PIN_DB4 0
#define LCD_PIN_DB5 1
#define LCD_PIN_DB6 2
#define LCD_PIN_DB7 3
//lcd commands
#define LCD_CLEAR_DISPLAY 0x00
#define LCD_RETURN_HOME 0x01
#define LCD_MODE_SET 0x02
//------------------------------
#define LCD_SHIFT_ON 0x01
//display control
#define LCD_DIPLAY_CONTROL 0x03
//------------------------------
#define LCD_DISPLAY_ON 0x02
#define LCD_CURSOR_ON 0x01
#define LCD_BLINKING_ON 0x00
//shift options
#define LCD_SHIFT 0x04
//------------------------------
#define LCD_CURSOR_SHIFT 0x04
#define LCD_DISPLAY_SHIFT 0x03
#define LCD_SHIFT_LEFT 0x02
#define LCD_SHIFT_RIGHT 0x04
#define LCD_FUNCTION_SET 0x05
//------------------------------
#define LCD_4_BIT_MODE 0x05
#define LCD_2_LINES_MODE 0x03
#define LCD_1_LINE_MODE 0x05
#define LCD_CHARS_5x11 0x05
#define LCD_CHARS_5x8 0x02
#define LCD_SET_CGRAM_ADR 0x06
#define LCD_SET_DDRAM_ADR 0x07
//function controlling pin E
void LCD_E(unsigned char ucE);
//function controlling pin RS
void LCD_RS(unsigned char ucRS);
//function initializing display
void LCD_Initialize(void);
//function clear screen
void LCD_ClearScreen(void);
//functon divide byte to two 4 bit parts
void LCD_SendByte(unsigned char ucByte);
//function send command to lcd
void LCD_SendCommand(unsigned char ucCommand);
//function send char to lcd
void LCD_SendChar(unsigned char ucChar);
//function send text on visable
void LCD_SendText(unsigned char ucUpper[16], unsigned char ucLower[16]);
void LCD_SendUpper(unsigned char ucUpper[16]);
void LCD_SendLower(unsigned char ucLower[16]);
//function locate the place where text is apper
void LCD_LocateXY(unsigned char ucX,unsigned char ucY);
void LCD_ShiftRight(unsigned char Shift, unsigned char ucDelay);
void LCD_ShiftLeft(unsigned char Shift, unsigned char ucDelay);
//cursor eable
void LCD_CursorOn(void);
//curasor disable
void LCD_CursorOff(void);
//function enable cursor blinking
void LCD_CursorBlinkOn(void);
//function disable cursor blinking
void LCD_CursorBlinkOff(void);
//function sends string from flash to lcd
void LCD_DisplayString(const char *ccFlashString);
void LCD_DisplayRamString(unsigned char *ucRamString);
void LCD_DisplayUByte(unsigned char ucByte);
//function
void LCD_DisplayUInt(unsigned int uiInt);
#endif
=======
/*
************************************************************************
Filename - hd4478.h
Author - BESEA Robotics
Data - 20-10-2008
Processor - Atmel ATmega32/16/8 and similar
Description :
HD4478 driver based display library.
User definined:
Communication
Licencja - GPL
Ostania modyfikacja -
************************************************************************
*/
#ifndef _HD4478_H_
#define _HD4478_H_
//included files
#include <avr/io.h>
#include <util/delay.h>
//data port upravit podla aktulane pouziteho
#define DATAPORT PORTB
//control port
#define CONTROLPORT PORTD
#define CONTROLPORT_RS PORTB
//lcd pins
#define LCD_PIN_RS 4
#define LCD_PIN_E 7
#define LCD_PIN_DB4 0
#define LCD_PIN_DB5 1
#define LCD_PIN_DB6 2
#define LCD_PIN_DB7 3
//lcd commands
#define LCD_CLEAR_DISPLAY 0x00
#define LCD_RETURN_HOME 0x01
#define LCD_MODE_SET 0x02
//------------------------------
#define LCD_SHIFT_ON 0x01
//display control
#define LCD_DIPLAY_CONTROL 0x03
//------------------------------
#define LCD_DISPLAY_ON 0x02
#define LCD_CURSOR_ON 0x01
#define LCD_BLINKING_ON 0x00
//shift options
#define LCD_SHIFT 0x04
//------------------------------
#define LCD_CURSOR_SHIFT 0x04
#define LCD_DISPLAY_SHIFT 0x03
#define LCD_SHIFT_LEFT 0x02
#define LCD_SHIFT_RIGHT 0x04
#define LCD_FUNCTION_SET 0x05
//------------------------------
#define LCD_4_BIT_MODE 0x05
#define LCD_2_LINES_MODE 0x03
#define LCD_1_LINE_MODE 0x05
#define LCD_CHARS_5x11 0x05
#define LCD_CHARS_5x8 0x02
#define LCD_SET_CGRAM_ADR 0x06
#define LCD_SET_DDRAM_ADR 0x07
//function controlling pin E
void LCD_E(unsigned char ucE);
//function controlling pin RS
void LCD_RS(unsigned char ucRS);
//function initializing display
void LCD_Initialize(void);
//function clear screen
void LCD_ClearScreen(void);
//functon divide byte to two 4 bit parts
void LCD_SendByte(unsigned char ucByte);
//function send command to lcd
void LCD_SendCommand(unsigned char ucCommand);
//function send char to lcd
void LCD_SendChar(unsigned char ucChar);
//function send text on visable
void LCD_SendText(unsigned char ucUpper[16], unsigned char ucLower[16]);
void LCD_SendUpper(unsigned char ucUpper[16]);
void LCD_SendLower(unsigned char ucLower[16]);
//function locate the place where text is apper
void LCD_LocateXY(unsigned char ucX,unsigned char ucY);
void LCD_ShiftRight(unsigned char Shift, unsigned char ucDelay);
void LCD_ShiftLeft(unsigned char Shift, unsigned char ucDelay);
//cursor eable
void LCD_CursorOn(void);
//curasor disable
void LCD_CursorOff(void);
//function enable cursor blinking
void LCD_CursorBlinkOn(void);
//function disable cursor blinking
void LCD_CursorBlinkOff(void);
//function sends string from flash to lcd
void LCD_DisplayString(const char *ccFlashString);
void LCD_DisplayRamString(unsigned char *ucRamString);
void LCD_DisplayUByte(unsigned char ucByte);
//function
void LCD_DisplayUInt(unsigned int uiInt);
#endif
>>>>>>> origin/master