HD44780 LCD driver¶
Driver for the Hitachi HD44780 LCD driver.
Note
The driver currently supports direct addressing, no I2C
-
enum
hd44780_state_t
¶ - HD44780_OFF
- disable feature
- HD44780_ON
- enable feature
-
int
hd44780_init
(hd44780_t * dev, const hd44780_params_t * params)¶ Initialize the given driver.
Parameters
dev: device descriptor of display to initialize params: configuration parameters Return values
- 0 on success, otherwise error
-
void
hd44780_clear
(const hd44780_t * dev)¶ Clear display, delete all chars.
Parameters
dev: device descriptor of LCD
-
void
hd44780_home
(const hd44780_t * dev)¶ Reset cursor to row 0 and column 0.
Parameters
dev: device descriptor of LCD
-
void
hd44780_set_cursor
(const hd44780_t * dev, uint8_t col, uint8_t row)¶ Set cursor to specific position in column and row.
Parameters
dev: device descriptor of LCD col: column position row: row position
-
void
hd44780_display
(hd44780_t * dev,hd44780.h::hd44780_state_t
state)¶ Turn display on or off.
Parameters
dev: device descriptor of LCD state: display on or off
-
void
hd44780_cursor
(hd44780_t * dev,hd44780.h::hd44780_state_t
state)¶ Show cursor, on or off.
Parameters
dev: device descriptor of LCD state: cursor on or off
-
void
hd44780_blink
(hd44780_t * dev,hd44780.h::hd44780_state_t
state)¶ Blink cursor, on or off.
Parameters
dev: device descriptor of LCD state: blink on or off
-
void
hd44780_scroll_left
(const hd44780_t * dev)¶ Enable left scrolling.
Parameters
dev: device descriptor of LCD
-
void
hd44780_scroll_right
(const hd44780_t * dev)¶ Enable right scrolling.
Parameters
dev: device descriptor of LCD
-
void
hd44780_left2right
(hd44780_t * dev)¶ Set display direction left to right.
Parameters
dev: device descriptor of LCD
-
void
hd44780_right2left
(hd44780_t * dev)¶ Set display direction right to left.
Parameters
dev: device descriptor of LCD
-
void
hd44780_autoscroll
(hd44780_t * dev,hd44780.h::hd44780_state_t
state)¶ Display autoscroll on or off.
Parameters
dev: device descriptor of LCD state: scroll on or off
-
void
hd44780_create_char
(const hd44780_t * dev, uint8_t location, uint8_t charmap)¶ Create and store a custom character on display memory.
Parameters
dev: device descriptor of LCD location: memory location charmap: character bitmap
-
void
hd44780_write
(const hd44780_t * dev, uint8_t value)¶ Write a single character on the LCD.
Parameters
dev: device descriptor of LCD value: the character to print, i.e., memory location
-
void
hd44780_print
(const hd44780_t * dev, const char * data)¶ Write a string on the LCD.
Parameters
dev: device descriptor of LCD data: the string to print
-
HD44780_MAX_COLS
¶ Maximal number of columns supported by the driver.
1
(40U)
-
HD44780_MAX_ROWS
¶ Maximal number of rows supported by the driver.
1
(4U)
-
HD44780_MAX_PINS
¶ Number of data pins for communication 4 or 8.
1
(8U)
-
HD44780_RW_OFF
¶ Specific value to turn rw pin off, if unused.
1
(255U)
-
HD44780_CGRAM_SIZE
¶ Size of RAM for custom chars.
1
(8U)
Generally the driver could support 8 chars of size 5x8 or 4 of size 5x10. However, most displays only use the former, which is (hard wired) default.
-
struct
hd44780_params_t
¶ Parameters needed for device initialization.
-
uint8_t
cols
¶ number of LCD cols
-
uint8_t
rows
¶ number of LCD rows
-
gpio.h::gpio_t
rs
¶ rs gpio pin
-
gpio.h::gpio_t
rw
¶ rw gpio pin
-
gpio.h::gpio_t
enable
¶ enable gpio pin
-
gpio.h::gpio_t
data
()¶ data gpio pins
-
uint8_t