From c764ce93675d43bd65a7f53c2e6165e917226eed Mon Sep 17 00:00:00 2001 From: Drath Date: Wed, 30 Sep 2026 13:51:05 +0200 Subject: [PATCH] lcd now supports 2 extra commands --- include/lcd.h | 2 ++ src/lcd.c | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/lcd.h b/include/lcd.h index a63911b..ff5ffa1 100644 --- a/include/lcd.h +++ b/include/lcd.h @@ -19,6 +19,8 @@ struct lcd_t { typedef uint8_t lcd_glyph_t[8]; void lcd_close(struct lcd_t *lcd); +void lcd_reinit(struct lcd_t *lcd); +void lcd_splash(struct lcd_t *lcd); void lcd_clear(struct lcd_t *lcd); void lcd_set_contrast(struct lcd_t *lcd, uint8_t contrast); void lcd_set_backlight(struct lcd_t *lcd, bool enabled); diff --git a/src/lcd.c b/src/lcd.c index ba6aabc..953463a 100644 --- a/src/lcd.c +++ b/src/lcd.c @@ -3,12 +3,11 @@ #include #include #include +#include #include #include #include -#include - #define MIN(a, b) ((a) < (b) ? (a) : (b)) static int lcd_open(struct lcd_t *lcd, const bool reopen) { @@ -42,6 +41,16 @@ static void lcd_write(struct lcd_t *lcd, const uint8_t *cmdbuf, const uint16_t l } } +void lcd_reinit(struct lcd_t *lcd) { + constexpr uint8_t cmdbuf[] = {0xFE, 63}; + lcd_write(lcd, cmdbuf, sizeof(cmdbuf)); +} + +void lcd_splash(struct lcd_t *lcd) { + constexpr uint8_t cmdbuf[] = {0xFE, 65}; + lcd_write(lcd, cmdbuf, sizeof(cmdbuf)); +} + void lcd_clear(struct lcd_t *lcd) { constexpr uint8_t cmdbuf[] = {0xFE, 88}; lcd_write(lcd, cmdbuf, sizeof(cmdbuf));