28#ifndef SLS_LCD_DM_HD44780_H_
29#define SLS_LCD_DM_HD44780_H_
32# if !(defined SLS_AVR_LCD_HD44780_PIN_H_)
33# error "Include <sls-avr/lcd_hd44780_pin.h> instead of this file!"
37# error "First, enable the target microcontroller header!"
44#ifndef HD44780_WAIT_INIT_MS
46# define HD44780_WAIT_INIT_MS 18
49#ifndef HD44780_EXEC_TIME_US
50# define HD44780_EXEC_TIME_US 50
53#ifndef HD44780_LONG_EXEC_TIME_US
54# define HD44780_LONG_EXEC_TIME_US 1760
57#ifndef HD44780_ENABLE_PULSE_US
58# define HD44780_ENABLE_PULSE_US 0.8
61#ifndef HD44780_WAIT_BF_LOOP_US
62# define HD44780_WAIT_BF_LOOP_US 0
65#ifndef HD44780_INIT_1_MS
66# define HD44780_INIT_1_MS 5
69#ifndef HD44780_INIT_2_US
70# define HD44780_INIT_2_US 120
73#ifndef HD44780_INIT_3_US
74# define HD44780_INIT_3_US 50
77#ifndef HD44780_INIT_4_4_US
78# define HD44780_INIT_4_4_US 50
81#ifndef HD44780_INIT_OTHER_ADD_US
82# define HD44780_INIT_OTHER_ADD_US 10
89#define _HD44780_INIT_8_1_CMD 0b00110000
90#define _HD44780_INIT_8_2_CMD 0b00110000
91#define _HD44780_INIT_8_3_CMD 0b00110000
93#define _HD44780_INIT_4_1_CMD 0b00000011
94#define _HD44780_INIT_4_2_CMD 0b00000011
95#define _HD44780_INIT_4_3_CMD 0b00000011
96#define _HD44780_INIT_4_4_CMD 0b00000010
103#define _HD44780_CLEAR 0b00000001
110#define _HD44780_HOME 0b00000010
111#define _HD44780_HOME_MASK 0b00000001
113#define __HD44780_UNUSED_HOME_0_BIT 0
114#define _HD44780_UNUSED_HOME_0_OFF 0x00
115#define _HD44780_UNUSED_HOME_0_ON (_BV(__HD44780_UNUSED_HOME_0_BIT))
122#define _HD44780_ENTRY 0b00000100
123#define _HD44780_ENTRY_MASK 0b00000011
125#define HD44780_S_BIT 0
126#define HD44780_ID_BIT 1
129#define HD44780_S_OFF 0x00
130#define HD44780_S_ON (_BV(HD44780_S_BIT))
132#define HD44780_ID_DEC 0x00
133#define HD44780_ID_INC (_BV(HD44780_ID_BIT))
139#define _HD44780_DISPLAY 0b00001000
140#define _HD44780_DISPLAY_MASK 0b00000111
142#define __HD44780_B_BIT 0
143#define __HD44780_C_BIT 1
144#define __HD44780_D_BIT 2
147#define HD44780_B_OFF 0x00
148#define HD44780_B_ON (_BV(__HD44780_B_BIT))
150#define HD44780_C_OFF 0x00
151#define HD44780_C_ON (_BV(__HD44780_C_BIT))
153#define HD44780_D_OFF 0x00
154#define HD44780_D_ON (_BV(__HD44780_D_BIT))
160#define _HD44780_CURSOR 0b00010000
161#define _HD44780_CURSOR_MASK 0b00001111
163#define __HD44780_UNUSED_CURSOR_0_BIT 0
164#define __HD44780_UNUSED_CURSOR_1_BIT 1
165#define __HD44780_RL_BIT 2
166#define __HD44780_SCN_BIT 3
168#define _HD44780_UNUSED_CURSOR_0_OFF 0x00
169#define _HD44780_UNUSED_CURSOR_0_ON (_BV(__HD44780_UNUSED_CURSOR_0_BIT))
171#define _HD44780_UNUSED_CURSOR_1_OFF 0x00
172#define _HD44780_UNUSED_CURSOR_1_ON (_BV(__HD44780_UNUSED_CURSOR_1_BIT))
175#define HD44780_RL_LEFT 0x00
176#define HD44780_RL_RIGHT (_BV(__HD44780_RL_BIT))
178#define HD44780_SCN_CURS 0x00
179#define HD44780_SCN_DISP (_BV(__HD44780_SCN_BIT))
185#define _HD44780_FUNC 0b00100000
186#define _HD44780_FUNC_MASK 0b00011111
188#define __HD44780_UNUSED_FUNC_0_BIT 0
189#define __HD44780_UNUSED_FUNC_1_BIT 1
190#define __HD44780_F_BIT 2
191#define __HD44780_N_BIT 3
192#define __HD44780_DL_BIT 4
194#define _HD44780_UNUSED_FUNC_0_OFF 0x00
195#define _HD44780_UNUSED_FUNC_0_ON (_BV(__HD44780_UNUSED_FUNC_0_BIT))
197#define _HD44780_UNUSED_FUNC_1_OFF 0x00
198#define _HD44780_UNUSED_FUNC_1_ON (_BV(__HD44780_UNUSED_FUNC_1_BIT))
201#define HD44780_F_NORMAL 0x00
202#define HD44780_F_BIG (_BV(__HD44780_F_BIT))
204#define HD44780_N_1L 0x00
205#define HD44780_N_2L (_BV(__HD44780_N_BIT))
207#define HD44780_DL_4BIT 0x00
208#define HD44780_DL_8BIT (_BV(__HD44780_DL_BIT))
215#define _HD44780_CGRAM 0b01000000
216#define _HD44780_CGRAM_MASK 0b00111111
223#define _HD44780_DDRAM 0b10000000
224#define _HD44780_DDRAM_MASK 0b01111111
228#define __HD44780_ROW_1_DDRAM_ADR 0x00
229#define __HD44780_ROW_2_DDRAM_ADR 0x40
230#define __HD44780_ROW_3_DDRAM_ADR 0x10
231#define __HD44780_ROW_4_DDRAM_ADR 0x50
233#define __HD44780_ROW_3_20x4_DDRAM_ADR 0x14
234#define __HD44780_ROW_4_20x4_DDRAM_ADR 0x54
236# ifndef HD44780_ROW_1_DDRAM_ADR
237# define HD44780_ROW_1_DDRAM_ADR __HD44780_ROW_1_DDRAM_ADR
239# ifndef HD44780_ROW_2_DDRAM_ADR
240# define HD44780_ROW_2_DDRAM_ADR __HD44780_ROW_2_DDRAM_ADR
242# ifndef HD44780_ROW_3_DDRAM_ADR
243# define HD44780_ROW_3_DDRAM_ADR __HD44780_ROW_3_DDRAM_ADR
245# ifndef HD44780_ROW_4_DDRAM_ADR
246# define HD44780_ROW_4_DDRAM_ADR __HD44780_ROW_4_DDRAM_ADR
249# ifndef HD44780_ROW_3_20x4_DDRAM_ADR
250# define HD44780_ROW_3_20x4_DDRAM_ADR __HD44780_ROW_3_20x4_DDRAM_ADR
252# ifndef HD44780_ROW_4_20x4_DDRAM_ADR
253# define HD44780_ROW_4_20x4_DDRAM_ADR __HD44780_ROW_4_20x4_DDRAM_ADR
260#define __HD44780_BF_BIT 7
261#define _HD44780_ADDR_MASK 0b01111111
266#define HD44780_CUSTOM_CHAR_0 0
267#define HD44780_CUSTOM_CHAR_1 1
268#define HD44780_CUSTOM_CHAR_2 2
269#define HD44780_CUSTOM_CHAR_3 3
270#define HD44780_CUSTOM_CHAR_4 4
271#define HD44780_CUSTOM_CHAR_5 5
272#define HD44780_CUSTOM_CHAR_6 6
273#define HD44780_CUSTOM_CHAR_7 7
284#define HD44780_DISPLAY_8X1 1
285#define HD44780_DISPLAY_16X1 2
287#define HD44780_DISPLAY_16X2 12
288#define HD44780_DISPLAY_20X2 13
289#define HD44780_DISPLAY_32X2 14
290#define HD44780_DISPLAY_40X2 15
292#define HD44780_DISPLAY_16X4 22
293#define HD44780_DISPLAY_20X4 23
294#define HD44780_DISPLAY_40X4 25
#define HD44780_DISPLAY_16X1
LCD display 16x1.
Definition dm_hd44780.h:285
#define HD44780_DISPLAY_16X2
LCD display 16x2.
Definition dm_hd44780.h:287
#define HD44780_DISPLAY_20X4
LCD display 20x4.
Definition dm_hd44780.h:293
lcd_line_t
LCD row.
Definition dm_hd44780.h:277
@ LCD_ROW_4
4-th display row
Definition dm_hd44780.h:281
@ LCD_ROW_1
1-st display row
Definition dm_hd44780.h:278
@ LCD_ROW_3
3-rd display row
Definition dm_hd44780.h:280
@ LCD_ROW_2
2-nd display row
Definition dm_hd44780.h:279
#define HD44780_DISPLAY_16X4
LCD display 16x4.
Definition dm_hd44780.h:292
lcd_display_t
LCD display type.
Definition dm_hd44780.h:297
@ LCD_32X2
Resolution 32х2 characters.
Definition dm_hd44780.h:302
@ LCD_20X2
Resolution 20х2 characters.
Definition dm_hd44780.h:301
@ LCD_8X1
Resolution 8х1 characters.
Definition dm_hd44780.h:298
@ LCD_16X2
Resolution 16х2 characters.
Definition dm_hd44780.h:300
@ LCD_16X4
Resolution 16х4 characters.
Definition dm_hd44780.h:304
@ LCD_16X1
Resolution 16х1 characters.
Definition dm_hd44780.h:299
@ LCD_40X2
Resolution 40х2 characters.
Definition dm_hd44780.h:303
@ LCD_20X4
Resolution 20х4 characters.
Definition dm_hd44780.h:305
#define HD44780_DISPLAY_32X2
LCD display 32x2.
Definition dm_hd44780.h:289
#define HD44780_DISPLAY_40X2
LCD display 40x2.
Definition dm_hd44780.h:290
#define HD44780_DISPLAY_20X2
LCD display 20x2.
Definition dm_hd44780.h:288
#define HD44780_DISPLAY_8X1
LCD display 8x1.
Definition dm_hd44780.h:284