Parallel LCD library  0.5
Display driver for character LCD screens based on Hitachi HD44780 (or compatible) chipsets
lcdParallel.h
Go to the documentation of this file.
1 
17 #ifndef LCDPARALLEL_H
18 #define LCDPARALLEL_H
19 
20 #if defined(__cplusplus)
21 extern "C" {
22 #endif
23 
24 
25 // commands
26 #define LCDP_CLEARDISPLAY 0x01
27 #define LCDP_RETURNHOME 0x02
28 #define LCDP_ENTRYMODESET 0x04
29 #define LCDP_DISPLAYCONTROL 0x08
30 #define LCDP_CURSORSHIFT 0x10
31 #define LCDP_FUNCTIONSET 0x20
32 #define LCDP_SETCGRAMADDR 0x40
33 #define LCDP_SETDDRAMADDR 0x80
34 
35 // flags for display entry mode
36 #define LCDP_ENTRYRIGHT 0x00
37 #define LCDP_ENTRYLEFT 0x02
38 #define LCDP_ENTRYSHIFTINCREMENT 0x01
39 #define LCDP_ENTRYSHIFTDECREMENT 0x00
40 
41 // flags for display on/off control
42 #define LCDP_DISPLAYON 0x04
43 #define LCDP_DISPLAYOFF 0x00
44 #define LCDP_CURSORON 0x02
45 #define LCDP_CURSOROFF 0x00
46 #define LCDP_BLINKON 0x01
47 #define LCDP_BLINKOFF 0x00
48 
49 // flags for display/cursor shift
50 #define LCDP_DISPLAYMOVE 0x08
51 #define LCDP_CURSORMOVE 0x00
52 #define LCDP_MOVERIGHT 0x04
53 #define LCDP_MOVELEFT 0x00
54 
55 // flags for function set
56 #define LCDP_8BITMODE 0x10
57 #define LCDP_4BITMODE 0x00
58 #define LCDP_2LINE 0x08
59 #define LCDP_1LINE 0x00
60 #define LCDP_5x10DOTS 0x04
61 #define LCDP_5x8DOTS 0x00
62 
63 // flag for command or write
64 #define LCDP_SEND_COMMAND 0x00
65 #define LCDP_SEND_WRITE 0x01
66 
67 
72 typedef struct lcdParallel_st {
73  int _rs_pin; // LOW: command. HIGH: character.
74  int _enable_pin; // activated by a HIGH pulse.
75  int _data_pins[8];
76 
77  char _displayfunction;
78  char _displaycontrol;
79  char _displaymode;
80 
81  char _numlines;
82  char _row_offsets[4];
83 } lcdParallel_t;
84 
88 typedef lcdParallel_t lcdParallel;
89 
90 
119 lcdParallel *lcdParallel_init(char cols, char lines, char dotsize, char rs,
120  char enable, char d0, char d1, char d2, char d3);
121 
154 lcdParallel *lcdParallel_init8(char cols, char lines, char dotsize, char rs,
155  char enable, char d0, char d1, char d2, char d3,
156  char d4, char d5, char d6, char d7);
157 
166 int lcdParallel_print(lcdParallel *device, const char *fmt, ...);
167 
176 void lcdParallel_writeChar(lcdParallel *device, char value);
177 
184 void lcdParallel_clear(lcdParallel *device);
185 
192 void lcdParallel_home(lcdParallel *device);
193 
200 void lcdParallel_noDisplay(lcdParallel *device);
201 
208 void lcdParallel_display(lcdParallel *device);
209 
216 void lcdParallel_noBlink(lcdParallel *device);
217 
224 void lcdParallel_blink(lcdParallel *device);
225 
232 void lcdParallel_noCursor(lcdParallel *device);
233 
240 void lcdParallel_cursor(lcdParallel *device);
241 
248 void lcdParallel_scrollDisplayLeft(lcdParallel *device);
249 
256 void lcdParallel_scrollDisplayRight(lcdParallel *device);
257 
264 void lcdParallel_leftToRight(lcdParallel *device);
265 
272 void lcdParallel_rightToLeft(lcdParallel *device);
273 
280 void lcdParallel_autoscroll(lcdParallel *device);
281 
288 void lcdParallel_noAutoscroll(lcdParallel *device);
289 
300 void lcdParallel_createChar(lcdParallel *device, char loc, char charmap[]);
301 
312 void lcdParallel_setCursor(lcdParallel *device, char col, char row);
313 
324 void lcdParallel_send(lcdParallel *device, char value, char mode);
325 
336 void lcdParallel_write(lcdParallel *device, char value, char bits);
337 
338 #if defined(__cplusplus)
339 }
340 #endif
341 /* __cplusplus */
342 #endif
343 /* LCDPARALLEL_H */
344 
void lcdParallel_noCursor(lcdParallel *device)
Turns the cursor off.
Definition: lcdParallel_cursor.c:21
void lcdParallel_noDisplay(lcdParallel *device)
Turns the display off.
Definition: lcdParallel_display.c:20
void lcdParallel_rightToLeft(lcdParallel *device)
Causes the display to add new charaters to the left of the previous ones.
Definition: lcdParallel_direction.c:27
lcdParallel * lcdParallel_init8(char cols, char lines, char dotsize, char rs, char enable, char d0, char d1, char d2, char d3, char d4, char d5, char d6, char d7)
initialize a parallel character LCD display into 8-wire mode.
Definition: lcdParallel_init.c:47
void lcdParallel_setCursor(lcdParallel *device, char col, char row)
Sets the cursor to the specified location on the disply's screen.
Definition: lcdParallel_setCursor.c:21
void lcdParallel_scrollDisplayLeft(lcdParallel *device)
Scrolls the text on the display to the left.
Definition: lcdParallel_scroll.c:21
lcdParallel * lcdParallel_init(char cols, char lines, char dotsize, char rs, char enable, char d0, char d1, char d2, char d3)
initialize a parallel character LCD display into 4-wire mode.
Definition: lcdParallel_init.c:41
void lcdParallel_clear(lcdParallel *device)
Clears the display.
Definition: lcdParallel_clear.c:21
void lcdParallel_display(lcdParallel *device)
Turns the display on.
Definition: lcdParallel_display.c:24
int lcdParallel_print(lcdParallel *device, const char *fmt,...)
Print format "..." args to the display. The output is limited to 128 bytes.
Definition: lcdParallel_print.c:21
void lcdParallel_leftToRight(lcdParallel *device)
Causes the display to add new charaters to the right of the previous ones.
Definition: lcdParallel_direction.c:21
void lcdParallel_send(lcdParallel *device, char value, char mode)
Low-level function used to transmit data to the display.
Definition: lcdParallel_send.c:26
void lcdParallel_home(lcdParallel *device)
Sets the cursor to the Home (first column and first line) position.
Definition: lcdParallel_home.c:21
void lcdParallel_noBlink(lcdParallel *device)
Makes the cursor solid (no blinking).
Definition: lcdParallel_cursor.c:31
void lcdParallel_scrollDisplayRight(lcdParallel *device)
Scrolls the text on the display to the right.
Definition: lcdParallel_scroll.c:24
void lcdParallel_write(lcdParallel *device, char value, char bits)
Low-level function used to transmit data to the display.
Definition: lcdParallel_send.c:38
void lcdParallel_noAutoscroll(lcdParallel *device)
Causes the display 'left justify' text from the cursor.
Definition: lcdParallel_direction.c:39
void lcdParallel_autoscroll(lcdParallel *device)
Causes the display 'right justify' text from the cursor.
Definition: lcdParallel_direction.c:33
void lcdParallel_blink(lcdParallel *device)
Makes the cursor blink.
Definition: lcdParallel_cursor.c:35
void lcdParallel_cursor(lcdParallel *device)
Turns the cursor on.
Definition: lcdParallel_cursor.c:25
void lcdParallel_writeChar(lcdParallel *device, char value)
Send a single ASCII character to the display.
Definition: lcdParallel_send.c:21
void lcdParallel_createChar(lcdParallel *device, char loc, char charmap[])
Create and store a custom character in the display's CGRAM memory.
Definition: lcdParallel_createChar.c:22