From 58571e23caaf46a9863ef809b771e4089a30fd80 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Mon, 31 Mar 2025 03:24:45 +0200 Subject: [PATCH] add support to CST816 chips with different register for chip ID --- adafruit_cst8xx.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/adafruit_cst8xx.py b/adafruit_cst8xx.py index 53e9e87..5bc8617 100644 --- a/adafruit_cst8xx.py +++ b/adafruit_cst8xx.py @@ -48,6 +48,7 @@ _CST_REG_TOUCHDATA = const(0x03) _CST_REG_SLEEP = const(0xA5) _CST_REG_FIRMVERS = const(0xA6) +_CST_REG_CHIPID_816 = const(0xA7) _CST_REG_MODID = const(0xA8) _CST_REG_PROJID = const(0xA9) _CST_REG_CHIPTYPE = const(0xAA) @@ -77,14 +78,20 @@ def __init__(self, i2c, address=_CST_DEFAULT_I2C_ADDR, debug=False, irq_pin=None chip_data = self._read(_CST_REG_FIRMVERS, 6) # don't wait for IRQ # print("chip_data: {%x}".format(chip_data)) - fw_version, _, _, chip_type = struct.unpack(" int: