summaryrefslogtreecommitdiff
path: root/wasp/pinetime.py
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2020-01-30 22:11:31 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-01-30 22:11:31 (GMT)
commit0acbcc415bbc3ab5b80aeee23ce4258052d9ac2e (patch)
treeca05741b92067b158965a49288b5c1920a1a9979 /wasp/pinetime.py
parenta34d65d7fdfbbaaa3e6484dfebe914378f478ca2 (diff)
wasp: Reorganise the board support
Diffstat (limited to 'wasp/pinetime.py')
-rw-r--r--wasp/pinetime.py53
1 files changed, 0 insertions, 53 deletions
diff --git a/wasp/pinetime.py b/wasp/pinetime.py
deleted file mode 100644
index 730eebc..0000000
--- a/wasp/pinetime.py
+++ /dev/null
@@ -1,53 +0,0 @@
-from machine import Pin
-#from machine import Signal
-from machine import SPI
-
-from drivers.battery import Battery
-from drivers.signal import Signal
-from drivers.st7789 import ST7789_SPI
-
-class Display(ST7789_SPI):
- def __init__(self):
- spi = SPI(0)
- # Mode 3, maximum clock speed!
- spi.init(polarity=1, phase=1, baudrate=8000000)
-
- # Configure the display
- cs = Pin("DISP_CS", Pin.OUT)
- dc = Pin("DISP_DC", Pin.OUT)
- rst = Pin("DISP_RST", Pin.OUT)
-
- super().__init__(240, 240, spi, cs=cs, dc=dc, res=rst)
-
-class Backlight(object):
- lo = Pin("BL_LO", Pin.OUT, value=0)
- mid = Pin("BL_MID", Pin.OUT, value=1)
- hi = Pin("BL_HI", Pin.OUT, value=1)
-
- def __init__(self, level=1):
- self.set(level)
-
- def set(self, level):
- hi = 1
- mid = 1
- lo = 1
-
- if level >= 3:
- hi = 0
- elif level == 2:
- mid = 0
- elif level == 1:
- lo = 0
-
- self.hi(hi)
- self.mid(mid)
- self.lo(lo)
-
-backlight = Backlight(0)
-display = Display()
-backlight.set(1)
-
-battery = Battery(
- Pin('BATTERY', Pin.IN),
- Signal(Pin('CHARGING', Pin.IN), invert=True),
- Signal(Pin('USB_PWR', Pin.IN), invert=True))