aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Kroll <t.kroll@outlook.com>2021-01-25 19:45:44 +0100
committerKevinOConnor <kevin@koconnor.net>2021-01-31 19:35:40 -0500
commit60e4cddf36e00f196e16dd514fa8e9d66670693a (patch)
treef98e966de1d14908fe2c6d0aa1918b6539b05f7a
parent58cd8da5d1b984f6812069d1f2129f3deca4f0e2 (diff)
downloadkutter-60e4cddf36e00f196e16dd514fa8e9d66670693a.tar.gz
kutter-60e4cddf36e00f196e16dd514fa8e9d66670693a.tar.xz
kutter-60e4cddf36e00f196e16dd514fa8e9d66670693a.zip
hd44780: Add hd44780 protocol init config
LDO OLED needs a different init string. Fixes: #3722 Signed-off-by: Thomas Kroll <t.kroll@outlook.com>
-rw-r--r--docs/Config_Reference.md5
-rw-r--r--klippy/extras/display/hd44780.py7
2 files changed, 11 insertions, 1 deletions
diff --git a/docs/Config_Reference.md b/docs/Config_Reference.md
index 04030887..19fc82a2 100644
--- a/docs/Config_Reference.md
+++ b/docs/Config_Reference.md
@@ -3025,6 +3025,11 @@ lcd_type:
# Controller" type displays), "uc1701" (which is used in "MKS Mini
# 12864" type displays), "ssd1306", or "sh1106". This parameter must
# be provided.
+#hd44780_protocol_init: True
+# Perform 8-bit/4-bit protocol initialization on an hd44780 display.
+# This is necessary on real hd44780 devices. However, one may
+# need to disable this on some "clone" devices. The default
+# is True.
#rs_pin:
#e_pin:
#d4_pin:
diff --git a/klippy/extras/display/hd44780.py b/klippy/extras/display/hd44780.py
index 5601b567..7d7b5c6b 100644
--- a/klippy/extras/display/hd44780.py
+++ b/klippy/extras/display/hd44780.py
@@ -21,6 +21,8 @@ class HD44780:
ppins = self.printer.lookup_object('pins')
pins = [ppins.lookup_pin(config.get(name + '_pin'))
for name in ['rs', 'e', 'd4', 'd5', 'd6', 'd7']]
+ self.hd44780_protocol_init = config.getboolean('hd44780_protocol_init',
+ True)
self.line_length = config.getchoice('line_length', LINE_LENGTH_OPTIONS,
LINE_LENGTH_DEFAULT)
mcu = None
@@ -89,7 +91,10 @@ class HD44780:
curtime = self.printer.get_reactor().monotonic()
print_time = self.mcu.estimated_print_time(curtime)
# Program 4bit / 2-line mode and then issue 0x02 "Home" command
- init = [[0x33], [0x33], [0x32], [0x28, 0x28, 0x02]]
+ if self.hd44780_protocol_init:
+ init = [[0x33], [0x33], [0x32], [0x28, 0x28, 0x02]]
+ else:
+ init = [[0x02]]
# Reset (set positive direction ; enable display and hide cursor)
init.append([0x06, 0x0c])
for i, cmds in enumerate(init):