The dot-matrix liquid crystal display lib for HD44780 compatible controller, connected by 6, 7, 10 or 11 pins. More...
Go to the source code of this file.
Data Structures | |
| struct | lcd_init_t |
| Initialization information. More... | |
Macros | |
| #define | LCD_HD44780_PIN_SINGLE_SOME_CODE 0 |
| This allows for the same code to be achieved with the macro LCD_HD44780_PIN_MULTI_MODE on and off. | |
| #define | LCD_HD44780_PIN_MULTI_MODE 0 |
| Multidisplay display mode. | |
| #define | LCD_HD44780_PIN_DISPLAY_TYPE |
| Display type. | |
| #define | HD44780_INIT_IDL_4BIT 0x00 |
| Initialization with 4-bit interface data length. Ignored for single display mode. | |
| #define | HD44780_INIT_IDL_8BIT (_BV(__HD44780_INIT_IDL_BIT)) |
| Initialization with 8-bit interface data length. Ignored for single display mode. | |
| #define | HD44780_INIT_READ_OFF 0x00 |
| Initialization without controller read support. Ignored for single display mode. | |
| #define | HD44780_INIT_READ_ON (_BV(__HD44780_INIT_READ_BIT)) |
| Initialization with controller read support. Ignored for single display mode. | |
| #define | HD44780_INIT_MOV_DIR_DEC 0x00 |
| Initialization with cursor moving direction decrement. | |
| #define | HD44780_INIT_MOV_DIR_INC (_BV(__HD44780_INIT_MOV_DIR_BIT)) |
| Initialization with cursor moving direction increment. | |
| #define | HD44780_INIT_SHIFT_OFF 0x00 |
| Initialization with shift disabled. | |
| #define | HD44780_INIT_SHIFT_ON (_BV(__HD44780_INIT_SHIFT_BIT)) |
| Initialization with shift enabled. | |
| #define | HD44780_INIT_BLINKING_OFF 0x00 |
| Initialization with the blinking off. | |
| #define | HD44780_INIT_BLINKING_ON (_BV(__HD44780_INIT_BLINKING_BIT)) |
| Initialization with the blinking on. | |
| #define | HD44780_INIT_CURSOR_OFF 0x00 |
| Initialization with the cursor off. | |
| #define | HD44780_INIT_CURSOR_ON (_BV(__HD44780_INIT_CURSOR_BIT)) |
| Initialization with the cursor on. | |
| #define | HD44780_INIT_FONT_NORMAL 0x00 |
| Initialization with normal(5x8) font. | |
| #define | HD44780_INIT_FONT_BIG (_BV(__HD44780_INIT_FONT_BIT)) |
| Initialization with the big font. | |
| #define | HD44780_INIT_DISP_OFF 0x00 |
| Initialization with the display off. | |
| #define | HD44780_INIT_DISP_ON (_BV(__HD44780_INIT_DISP_BIT)) |
| Initialization with the display on. | |
Typedefs | |
| typedef volatile lcd_info_struct | lcd_info_t |
| Information to distinguish a specific display from several connected ones. | |
Functions | |
| lcd_info_t | lcd_init (const lcd_init_t *const config) |
| Initializes the display. | |
| void | lcd_clear (const lcd_info_t *const info) |
| Clears the display. | |
| void | lcd_home (const lcd_info_t *const info, const uint8_t flags) |
| Sets DDRAM address 0 in a ddress counter. | |
| void | lcd_entry_mode (const lcd_info_t *const info, const uint8_t flags) |
| Sets cursor move direction and specifies display shift. | |
| void | lcd_display_ctrl (const lcd_info_t *const info, const uint8_t flags) |
| Sets diplay options. | |
| void | lcd_cursor (const lcd_info_t *const info, const uint8_t flags) |
| Moves the cursor or shifts the display. | |
| void | lcd_func_set (const lcd_info_t *const info, const uint8_t flags) |
| Sets options. | |
| void | lcd_cgr_adr (const lcd_info_t *const info, const uint8_t flags) |
| Sets CGRAM address. | |
| void | lcd_ddr_adr (const lcd_info_t *const info, const uint8_t flags) |
| Sets DDRAM address. | |
| void | lcd_set_pos (const lcd_info_t *const info, const lcd_line_t line, const uint8_t pos) |
| Sets DDRAM address to a given position. | |
| void | lcd_byte (const lcd_info_t *const info, const byte_t ch) |
| Outputs a symbol. | |
| void | lcd_line (const lcd_info_t *const info, const char str[], const lcd_line_t line, const uint8_t start_pos) |
| Outputs a string on entry line. | |
| void | lcd_print (const lcd_info_t *const info, const char str[]) |
| Outputs a string to buffer. | |
| void | lcd_refresh_ml (const lcd_info_t *const info, const char str[]) |
| Outputs a string on all lines. | |
| void | lcd_custom_char (const lcd_info_t *const info, const byte_t char_pos, const byte_t custom_char[8]) |
| Creates a custom symbol. | |
| byte_t | lcd_read_busy_and_addr (const lcd_info_t *const info) |
| Waits until display is buisy and returns address counter contents. | |
| byte_t | lcd_read_data (const lcd_info_t *const info) |
| Reads data from CGRAM or from DDRAM. | |
| void | lcd_clear (void) |
| Clears the display. | |
| void | lcd_home (const uint8_t flags) |
| Sets DDRAM address 0 in a ddress counter. | |
| void | lcd_entry_mode (const uint8_t flags) |
| Sets cursor move direction and specifies display shift. | |
| void | lcd_display_ctrl (const uint8_t flags) |
| Sets diplay options. | |
| void | lcd_cursor (const uint8_t flags) |
| Moves the cursor or shifts the display. | |
| void | lcd_func_set (const uint8_t flags) |
| Sets options. | |
| void | lcd_cgr_adr (const uint8_t flags) |
| Sets CGRAM address. | |
| void | lcd_ddr_adr (const uint8_t flags) |
| Sets DDRAM address. | |
| void | lcd_set_pos (const lcd_line_t line, const uint8_t pos) |
| Sets DDRAM address to a given position. | |
| void | lcd_byte (const byte_t ch) |
| Outputs a symbol. | |
| void | lcd_line (const char str[], const lcd_line_t line, const uint8_t start_pos) |
| Outputs a string on entry line. | |
| void | lcd_print (const char str[]) |
| Outputs a string to buffer. | |
| void | lcd_refresh_ml (const char str[]) |
| Outputs a string on all lines. | |
| byte_t | lcd_read_busy_and_addr () |
| Waits until display is buisy and returns address counter contents. | |
| byte_t | lcd_read_data () |
| Reads data from CGRAM or from DDRAM. | |
The dot-matrix liquid crystal display lib for HD44780 compatible controller, connected by 6, 7, 10 or 11 pins.
For a 4-bit interface, the data bus connection pins should be connected in series; for an 8-bit interface, the data bus should occupy the entire port. The remaining 2 or 3 pins can be selected separately.
| #define HD44780_INIT_BLINKING_OFF 0x00 |
Initialization with the blinking off.
| #define HD44780_INIT_BLINKING_ON (_BV(__HD44780_INIT_BLINKING_BIT)) |
Initialization with the blinking on.
| #define HD44780_INIT_CURSOR_OFF 0x00 |
Initialization with the cursor off.
| #define HD44780_INIT_CURSOR_ON (_BV(__HD44780_INIT_CURSOR_BIT)) |
Initialization with the cursor on.
| #define HD44780_INIT_DISP_OFF 0x00 |
Initialization with the display off.
| #define HD44780_INIT_DISP_ON (_BV(__HD44780_INIT_DISP_BIT)) |
Initialization with the display on.
| #define HD44780_INIT_FONT_BIG (_BV(__HD44780_INIT_FONT_BIT)) |
Initialization with the big font.
| #define HD44780_INIT_FONT_NORMAL 0x00 |
Initialization with normal(5x8) font.
| #define HD44780_INIT_IDL_4BIT 0x00 |
Initialization with 4-bit interface data length. Ignored for single display mode.
| #define HD44780_INIT_IDL_8BIT (_BV(__HD44780_INIT_IDL_BIT)) |
Initialization with 8-bit interface data length. Ignored for single display mode.
| #define HD44780_INIT_MOV_DIR_DEC 0x00 |
Initialization with cursor moving direction decrement.
| #define HD44780_INIT_MOV_DIR_INC (_BV(__HD44780_INIT_MOV_DIR_BIT)) |
Initialization with cursor moving direction increment.
| #define HD44780_INIT_READ_OFF 0x00 |
Initialization without controller read support. Ignored for single display mode.
| #define HD44780_INIT_READ_ON (_BV(__HD44780_INIT_READ_BIT)) |
Initialization with controller read support. Ignored for single display mode.
| #define HD44780_INIT_SHIFT_OFF 0x00 |
Initialization with shift disabled.
| #define HD44780_INIT_SHIFT_ON (_BV(__HD44780_INIT_SHIFT_BIT)) |
Initialization with shift enabled.
| #define LCD_HD44780_PIN_DISPLAY_TYPE |
| #define LCD_HD44780_PIN_MULTI_MODE 0 |
Multidisplay display mode.
| #define LCD_HD44780_PIN_SINGLE_SOME_CODE 0 |
This allows for the same code to be achieved with the macro LCD_HD44780_PIN_MULTI_MODE on and off.
| typedef volatile lcd_info_struct lcd_info_t |
Information to distinguish a specific display from several connected ones.
This parameter is set during LCD initialization and should not be changed manually later.
| void lcd_byte | ( | const byte_t | ch | ) |
Outputs a symbol.
| ch | Symbol code |
| void lcd_byte | ( | const lcd_info_t *const | info, |
| const byte_t | ch ) |
Outputs a symbol.
Multidisplay or some code modes only. See LCD_HD44780_PIN_MULTI_MODE , LCD_HD44780_PIN_SINGLE_SOME_CODE
| info | lcd_info_t reference. |
| ch | Symbol code |
| void lcd_cgr_adr | ( | const lcd_info_t *const | info, |
| const uint8_t | flags ) |
Sets CGRAM address.
Multidisplay or some code modes only. See LCD_HD44780_PIN_MULTI_MODE , LCD_HD44780_PIN_SINGLE_SOME_CODE
| info | lcd_info_t reference. |
| flags | CGRAM address |
| void lcd_cgr_adr | ( | const uint8_t | flags | ) |
Sets CGRAM address.
| flags | CGRAM address |
| void lcd_clear | ( | const lcd_info_t *const | info | ) |
Clears the display.
Multidisplay or some code modes only. See LCD_HD44780_PIN_MULTI_MODE , LCD_HD44780_PIN_SINGLE_SOME_CODE
| info | lcd_info_t reference. |
| void lcd_clear | ( | void | ) |
Clears the display.
| void lcd_cursor | ( | const lcd_info_t *const | info, |
| const uint8_t | flags ) |
Moves the cursor or shifts the display.
Multidisplay or some code modes only. See LCD_HD44780_PIN_MULTI_MODE , LCD_HD44780_PIN_SINGLE_SOME_CODE
| info | lcd_info_t reference. |
| flags | Options flags |
| void lcd_cursor | ( | const uint8_t | flags | ) |
Moves the cursor or shifts the display.
| flags | Options flags |
| void lcd_custom_char | ( | const lcd_info_t *const | info, |
| const byte_t | char_pos, | ||
| const byte_t | custom_char[8] ) |
Creates a custom symbol.
Multidisplay or some code modes only. See LCD_HD44780_PIN_MULTI_MODE , LCD_HD44780_PIN_SINGLE_SOME_CODE
| char_pos | Char position 0-7. |
| custom_char | 8-byte array with symbol information. |
| info | lcd_info_t reference. |
| void lcd_ddr_adr | ( | const lcd_info_t *const | info, |
| const uint8_t | flags ) |
Sets DDRAM address.
Multidisplay or some code modes only. See LCD_HD44780_PIN_MULTI_MODE , LCD_HD44780_PIN_SINGLE_SOME_CODE
| info | lcd_info_t reference. |
| flags | DDRAM address |
| void lcd_ddr_adr | ( | const uint8_t | flags | ) |
Sets DDRAM address.
| flags | DDRAM address |
| void lcd_display_ctrl | ( | const lcd_info_t *const | info, |
| const uint8_t | flags ) |
Sets diplay options.
Multidisplay or some code modes only. See LCD_HD44780_PIN_MULTI_MODE , LCD_HD44780_PIN_SINGLE_SOME_CODE
| info | lcd_info_t reference. |
| flags | Options flags |
| void lcd_display_ctrl | ( | const uint8_t | flags | ) |
Sets diplay options.
| flags | Options flags |
| void lcd_entry_mode | ( | const lcd_info_t *const | info, |
| const uint8_t | flags ) |
Sets cursor move direction and specifies display shift.
Multidisplay or some code modes only. See LCD_HD44780_PIN_MULTI_MODE , LCD_HD44780_PIN_SINGLE_SOME_CODE
| info | lcd_info_t reference. |
| flags | Options flags |
| void lcd_entry_mode | ( | const uint8_t | flags | ) |
Sets cursor move direction and specifies display shift.
| flags | Options flags |
| void lcd_func_set | ( | const lcd_info_t *const | info, |
| const uint8_t | flags ) |
Sets options.
Multidisplay or some code modes only. See LCD_HD44780_PIN_MULTI_MODE , LCD_HD44780_PIN_SINGLE_SOME_CODE
| info | lcd_info_t reference. |
| flags | Options flags |
| void lcd_func_set | ( | const uint8_t | flags | ) |
Sets options.
| flags | Options flags |
| void lcd_home | ( | const lcd_info_t *const | info, |
| const uint8_t | flags ) |
Sets DDRAM address 0 in a ddress counter.
| info | lcd_info_t reference. |
| flags | Options flags |
| void lcd_home | ( | const uint8_t | flags | ) |
Sets DDRAM address 0 in a ddress counter.
| flags | Options flags |
| void lcd_init | ( | const lcd_init_t *const | config | ) |
Initializes the display.
Multidisplay or some code modes only. See LCD_HD44780_PIN_MULTI_MODE , LCD_HD44780_PIN_SINGLE_SOME_CODE
| config | lcd_init_t structure |
| config | lcd_init_t structure |
| void lcd_line | ( | const char | str[], |
| const lcd_line_t | line, | ||
| const uint8_t | start_pos ) |
Outputs a string on entry line.
| str | A string |
| line | Display row |
| start_pos | Starts with the display column |
| void lcd_line | ( | const lcd_info_t *const | info, |
| const char | str[], | ||
| const lcd_line_t | line, | ||
| const uint8_t | start_pos ) |
Outputs a string on entry line.
Multidisplay or some code modes only. See LCD_HD44780_PIN_MULTI_MODE , LCD_HD44780_PIN_SINGLE_SOME_CODE
| info | lcd_info_t reference. |
| str | A string |
| line | Display row |
| start_pos | Starts with the display column |
| void lcd_print | ( | const char | str[] | ) |
Outputs a string to buffer.
No line overflow control. The CR character will be skipped.
| str | A string |
| void lcd_print | ( | const lcd_info_t *const | info, |
| const char | str[] ) |
Outputs a string to buffer.
Multidisplay or some code modes only. See LCD_HD44780_PIN_MULTI_MODE , LCD_HD44780_PIN_SINGLE_SOME_CODE
No line overflow control. The CR character will be skipped.
| info | lcd_info_t reference. |
| str | A string |
| byte_t lcd_read_busy_and_addr | ( | ) |
Waits until display is buisy and returns address counter contents.
| byte_t lcd_read_busy_and_addr | ( | const lcd_info_t *const | info | ) |
Waits until display is buisy and returns address counter contents.
Multidisplay or some code modes only. See LCD_HD44780_PIN_MULTI_MODE , LCD_HD44780_PIN_SINGLE_SOME_CODE
| info | lcd_info_t reference. |
| byte_t lcd_read_data | ( | ) |
Reads data from CGRAM or from DDRAM.
| byte_t lcd_read_data | ( | const lcd_info_t *const | info | ) |
Reads data from CGRAM or from DDRAM.
Multidisplay or some code modes only. See LCD_HD44780_PIN_MULTI_MODE , LCD_HD44780_PIN_SINGLE_SOME_CODE
| info | lcd_info_t reference. |
| void lcd_refresh_ml | ( | const char | str[] | ) |
Outputs a string on all lines.
| str | A string |
| void lcd_refresh_ml | ( | const lcd_info_t *const | info, |
| const char | str[] ) |
Outputs a string on all lines.
Multidisplay or some code modes only. See LCD_HD44780_PIN_MULTI_MODE , LCD_HD44780_PIN_SINGLE_SOME_CODE
| info | lcd_info_t reference. |
| str | A string |
| void lcd_set_pos | ( | const lcd_info_t *const | info, |
| const lcd_line_t | line, | ||
| const uint8_t | pos ) |
Sets DDRAM address to a given position.
Multidisplay or some code modes only. See LCD_HD44780_PIN_MULTI_MODE , LCD_HD44780_PIN_SINGLE_SOME_CODE
| info | lcd_info_t reference. |
| line | Display row |
| pos | Display column |
| void lcd_set_pos | ( | const lcd_line_t | line, |
| const uint8_t | pos ) |
Sets DDRAM address to a given position.
| line | Display row |
| pos | Display column |