summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wasp/drivers/st7789.py14
-rw-r--r--wasp/manager.py2
2 files changed, 15 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
diff --git a/wasp/manager.py b/wasp/manager.py
index b9fa084..d5a4ff9 100644
--- a/wasp/manager.py
+++ b/wasp/manager.py
@@ -42,7 +42,9 @@ class Manager(object):
self.tick_expiry = None
self.app = app
+ self.watch.display.mute(True)
app.foreground(self)
+ self.watch.display.mute(False)
def navigate(self, direction=None):
"""Navigate between different applications.