drivers: cst816s: Add a version() method
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This commit is contained in:
parent
b0bab534ff
commit
e169dbf61a
1 changed files with 6 additions and 0 deletions
|
@ -36,6 +36,12 @@ class CST816S:
|
||||||
self.tp_rst.on()
|
self.tp_rst.on()
|
||||||
time.sleep_ms(50)
|
time.sleep_ms(50)
|
||||||
|
|
||||||
|
def version(self):
|
||||||
|
self.wake()
|
||||||
|
v = self.i2c.readfrom_mem(21, 0xa6, 4)
|
||||||
|
self.sleep()
|
||||||
|
return v
|
||||||
|
|
||||||
def get_touch_data(self, pin_obj):
|
def get_touch_data(self, pin_obj):
|
||||||
"""Receive a touch event by interrupt.
|
"""Receive a touch event by interrupt.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue