SLS AVR Lib 0.1a
 
Loading...
Searching...
No Matches
dm_hd44780.h File Reference

The HD44780 compatible dot-matrix liquid crystal display lib. More...

Go to the source code of this file.

Macros

#define HD44780_WAIT_INIT_MS   18
 Waiting before initialization, ms.
 
#define HD44780_EXEC_TIME_US   50
 Waiting after command, us.
 
#define HD44780_LONG_EXEC_TIME_US   1760
 Waiting after long command, us.
 
#define HD44780_ENABLE_PULSE_US   0.8
 Duration of E(enable) pulsation, us.
 
#define HD44780_WAIT_BF_LOOP_US   0
 Additional waiting in wait BF loop, us. 0 - waint only 2 x HD44780_ENABLE_PULSE_US for 8-bit IDL and 4 x HD44780_ENABLE_PULSE_US for 4-bit IDL.
 
#define HD44780_INIT_1_MS   5
 Waiting after first initialization command, ms.
 
#define HD44780_INIT_2_US   120
 Waiting after second initialization command, us.
 
#define HD44780_INIT_3_US   50
 Waiting after third initialization command, us.
 
#define HD44780_INIT_4_4_US   50
 Waiting after the fourth initialization command for a 4-bit interface, us.
 
#define HD44780_INIT_OTHER_ADD_US   10
 Waiting after other initialization command, us.
 
#define HD44780_S_OFF   0x00
 Shift disable.
 
#define HD44780_S_ON   (_BV(HD44780_S_BIT))
 Shift enable.
 
#define HD44780_ID_DEC   0x00
 Cursor decrement direction.
 
#define HD44780_ID_INC   (_BV(HD44780_ID_BIT))
 Cursor increment direction.
 
#define HD44780_B_OFF   0x00
 Blinking off.
 
#define HD44780_B_ON   (_BV(__HD44780_B_BIT))
 Blinking on.
 
#define HD44780_C_OFF   0x00
 Cursor off.
 
#define HD44780_C_ON   (_BV(__HD44780_C_BIT))
 Cursor on.
 
#define HD44780_D_OFF   0x00
 Display off.
 
#define HD44780_D_ON   (_BV(__HD44780_D_BIT))
 Display on.
 
#define HD44780_RL_LEFT   0x00
 Display shift to left.
 
#define HD44780_RL_RIGHT   (_BV(__HD44780_RL_BIT))
 Display shift to right.
 
#define HD44780_SCN_CURS   0x00
 Moves the cursor.
 
#define HD44780_SCN_DISP   (_BV(__HD44780_SCN_BIT))
 Shifts the display.
 
#define HD44780_F_NORMAL   0x00
 font 5x8
 
#define HD44780_F_BIG   (_BV(__HD44780_F_BIT))
 big font
 
#define HD44780_N_1L   0x00
 1 line
 
#define HD44780_N_2L   (_BV(__HD44780_N_BIT))
 2 line
 
#define HD44780_DL_4BIT   0x00
 half port
 
#define HD44780_DL_8BIT   (_BV(__HD44780_DL_BIT))
 full port
 
#define HD44780_ROW_1_DDRAM_ADR   __HD44780_ROW_1_DDRAM_ADR
 Default row 1 DDRAM adress.
 
#define HD44780_ROW_2_DDRAM_ADR   __HD44780_ROW_2_DDRAM_ADR
 Default row 2 DDRAM adress.
 
#define HD44780_ROW_3_DDRAM_ADR   __HD44780_ROW_3_DDRAM_ADR
 Default row 3 DDRAM adress.
 
#define HD44780_ROW_4_DDRAM_ADR   __HD44780_ROW_4_DDRAM_ADR
 Default row 4 DDRAM adress.
 
#define HD44780_ROW_3_20x4_DDRAM_ADR   __HD44780_ROW_3_20x4_DDRAM_ADR
 Row 3 DDRAM adress for 20x4 display.
 
#define HD44780_ROW_4_20x4_DDRAM_ADR   __HD44780_ROW_4_20x4_DDRAM_ADR
 Row 4 DDRAM adress for 20x4 display.
 
#define HD44780_CUSTOM_CHAR_0   0
 Custom char 0.
 
#define HD44780_CUSTOM_CHAR_1   1
 Custom char 1.
 
#define HD44780_CUSTOM_CHAR_2   2
 Custom char 2.
 
#define HD44780_CUSTOM_CHAR_3   3
 Custom char 3.
 
#define HD44780_CUSTOM_CHAR_4   4
 Custom char 4.
 
#define HD44780_CUSTOM_CHAR_5   5
 Custom char 5.
 
#define HD44780_CUSTOM_CHAR_6   6
 Custom char 6.
 
#define HD44780_CUSTOM_CHAR_7   7
 Custom char 7.
 
#define HD44780_DISPLAY_8X1   1
 LCD display 8x1.
 
#define HD44780_DISPLAY_16X1   2
 LCD display 16x1.
 
#define HD44780_DISPLAY_16X2   12
 LCD display 16x2.
 
#define HD44780_DISPLAY_20X2   13
 LCD display 20x2.
 
#define HD44780_DISPLAY_32X2   14
 LCD display 32x2.
 
#define HD44780_DISPLAY_40X2   15
 LCD display 40x2.
 
#define HD44780_DISPLAY_16X4   22
 LCD display 16x4.
 
#define HD44780_DISPLAY_20X4   23
 LCD display 20x4.
 
#define HD44780_DISPLAY_40X4   25
 LCD display 40x4.
 

Enumerations

enum  lcd_line_t { LCD_ROW_1 = 0 , LCD_ROW_2 , LCD_ROW_3 , LCD_ROW_4 }
 LCD row. More...
 
enum  lcd_display_t {
  LCD_8X1 = HD44780_DISPLAY_8X1 , LCD_16X1 = HD44780_DISPLAY_16X1 , LCD_16X2 = HD44780_DISPLAY_16X2 , LCD_20X2 = HD44780_DISPLAY_20X2 ,
  LCD_32X2 = HD44780_DISPLAY_32X2 , LCD_40X2 = HD44780_DISPLAY_40X2 , LCD_16X4 = HD44780_DISPLAY_16X4 , LCD_20X4 = HD44780_DISPLAY_20X4
}
 LCD display type. More...
 

Detailed Description

The HD44780 compatible dot-matrix liquid crystal display lib.

Author
Simon Litt simon.nosp@m.@1it.nosp@m.t.net https://coding.1itt.net, https://github.com/SimonLitt
The HD44780 compatible dot-matrix liquid crystal display lib.

Macro Definition Documentation

◆ HD44780_B_OFF

#define HD44780_B_OFF   0x00

Blinking off.

◆ HD44780_B_ON

#define HD44780_B_ON   (_BV(__HD44780_B_BIT))

Blinking on.

◆ HD44780_C_OFF

#define HD44780_C_OFF   0x00

Cursor off.

◆ HD44780_C_ON

#define HD44780_C_ON   (_BV(__HD44780_C_BIT))

Cursor on.

◆ HD44780_CUSTOM_CHAR_0

#define HD44780_CUSTOM_CHAR_0   0

Custom char 0.

◆ HD44780_CUSTOM_CHAR_1

#define HD44780_CUSTOM_CHAR_1   1

Custom char 1.

◆ HD44780_CUSTOM_CHAR_2

#define HD44780_CUSTOM_CHAR_2   2

Custom char 2.

◆ HD44780_CUSTOM_CHAR_3

#define HD44780_CUSTOM_CHAR_3   3

Custom char 3.

◆ HD44780_CUSTOM_CHAR_4

#define HD44780_CUSTOM_CHAR_4   4

Custom char 4.

◆ HD44780_CUSTOM_CHAR_5

#define HD44780_CUSTOM_CHAR_5   5

Custom char 5.

◆ HD44780_CUSTOM_CHAR_6

#define HD44780_CUSTOM_CHAR_6   6

Custom char 6.

◆ HD44780_CUSTOM_CHAR_7

#define HD44780_CUSTOM_CHAR_7   7

Custom char 7.

◆ HD44780_D_OFF

#define HD44780_D_OFF   0x00

Display off.

◆ HD44780_D_ON

#define HD44780_D_ON   (_BV(__HD44780_D_BIT))

Display on.

◆ HD44780_DISPLAY_16X1

#define HD44780_DISPLAY_16X1   2

LCD display 16x1.

◆ HD44780_DISPLAY_16X2

#define HD44780_DISPLAY_16X2   12

LCD display 16x2.

◆ HD44780_DISPLAY_16X4

#define HD44780_DISPLAY_16X4   22

LCD display 16x4.

◆ HD44780_DISPLAY_20X2

#define HD44780_DISPLAY_20X2   13

LCD display 20x2.

◆ HD44780_DISPLAY_20X4

#define HD44780_DISPLAY_20X4   23

LCD display 20x4.

◆ HD44780_DISPLAY_32X2

#define HD44780_DISPLAY_32X2   14

LCD display 32x2.

◆ HD44780_DISPLAY_40X2

#define HD44780_DISPLAY_40X2   15

LCD display 40x2.

◆ HD44780_DISPLAY_40X4

#define HD44780_DISPLAY_40X4   25

LCD display 40x4.

◆ HD44780_DISPLAY_8X1

#define HD44780_DISPLAY_8X1   1

LCD display 8x1.

◆ HD44780_DL_4BIT

#define HD44780_DL_4BIT   0x00

half port

◆ HD44780_DL_8BIT

#define HD44780_DL_8BIT   (_BV(__HD44780_DL_BIT))

full port

◆ HD44780_ENABLE_PULSE_US

#define HD44780_ENABLE_PULSE_US   0.8

Duration of E(enable) pulsation, us.

◆ HD44780_EXEC_TIME_US

#define HD44780_EXEC_TIME_US   50

Waiting after command, us.

◆ HD44780_F_BIG

#define HD44780_F_BIG   (_BV(__HD44780_F_BIT))

big font

◆ HD44780_F_NORMAL

#define HD44780_F_NORMAL   0x00

font 5x8

◆ HD44780_ID_DEC

#define HD44780_ID_DEC   0x00

Cursor decrement direction.

◆ HD44780_ID_INC

#define HD44780_ID_INC   (_BV(HD44780_ID_BIT))

Cursor increment direction.

◆ HD44780_INIT_1_MS

#define HD44780_INIT_1_MS   5

Waiting after first initialization command, ms.

◆ HD44780_INIT_2_US

#define HD44780_INIT_2_US   120

Waiting after second initialization command, us.

◆ HD44780_INIT_3_US

#define HD44780_INIT_3_US   50

Waiting after third initialization command, us.

◆ HD44780_INIT_4_4_US

#define HD44780_INIT_4_4_US   50

Waiting after the fourth initialization command for a 4-bit interface, us.

◆ HD44780_INIT_OTHER_ADD_US

#define HD44780_INIT_OTHER_ADD_US   10

Waiting after other initialization command, us.

◆ HD44780_LONG_EXEC_TIME_US

#define HD44780_LONG_EXEC_TIME_US   1760

Waiting after long command, us.

◆ HD44780_N_1L

#define HD44780_N_1L   0x00

1 line

◆ HD44780_N_2L

#define HD44780_N_2L   (_BV(__HD44780_N_BIT))

2 line

◆ HD44780_RL_LEFT

#define HD44780_RL_LEFT   0x00

Display shift to left.

◆ HD44780_RL_RIGHT

#define HD44780_RL_RIGHT   (_BV(__HD44780_RL_BIT))

Display shift to right.

◆ HD44780_ROW_1_DDRAM_ADR

#define HD44780_ROW_1_DDRAM_ADR   __HD44780_ROW_1_DDRAM_ADR

Default row 1 DDRAM adress.

◆ HD44780_ROW_2_DDRAM_ADR

#define HD44780_ROW_2_DDRAM_ADR   __HD44780_ROW_2_DDRAM_ADR

Default row 2 DDRAM adress.

◆ HD44780_ROW_3_20x4_DDRAM_ADR

#define HD44780_ROW_3_20x4_DDRAM_ADR   __HD44780_ROW_3_20x4_DDRAM_ADR

Row 3 DDRAM adress for 20x4 display.

◆ HD44780_ROW_3_DDRAM_ADR

#define HD44780_ROW_3_DDRAM_ADR   __HD44780_ROW_3_DDRAM_ADR

Default row 3 DDRAM adress.

◆ HD44780_ROW_4_20x4_DDRAM_ADR

#define HD44780_ROW_4_20x4_DDRAM_ADR   __HD44780_ROW_4_20x4_DDRAM_ADR

Row 4 DDRAM adress for 20x4 display.

◆ HD44780_ROW_4_DDRAM_ADR

#define HD44780_ROW_4_DDRAM_ADR   __HD44780_ROW_4_DDRAM_ADR

Default row 4 DDRAM adress.

◆ HD44780_S_OFF

#define HD44780_S_OFF   0x00

Shift disable.

◆ HD44780_S_ON

#define HD44780_S_ON   (_BV(HD44780_S_BIT))

Shift enable.

◆ HD44780_SCN_CURS

#define HD44780_SCN_CURS   0x00

Moves the cursor.

◆ HD44780_SCN_DISP

#define HD44780_SCN_DISP   (_BV(__HD44780_SCN_BIT))

Shifts the display.

◆ HD44780_WAIT_BF_LOOP_US

#define HD44780_WAIT_BF_LOOP_US   0

Additional waiting in wait BF loop, us. 0 - waint only 2 x HD44780_ENABLE_PULSE_US for 8-bit IDL and 4 x HD44780_ENABLE_PULSE_US for 4-bit IDL.

◆ HD44780_WAIT_INIT_MS

#define HD44780_WAIT_INIT_MS   18

Waiting before initialization, ms.

Remarks
This and other and other customizable options can be defined in compiler symbol setup with -D option (preferred) or via global or PCH header using -include option. E.g. -DHD44780_WAIT_INIT_MS=20 or -include "config.h"

Enumeration Type Documentation

◆ lcd_display_t

LCD display type.

Enumerator
LCD_8X1 

Resolution 8х1 characters.

LCD_16X1 

Resolution 16х1 characters.

LCD_16X2 

Resolution 16х2 characters.

LCD_20X2 

Resolution 20х2 characters.

LCD_32X2 

Resolution 32х2 characters.

LCD_40X2 

Resolution 40х2 characters.

LCD_16X4 

Resolution 16х4 characters.

LCD_20X4 

Resolution 20х4 characters.

◆ lcd_line_t

enum lcd_line_t

LCD row.

Enumerator
LCD_ROW_1 

1-st display row

LCD_ROW_2 

2-nd display row

LCD_ROW_3 

3-rd display row

LCD_ROW_4 

4-th display row