From 7e867a44816f85b84b0023d7358bd203d4e5a813 Mon Sep 17 00:00:00 2001 From: Zachary Stence Date: Sun, 12 Feb 2023 01:08:43 -0600 Subject: [PATCH 1/2] feat: initialize touchpad gpio pins --- inkplate6_COLOR.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/inkplate6_COLOR.py b/inkplate6_COLOR.py index 494d518..aa34d30 100644 --- a/inkplate6_COLOR.py +++ b/inkplate6_COLOR.py @@ -104,7 +104,12 @@ def begin(self): self.EPAPER_DC_PIN = Pin(EPAPER_DC_PIN, Pin.OUT) self.EPAPER_CS_PIN = Pin(EPAPER_CS_PIN, Pin.OUT) - self.SD_ENABLE = gpioPin(self._PCAL6416A, 10, modeOUTPUT) + self.SD_ENABLE = gpioPin(self._PCAL6416A, 13, modeOUTPUT) + + # Touchpads + self.TOUCH1 = gpioPin(self._PCAL6416A, 10, modeINPUT_PULLUP) + self.TOUCH2 = gpioPin(self._PCAL6416A, 11, modeINPUT_PULLUP) + self.TOUCH3 = gpioPin(self._PCAL6416A, 12, modeINPUT_PULLUP) self.framebuf = bytearray(D_ROWS * D_COLS // 2) @@ -154,8 +159,6 @@ def begin(self): self.sendCommand(b"\x50") self.sendData(b"\x37") - self.setPCALForLowPower() - self._panelState = True return True From 841fb9354d3c30cb0442346951513eaa66363295 Mon Sep 17 00:00:00 2001 From: Zachary Stence Date: Sun, 12 Feb 2023 01:08:59 -0600 Subject: [PATCH 2/2] fix: allow calling gpio pin to read --- PCAL6416A.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PCAL6416A.py b/PCAL6416A.py index 26aa0f9..2d4b57a 100644 --- a/PCAL6416A.py +++ b/PCAL6416A.py @@ -196,4 +196,6 @@ def digitalWrite(self, value): self.PCAL6416A.digitalWrite(self.pin,value) def digitalRead(self): - return self.PCAL6416A.digitalRead(self.pin) \ No newline at end of file + return self.PCAL6416A.digitalRead(self.pin) + + __call__ = digitalRead