LCD HD44780 driver library
v1.0.3
Main Page
Modules
Data Structures
Files
File List
Globals
src
lcd_hd44780_config.h
Go to the documentation of this file.
1
13
#ifndef _LCD_HD44780_CONFIG_H_
14
#define _LCD_HD44780_CONFIG_H_
15
16
#ifdef __cplusplus
17
extern
"C"
18
{
19
#endif
/* __cplusplus */
20
21
// clang-format off
22
#define ON 1
23
#define OFF 0
24
#define HIGH 1
25
#define LOW 0
26
27
/************************************ LCD HARDWARE SETTINGS *******************************
28
* LCD_TYPE -> Set one of the predefined types:
29
* 2004 -> 4 lines 20 characters per line
30
* 1604 -> 4 lines 16 characters per line
31
* 1602 -> 2 lines 16 characters per line
32
* USE_RW_PIN -> Defines HW connection between LCD and uC
33
* ON - when the RW pin is connected
34
* OFF - when the RW pin is not connected
35
* LCD_BCKL_PIN_EN_STATE -> Defines active state for enabling LCD backlight
36
* HIGH - a high state on the output pin is required to enable the LCD backlight
37
* LOW - a low state on the output pin is required to enable the LCD backlight
38
* LCD_BUFFERING -> Defines whether you would like to use LCD buffer or only use functions to print directly on LCD screen
39
* ON - when buffering of LCD is planned to be used in the project
40
* OFF - when buffering of LCD is NOT planned to be used in the project
41
********************************************************************************************/
42
43
#define LCD_TYPE 1602
// init
44
#define USE_RW_PIN OFF
// compilation
45
46
#define LCD_BCKL_PIN_EN_STATE HIGH
// init
47
48
#define LCD_BUFFERING ON
// compilation
49
50
/******************************** LCD LIBRARY COMPILATION SETTINGS ************************
51
* Setting USE_(procedure name) to:
52
* ON - add specific procedure to compilation
53
* OFF - exclude specific procedure from compilation
54
********************************************************************************************/
55
#define USE_DEF_CHAR_FUNCTION ON
56
#define USE_LCD_INT ON
57
#define USE_LCD_HEX ON
58
#define USE_LCD_BIN ON
59
60
#define USE_LCD_CURSOR_HOME ON
61
#define USE_LCD_CURSOR_ON ON
62
#define USE_LCD_CURSOR_OFF ON
63
#define USE_LCD_BLINKING_CURSOR_ON ON
64
65
#if LCD_BUFFERING == ON
66
#define USE_LCD_BUF_INT ON
67
#define USE_LCD_BUF_HEX ON
68
#define USE_LCD_BUF_BIN ON
69
#endif
70
71
72
/******************** definitions of Line address for different LCD screens ****************/
73
//https://web.alfredstate.edu/faculty/weimandn/lcd/lcd_addressing/lcd_addressing_index.html
74
75
#if LCD_TYPE ==1604
76
#define LCD_Y 4
77
#define LCD_X 16
78
#define LCD_LINE1_ADR 0x00
79
#define LCD_LINE2_ADR 0x40
80
#define LCD_LINE3_ADR 0x10
81
#define LCD_LINE4_ADR 0x50
82
#endif
83
84
#if LCD_TYPE==2004
85
#define LCD_Y 4
86
#define LCD_X 20
87
#define LCD_LINE1_ADR 0x00
88
#define LCD_LINE2_ADR 0x40
89
#define LCD_LINE3_ADR 0x14
90
#define LCD_LINE4_ADR 0x54
91
#endif
92
93
#if LCD_TYPE==1602
94
#define LCD_Y 2
95
#define LCD_X 16
96
#define LCD_LINE1_ADR 0x00
97
#define LCD_LINE2_ADR 0x40
98
#endif
99
100
#if LCD_TYPE==2002
101
#define LCD_Y 2
102
#define LCD_X 20
103
#define LCD_LINE1_ADR 0x00
104
#define LCD_LINE2_ADR 0x40
105
#endif
106
107
#if LCD_TYPE==802
108
#define LCD_Y 2
109
#define LCD_X 8
110
#define LCD_LINE1_ADR 0x00
111
#define LCD_LINE2_ADR 0x40
112
#endif
113
114
#if LCD_TYPE==801
115
#define LCD_Y 1
116
#define LCD_X 8
117
#define LCD_LINE1_ADR 0x00
118
#endif
119
120
// clang-format on
121
122
#ifdef __cplusplus
123
}
124
#endif
/* __cplusplus */
125
#endif
/* _LCD_HD44780_CONFIG_H_ */
Generated by
1.9.5