diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-12-12 18:15:15 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-12-12 18:15:15 (GMT) |
| commit | 941d4a264d53642b14e951523be3473765114476 (patch) | |
| tree | 950d020f3b22d1ea0034edd7896d8c8085bb9398 /wasp/boards/simulator/display.py | |
| parent | e3b2c7bf7d7a4cc7dc2cafc28f35e30f44260a21 (diff) | |
boards: simulator: Additional tests
Start to work (most of) the code paths in the self test application.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp/boards/simulator/display.py')
| -rw-r--r-- | wasp/boards/simulator/display.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/wasp/boards/simulator/display.py b/wasp/boards/simulator/display.py index 379760c..0fa6ef7 100644 --- a/wasp/boards/simulator/display.py +++ b/wasp/boards/simulator/display.py @@ -173,6 +173,29 @@ class CST816SSim(): self.regs[6] = up_y; self.raise_interrupt(pins) + def press(self, x, y): + pins = wasp.watch.Pin.pins + self.regs[1] = 5 + self.regs[4] = x + self.regs[6] = y + self.raise_interrupt(pins) + + def swipe(self, direction): + pins = wasp.watch.Pin.pins + if direction ==' up': + self.regs[1] = 1 + elif direction == 'down': + self.regs[1] = 2 + elif direction == 'left': + self.regs[1] = 4 + elif direction == 'right': + self.regs[1] = 3 + elif direction == 'next': + # Allow NEXT to be tested on the simulator + self.regs[1] = 253 + self.regs[3] = 0x80 + self.raise_interrupt(pins) + def raise_interrupt(self, pins): pins['TP_INT'].raise_irq() |
