From d4478de9546e9c4dddd4c8dd6a8fb9429ec2087b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Sat, 9 Jul 2022 13:44:53 +0200 Subject: [PATCH] doc: add project documentation --- README.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bb750e7..d49b11e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,24 @@ -firmware template for ST STM8S micro-controller. -includes register definitions using macros and structures. +STM8S003 firmware for the [I²C to HD44780 adapter](https://git.cuvoodoo.info/kingkevin/board/src/branch/i2c_hd44780). + +I²C commands (first byte). + +simplified commands: + +- 0x0 INIT: initialize LCD, as 2-line, 5x8 dots, no blinking or cursor +- 0x1 LINE1: write to line 1, followed by ASCII text +- 0x2 LINE2: write to line 2, followed by ASCII text +- 0x3 DISPLAY_ON: turn display on +- 0x4 DISPLAY_OFF: turn display off +- 0x5 BRIGHTNESS: set backlight brightness, followed by 0-255 value + +raw instructions, directly mapping to HD44780, followed by instruction byte or data bytes if applicable: + +- 0x6 CLEAR_DISPLAY +- 0x7 RETURN_HOME +- 0x8 ENTRY_MODE_SET +- 0x9 DISPLAY +- 0xa CURSOR_DISPLAY_SHIFT +- 0xb FUNCTION_SET +- 0xc CGRAM_ADDR +- 0xd DDRAM_ADDR +- 0xe DATA