hd44780 - Universal driver for HD44780 LCD display¶
- group hd44780
ESP-IDF driver for HD44780 compatible LCD text displays.
Ported from esp-open-rtos
Copyright (c) 2016 Ruslan V. Uss unclerus@gmail.com
BSD Licensed as described in the file LICENSE
Defines
-
HD44780_NOT_USED¶
Typedefs
Enums
Functions
-
esp_err_t hd44780_init(const hd44780_t *lcd)¶
Init LCD.
Set cursor position to (0, 0)
- Parameters
lcd – LCD descriptor
- Returns
ESP_OK
on success
-
esp_err_t hd44780_control(const hd44780_t *lcd, bool on, bool cursor, bool cursor_blink)¶
Control LCD.
On/off LCD, show/hide cursor, set cursor blink
- Parameters
lcd – LCD descriptor
on – Switch LCD on if true
cursor – Show cursor if true
cursor_blink – Enable cursor blinking if true
- Returns
ESP_OK
on success
-
esp_err_t hd44780_clear(const hd44780_t *lcd)¶
Clear LCD.
Clear memory and move cursor to (0, 0)
- Parameters
lcd – LCD descriptor
- Returns
ESP_OK
on success
-
esp_err_t hd44780_gotoxy(const hd44780_t *lcd, uint8_t col, uint8_t line)¶
Move cursor.
- Parameters
lcd – LCD descriptor
col – Column
line – Line
- Returns
ESP_OK
on success
-
esp_err_t hd44780_putc(const hd44780_t *lcd, char c)¶
Write character at cursor position.
- Parameters
lcd – LCD descriptor
c – Character to write
- Returns
ESP_OK
on success
-
esp_err_t hd44780_puts(const hd44780_t *lcd, const char *s)¶
Write NULL-terminated string at cursor position.
- Parameters
lcd – LCD descriptor
s – String to write
- Returns
ESP_OK
on success
-
esp_err_t hd44780_switch_backlight(hd44780_t *lcd, bool on)¶
Switch backlight.
- Parameters
lcd – LCD descriptor
on – Turn backlight on if true
- Returns
ESP_OK
on success
-
esp_err_t hd44780_upload_character(const hd44780_t *lcd, uint8_t num, const uint8_t *data)¶
Upload character data to the CGRAM.
After upload cursor will be moved to (0, 0).
- Parameters
lcd – LCD descriptor
num – Character number (0..7)
data – Character data: 8 or 10 bytes depending on the font
- Returns
ESP_OK
on success
-
struct hd44780¶
- #include <hd44780.h>
LCD descriptor.
Fill it before use.
Public Members
-
hd44780_write_cb_t write_cb¶
Data write callback.
Set it to NULL in case of direct LCD connection to GPIO
-
uint8_t rs¶
GPIO/register bit used for RS pin.
-
uint8_t e¶
GPIO/register bit used for E pin.
-
uint8_t d4¶
GPIO/register bit used for D4 pin.
-
uint8_t d5¶
GPIO/register bit used for D5 pin.
-
uint8_t d6¶
GPIO/register bit used for D5 pin.
-
uint8_t d7¶
GPIO/register bit used for D5 pin.
-
uint8_t bl¶
GPIO/register bit used for backlight.
Set it
HD44780_NOT_USED
if no backlight used
-
hd44780_font_t font¶
LCD Font type.
-
uint8_t lines¶
Number of lines for LCD.
Many 16x1 LCD has two lines (like 8x2)
-
bool backlight¶
Current backlight state.
-
hd44780_write_cb_t write_cb¶
-
HD44780_NOT_USED¶