summaryrefslogtreecommitdiff
path: root/wasp/drivers
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2020-03-08 20:47:19 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-03-08 20:47:19 (GMT)
commita864a93706aa45e1f104b9710bc47f3b26bc4781 (patch)
treec79923c0524befa885f787b302ddb89354616107 /wasp/drivers
parentadf9a33c9e4903639a24d81d7ccaa5d528225cc5 (diff)
wasp: manager: Blankt the display during app transitions
Diffstat (limited to 'wasp/drivers')
-rw-r--r--wasp/drivers/st7789.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/wasp/drivers/st7789.py b/wasp/drivers/st7789.py
index d57c09b..5cc3946 100644
--- a/wasp/drivers/st7789.py
+++ b/wasp/drivers/st7789.py
@@ -1,4 +1,9 @@
-# MicroPython ST7789 display driver, currently only has an SPI interface
+"""Sitronix ST7789 display driver for MicroPython.
+
+Note: Although the ST7789 supports a variety of communication protocols
+currently this driver only has support for SPI interfaces. However it is
+structured such that other serial protocols can easily be added.
+"""
import micropython
@@ -12,6 +17,7 @@ _SLPOUT = const(0x11)
_NORON = const(0x13)
_INVOFF = const(0x20)
_INVON = const(0x21)
+_DISPOFF = const(0x28)
_DISPON = const(0x29)
_CASET = const(0x2a)
_RASET = const(0x2b)
@@ -78,6 +84,12 @@ class ST7789(object):
else:
self.write_cmd(_INVOFF)
+ def mute(self, mute):
+ if mute:
+ self.write_cmd(_DISPOFF)
+ else:
+ self.write_cmd(_DISPON)
+
def set_window(self, x=0, y=0, width=None, height=None):
if not width:
width = self.width