LCD HD44780 driver library v1.0.3
Enumerations | Functions
LCD_HD44780_lib_API

Enumerations

enum  LCD_alignment_e { left , right }
 Labels for alignment parameter used by lcd_int() and lcd_hex() functions. More...
 
enum  LCD_LINES_e { LINE_1 , LINE_2 , LINE_3 , LINE_4 }
 Line labels used when calling lcd_locate() or lcd_buf_locate() function. More...
 
enum  LCD_COLUMNS_e {
  C1 , C2 , C3 , C4 ,
  C5 , C6 , C7 , C8 ,
  C9 , C10 , C11 , C12 ,
  C13 , C14 , C15 , C16 ,
  C17 , C18 , C19 , C20
}
 Column labels used when calling lcd_locate() or lcd_buf_locate() function. More...
 

Functions

void lcd_init (void)
 
void lcd_enable_backlight (void)
 Function for disabling backlight od the LCD.
 
void lcd_disable_backlight (void)
 Function that disable backlight of the LCD. This function change the backlight GPIO pin state to inactive. Active state of the GPIO backlight pin is defined by @ lcd_init()
 
void lcd_cls (void)
 Function that clears the LCD screen and sets the cursor on the position of the first character in the first line of the LCD screen.
 
void lcd_def_char (const uint8_t CGRAM_bank_x_char_adr, const uint8_t *def_char)
 Function for defining custom user characters in CGRAM of the LCD. More...
 
void lcd_load_char_bank (const lcd_bank_load_struct_t *char_bank)
 Function that loads to LCD_CGRAM predefined characters form specific user char_bank. More...
 
void lcd_char (const char C)
 Function for printing the char on the LCD screen under the current position of the LCD cursor. More...
 
void lcd_str (const char *str)
 Function for printing/writing the string on the LCD screen starting from the current LCD cursor position. More...
 
void lcd_int (int val, uint8_t width, enum LCD_alignment_e alignment)
 Function for printing the integer value on the LCD screen under the current position of the LCD cursor. More...
 
void lcd_hex (int val, uint8_t width, enum LCD_alignment_e alignment)
 Function for printing the integer value in hexadecimal format on the LCD screen under the current position of the LCD cursor. More...
 
void lcd_bin (int val, uint8_t width)
 Function for printing the integer value in hexadecimal format on the LCD screen under the current position of the LCD cursor. More...
 
void lcd_locate (enum LCD_LINES_e y, enum LCD_COLUMNS_e x)
 Function that moves LCD cursor to a specific position located under the x and y coordinate. More...
 
void lcd_home (void)
 Function that moves LCD cursor to the first position at the first row of the LCD screen.
 
void lcd_cursor_on (void)
 Function that activates the visibility of the LCD cursor.
 
void lcd_cursor_off (void)
 Function that deactivates the visibility and blinking of the LCD cursor.
 
void lcd_blinking_cursor_on (void)
 Function that activates the visibility and blinking of the LCD cursor.
 
void lcd_buf_cls (void)
 Function that puts spaces(0x32) in the whole LCD buffer and sets the cursor on the position of the first character in the first line of the LCD buffer.
 
void lcd_buf_char (const char c)
 Function for adding the char to the LCD buffer under the current position of the LCD buffer. More...
 
void lcd_buf_locate (enum LCD_LINES_e y, enum LCD_COLUMNS_e x)
 Function that changes the current LCD buffer position pointer to a specific position located under the x and y coordinate. More...
 
void lcd_buf_str (const char *str)
 Function for placing the string in the LCD buffer starts from the current LCD buffer position pointer. More...
 
void lcd_update (void)
 Function that prints on the LCD screen the content of The LCD buffer. The function sets also The LCD buffer position pointer to the First line's first character.
 
void lcd_buf_int (int val, uint8_t width, enum LCD_alignment_e alignment)
 Function for adding integer value as string to the LCD buffer under the current position of the LCD buffer pointer. More...
 
void lcd_buf_hex (int val, uint8_t width, enum LCD_alignment_e alignment)
 Function for adding integer value in hexadecimal format as a string to the LCD buffer under the current position of the LCD buffer pointer. More...
 
void lcd_buf_bin (int val, uint8_t width)
 Function for adding to the LCD buffer the integer value in binary format as a string under the current position of the LCD buffer pointer. More...
 

Detailed Description

Enumeration Type Documentation

◆ LCD_alignment_e

Labels for alignment parameter used by lcd_int() and lcd_hex() functions.

Enumerator
left 

pass as argument when calling lcd_int() or lcd_buf_int() or lcd_hex() or lcd_buf_hex() to set left alighment

right 

pass as argument when calling lcd_int() or lcd_buf_int() or lcd_hex() or lcd_buf_hex() to set right alighment

◆ LCD_COLUMNS_e

Column labels used when calling lcd_locate() or lcd_buf_locate() function.

Enumerator
C1 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to 1'st char/collumn of LCD

C2 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to 2'nd char/collumn of LCD

C3 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to 3'th char/collumn of LCD

C4 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to 4'th char/collumn of LCD

C5 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to 5'th char/collumn of LCD

C6 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to 6'th char/collumn of LCD

C7 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to 7'th char/collumn of LCD

C8 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to 8'th char/collumn of LCD

C9 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to 9'th char/collumn of LCD

C10 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to 10'th char/collumn of LCD

C11 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to 11'th char/collumn of LCD

C12 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to 12'th char/collumn of LCD

C13 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to 13'th char/collumn of LCD

C14 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to 14'th char/collumn of LCD

C15 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to 15'th char/collumn of LCD

C16 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to 16'th char/collumn of LCD

C17 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to 17'th char/collumn of LCD

C18 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to 18'th char/collumn of LCD

C19 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to 19'th char/collumn of LCD

C20 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to 20'th char/collumn of LCD

◆ LCD_LINES_e

Line labels used when calling lcd_locate() or lcd_buf_locate() function.

Enumerator
LINE_1 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to first line of LCD

LINE_2 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to second line of LCD

LINE_3 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to third line of LCD

LINE_4 

pass as argument when calling lcd_locate() or lcd_buf_locate() to move curson to fourth line of LCD

Function Documentation

◆ lcd_bin()

void lcd_bin ( int  val,
uint8_t  width 
)

Function for printing the integer value in hexadecimal format on the LCD screen under the current position of the LCD cursor.

Parameters
valint type value to print on LCD screen in hexadecimal format
widthMinimum number of characters to be printed. If the value to be printed is shorter than this number, the result is padded with blank spaces. The value is not truncated even if the result is larger. The width should contain additional 2 characters for '0x' at the beginning of the printed value.
Attention
to compile for AVR ucontrollers definition of flag AVR is required.
Here is the call graph for this function:

◆ lcd_buf_bin()

void lcd_buf_bin ( int  val,
uint8_t  width 
)

Function for adding to the LCD buffer the integer value in binary format as a string under the current position of the LCD buffer pointer.

Parameters
valint type value to be added to the LCD buffer as a string in hexadecimal format
widthMinimum number of characters to be added to LCD buffer. If the value to be added to the buffer as string length is shorter than width, the result is padded with blank spaces. The value to be added to the buffer as a string is not truncated if the string length represents the value in binary format length is larger than the width value. The width should contain an additional 2 characters for "0b" at the beginning of the value represented as a string. example: 0b01-> width=4
Attention
to compile for AVR ucontrollers, definition of flag AVR is required.
Here is the call graph for this function:

◆ lcd_buf_char()

void lcd_buf_char ( const char  c)

Function for adding the char to the LCD buffer under the current position of the LCD buffer.

Parameters
Cchar (for example '1') or its ASCI code (0x31).
Note
For user-defined char, place LCD_CGRAM_BANK_x_e (Position/address of the character in CGRAM of the LCD where defined char was written).

◆ lcd_buf_hex()

void lcd_buf_hex ( int  val,
uint8_t  width,
enum LCD_alignment_e  alignment 
)

Function for adding integer value in hexadecimal format as a string to the LCD buffer under the current position of the LCD buffer pointer.

Parameters
valint type value to add to LCD buffer as a string in hexadecimal format
widthMinimum number of characters to be added to lcd buffer. If the value to be added to the buffer is shorter than the width, the result is padded with blank spaces. The value to be added to the buffer as a string is not truncated if the string length is larger than the width value. Width should contain additional 2 characters for "0x" at the beginning of the value represented as a string. example: 0x01-> width=4
alignmentThis parameter can only accept values defined in LCD_alignment_e. If the value to be printed is shorter than the width, this parameter will specify the alignment of the printed text value.
Attention
to compile for AVR ucontrollers, definition of flag AVR is required.
Here is the call graph for this function:

◆ lcd_buf_int()

void lcd_buf_int ( int  val,
uint8_t  width,
enum LCD_alignment_e  alignment 
)

Function for adding integer value as string to the LCD buffer under the current position of the LCD buffer pointer.

Parameters
valint type value to add to LCD buffer
widthMinimum number of characters to be added to LCD buffer. If the value to be added to the LCD buffer is shorter than width, the result is padded with blank spaces. The value to be added to the buffer as a string is not truncated if the string length is larger than the width value.
alignmentThis parameter can only accept values defined in LCD_alignment_e. If the value to be printed is shorter than the width, this parameter will specify the alignment of the printed text value.
Attention
to compile for AVR ucontrollers, definition of flag AVR is required.
Here is the call graph for this function:

◆ lcd_buf_locate()

void lcd_buf_locate ( enum LCD_LINES_e  y,
enum LCD_COLUMNS_e  x 
)

Function that changes the current LCD buffer position pointer to a specific position located under the x and y coordinate.

Parameters
yLCD row/line number. This parameter can only accept values defined in LCD_LINES_e.
xLCD column number. This parameter can only accept values defined in LCD_COLUMNS_e.

◆ lcd_buf_str()

void lcd_buf_str ( const char *  str)

Function for placing the string in the LCD buffer starts from the current LCD buffer position pointer.

Parameters
strstring that should be placed in the LCD buffer
Here is the caller graph for this function:

◆ lcd_char()

void lcd_char ( const char  C)

Function for printing the char on the LCD screen under the current position of the LCD cursor.

Parameters
Cchar (for example '1') or its ASCI code (0x31).
Note
For user-defined char, place CGRAM_char_index (Position/address of the character in CGRAM of the LCD where defined char was written).
Here is the caller graph for this function:

◆ lcd_def_char()

void lcd_def_char ( const uint8_t  CGRAM_bank_x_char_adr,
const uint8_t *  def_char 
)

Function for defining custom user characters in CGRAM of the LCD.

Parameters
CGRAM_char_indexPosition/address of the character in CGRAM of the LCD where defined char should be written. For the predefined example of special characters, taken values are defined in the type enum LCD_CGRAM_BANK_1_e that is declared in lcd-hd44780.h
def_charPointer to the predefined special character.
Note
CGRAM_char_index - This Parameter can take values from 0 to 7. For the predefined example of special characters, taken values are defined in the type enum LCD_CGRAM that is defined in lcd_hd44780_def_char.h
Here is the caller graph for this function:

◆ lcd_hex()

void lcd_hex ( int  val,
uint8_t  width,
enum LCD_alignment_e  alignment 
)

Function for printing the integer value in hexadecimal format on the LCD screen under the current position of the LCD cursor.

Parameters
valint type value to print on LCD screen in hexadecimal format
widthMinimum number of characters to be printed. If the value to be printed is shorter than this number, the result is padded with blank spaces. The value is not truncated even if the result is larger. The width should contain additional 2 characters for '0x' at the beginning of the printed value.
alignmentThis parameter can only accept values defined in LCD_alignment_e. If the value to be printed is shorter than the width, this parameter will specify the alignment of the printed text value.
Attention
to compile for AVR ucontrollers definition of flag AVR is required.
Here is the call graph for this function:

◆ lcd_int()

void lcd_int ( int  val,
uint8_t  width,
enum LCD_alignment_e  alignment 
)

Function for printing the integer value on the LCD screen under the current position of the LCD cursor.

Parameters
valint type value to print on LCD screen
widthMinimum number of characters to be printed. If the value to be printed is shorter than this number, the result is padded with blank spaces. The value is not truncated even if the result is larger.
alignmentThis parameter can only accept values defined in LCD_alignment_e. If the value to be printed is shorter than the width, this parameter will specify the alignment of the printed text value.
Attention
to compile for AVR ucontrollers definition of flag AVR is required.
Here is the call graph for this function:

◆ lcd_load_char_bank()

void lcd_load_char_bank ( const lcd_bank_load_struct_t char_bank_data)

Function that loads to LCD_CGRAM predefined characters form specific user char_bank.

Parameters
char_bank- pointer to selected user char bank that function should load to LCD_CGRAM. Char banks are defined in lcd_hd44780_def_char.h
Here is the call graph for this function:

◆ lcd_locate()

void lcd_locate ( enum LCD_LINES_e  y,
enum LCD_COLUMNS_e  x 
)

Function that moves LCD cursor to a specific position located under the x and y coordinate.

Parameters
yLCD row/line number. This parameter can only accept values defined in LCD_LINES_e.
xLCD column number. This parameter can only accept values defined in LCD_COLUMNS_e.

◆ lcd_str()

void lcd_str ( const char *  str)

Function for printing/writing the string on the LCD screen starting from the current LCD cursor position.

Parameters
strstring that should be printed/written on the LCD screen
Here is the call graph for this function:
Here is the caller graph for this function: