summaryrefslogtreecommitdiff
path: root/wasp/boards/simulator/watch.py
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2020-03-07 11:50:26 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-03-07 11:50:26 (GMT)
commit1ebafc083b3bcc1fd162834054a1b854201da2dc (patch)
tree028757bdc27b46f6e7c7cf2f4cb7cc4c110db9f6 /wasp/boards/simulator/watch.py
parent9664c394a63b2c1351957582465831d6c3b484d4 (diff)
wasp: simulator: Add CST816S simulation
Diffstat (limited to 'wasp/boards/simulator/watch.py')
-rw-r--r--wasp/boards/simulator/watch.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/wasp/boards/simulator/watch.py b/wasp/boards/simulator/watch.py
index 9c45902..91be914 100644
--- a/wasp/boards/simulator/watch.py
+++ b/wasp/boards/simulator/watch.py
@@ -3,9 +3,11 @@ def sleep_ms(ms):
time.sleep(ms / 1000)
time.sleep_ms = sleep_ms
+from machine import I2C
from machine import Pin
from machine import SPI
+from drivers.cst816s import CST816S
from drivers.st7789 import ST7789_SPI
from drivers.vibrator import Vibrator
@@ -86,9 +88,13 @@ class RTC(object):
return (now[3], now[4], now[5])
def uptime(self):
- return time.time
+ return time.time()
+
+ def get_uptime_ms(self):
+ return int(time.time() * 1000)
display = Display()
+touch = CST816S(I2C(0))
backlight = Backlight()
battery = Battery()
rtc = RTC()