Driver for the Hitachi HD44780 LCD driver.
More...
Driver for the Hitachi HD44780 LCD driver.
- Note
- The driver currently supports direct addressing, no I2C
|
int | hd44780_init (hd44780_t *dev, const hd44780_params_t *params) |
| Initialize the given driver.
|
|
void | hd44780_clear (const hd44780_t *dev) |
| Clear display, delete all chars.
|
|
void | hd44780_home (const hd44780_t *dev) |
| Reset cursor to row 0 and column 0.
|
|
void | hd44780_set_cursor (const hd44780_t *dev, uint8_t col, uint8_t row) |
| Set cursor to specific position in column and row.
|
|
void | hd44780_display (hd44780_t *dev, hd44780_state_t state) |
| Turn display on or off.
|
|
void | hd44780_cursor (hd44780_t *dev, hd44780_state_t state) |
| Show cursor, on or off.
|
|
void | hd44780_blink (hd44780_t *dev, hd44780_state_t state) |
| Blink cursor, on or off.
|
|
void | hd44780_scroll_left (const hd44780_t *dev) |
| Enable left scrolling.
|
|
void | hd44780_scroll_right (const hd44780_t *dev) |
| Enable right scrolling.
|
|
void | hd44780_left2right (hd44780_t *dev) |
| Set display direction left to right.
|
|
void | hd44780_right2left (hd44780_t *dev) |
| Set display direction right to left.
|
|
void | hd44780_autoscroll (hd44780_t *dev, hd44780_state_t state) |
| Display autoscroll 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.
|
|
void | hd44780_write (const hd44780_t *dev, uint8_t value) |
| Write a single character on the LCD.
|
|
void | hd44780_print (const hd44780_t *dev, const char *data) |
| Write a string on the LCD.
|
|
◆ HD44780_CGRAM_SIZE
#define HD44780_CGRAM_SIZE (8U) |
Size of RAM for custom chars.
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.
Definition at line 55 of file hd44780.h.
◆ HD44780_MAX_COLS
#define HD44780_MAX_COLS (40U) |
Maximal number of columns supported by the driver.
Definition at line 37 of file hd44780.h.
◆ HD44780_MAX_PINS
#define HD44780_MAX_PINS (8U) |
Number of data pins for communication 4 or 8.
Definition at line 47 of file hd44780.h.
◆ HD44780_MAX_ROWS
#define HD44780_MAX_ROWS (4U) |
Maximal number of rows supported by the driver.
Definition at line 42 of file hd44780.h.
◆ hd44780_state_t
Simple state values.
Enumerator |
---|
HD44780_OFF | disable feature
|
HD44780_ON | enable feature
|
Definition at line 83 of file hd44780.h.
◆ hd44780_autoscroll()
Display autoscroll on or off.
- Parameters
-
[in] | dev | device descriptor of LCD |
[in] | state | scroll on or off |
◆ hd44780_blink()
Blink cursor, on or off.
- Parameters
-
[in] | dev | device descriptor of LCD |
[in] | state | blink on or off |
◆ hd44780_clear()
Clear display, delete all chars.
- Parameters
-
[in] | dev | device descriptor of LCD |
◆ hd44780_create_char()
void hd44780_create_char |
( |
const hd44780_t * |
dev, |
|
|
uint8_t |
location, |
|
|
uint8_t |
charmap[] |
|
) |
| |
Create and store a custom character on display memory.
- Parameters
-
[in] | dev | device descriptor of LCD |
[in] | location | memory location |
[in] | charmap | character bitmap |
- Precondition
- charmap has to be of size HD44780_CGRAM_SIZE, which is 8 by default
◆ hd44780_cursor()
Show cursor, on or off.
- Parameters
-
[in] | dev | device descriptor of LCD |
[in] | state | cursor on or off |
◆ hd44780_display()
Turn display on or off.
- Parameters
-
[in] | dev | device descriptor of LCD |
[in] | state | display on or off |
◆ hd44780_home()
Reset cursor to row 0 and column 0.
- Parameters
-
[in] | dev | device descriptor of LCD |
◆ hd44780_init()
Initialize the given driver.
- Parameters
-
[out] | dev | device descriptor of display to initialize |
[in] | params | configuration parameters |
- Returns
- 0 on success, otherwise error
◆ hd44780_left2right()
Set display direction left to right.
- Parameters
-
[in] | dev | device descriptor of LCD |
◆ hd44780_print()
void hd44780_print |
( |
const hd44780_t * |
dev, |
|
|
const char * |
data |
|
) |
| |
Write a string on the LCD.
- Parameters
-
[in] | dev | device descriptor of LCD |
[in] | data | the string to print |
◆ hd44780_right2left()
Set display direction right to left.
- Parameters
-
[in] | dev | device descriptor of LCD |
◆ hd44780_scroll_left()
void hd44780_scroll_left |
( |
const hd44780_t * |
dev | ) |
|
Enable left scrolling.
- Parameters
-
[in] | dev | device descriptor of LCD |
◆ hd44780_scroll_right()
void hd44780_scroll_right |
( |
const hd44780_t * |
dev | ) |
|
Enable right scrolling.
- Parameters
-
[in] | dev | device descriptor of LCD |
◆ hd44780_set_cursor()
void hd44780_set_cursor |
( |
const hd44780_t * |
dev, |
|
|
uint8_t |
col, |
|
|
uint8_t |
row |
|
) |
| |
Set cursor to specific position in column and row.
- Parameters
-
[in] | dev | device descriptor of LCD |
[in] | col | column position |
[in] | row | row position |
◆ hd44780_write()
void hd44780_write |
( |
const hd44780_t * |
dev, |
|
|
uint8_t |
value |
|
) |
| |
Write a single character on the LCD.
- Parameters
-
[in] | dev | device descriptor of LCD |
[in] | value | the character to print, i.e., memory location |