diff --git a/extras/hd44780/README.md b/extras/hd44780/README.md new file mode 100644 index 0000000..519bc92 --- /dev/null +++ b/extras/hd44780/README.md @@ -0,0 +1,119 @@ +# HD44780 LCD display driver + +## Connection type + +Driver supports GPIO connections to module and I2C GPIO expanders as well. +Define `HD44780_I2C = 0` in application makefile for direct GPIO connection. + +See `examples/i2c_lcd_test` and `examples/hd44780_test` . + +## Display types + +### 8x1 + +#### Memory layout + +![0801 display](img/0801.png) + +#### Example + +```C +hd44780_t lcd = { + .addr = ADDR, + .font = HD44780_FONT_5X8, + .lines = 1, + .pins = { + .rs = 0, + .e = 2, + .d4 = 4, + .d5 = 5, + .d6 = 6, + .d7 = 7, + .bl = 3 + }, + .backlight = true +}; +``` + +### 16x1 + +#### Memory layout + +![1601 display](img/1601.png) + +#### Example + +```C +hd44780_t lcd = { + .addr = ADDR, + .font = HD44780_FONT_5X8, + .lines = 2, + .pins = { + .rs = 0, + .e = 2, + .d4 = 4, + .d5 = 5, + .d6 = 6, + .d7 = 7, + .bl = 3 + }, + .backlight = true +}; +hd44780_init(&lcd); +hd44780_gotoxy(&lcd, 0, 0); +hd44780_puts(&lcd, "Hello wo"); +hd44780_gotoxy(&lcd, 0, 1); +hd44780_puts(&lcd, "rld!"); +``` + +### 16x2, 20x2 + +#### Memory layout + +![1602 display](img/1602.png) + +#### Example + +```C +hd44780_t lcd = { + .addr = ADDR, + .font = HD44780_FONT_5X8, + .lines = 2, + .pins = { + .rs = 0, + .e = 2, + .d4 = 4, + .d5 = 5, + .d6 = 6, + .d7 = 7, + .bl = 3 + }, + .backlight = true +}; +``` + +### 16x4, 20x4 + +#### Memory layout + +![1604 display](img/1604.png) + +#### Example + +```C +hd44780_t lcd = { + .addr = ADDR, + .font = HD44780_FONT_5X8, + .lines = 2, + .pins = { + .rs = 0, + .e = 2, + .d4 = 4, + .d5 = 5, + .d6 = 6, + .d7 = 7, + .bl = 3 + }, + .backlight = true +}; +``` diff --git a/extras/hd44780/img/0801.png b/extras/hd44780/img/0801.png new file mode 100644 index 0000000..0a81c09 Binary files /dev/null and b/extras/hd44780/img/0801.png differ diff --git a/extras/hd44780/img/1601.png b/extras/hd44780/img/1601.png new file mode 100644 index 0000000..429bdf6 Binary files /dev/null and b/extras/hd44780/img/1601.png differ diff --git a/extras/hd44780/img/1602.png b/extras/hd44780/img/1602.png new file mode 100644 index 0000000..8bdf7af Binary files /dev/null and b/extras/hd44780/img/1602.png differ diff --git a/extras/hd44780/img/1604.png b/extras/hd44780/img/1604.png new file mode 100644 index 0000000..ac17ba1 Binary files /dev/null and b/extras/hd44780/img/1604.png differ