diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-03-08 20:47:19 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-03-08 20:47:19 (GMT) |
| commit | a864a93706aa45e1f104b9710bc47f3b26bc4781 (patch) | |
| tree | c79923c0524befa885f787b302ddb89354616107 | |
| parent | adf9a33c9e4903639a24d81d7ccaa5d528225cc5 (diff) | |
wasp: manager: Blankt the display during app transitions
| -rw-r--r-- | wasp/drivers/st7789.py | 14 | ||||
| -rw-r--r-- | wasp/manager.py | 2 |
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. |
