Added compatibility with LilyGo T-Deck-Pro V1.1

This commit is contained in:
lewisxhe
2026-04-18 11:11:41 -05:00
committed by Ben Meadors
co-authored by Ben Meadors
parent 2c8dec2fbd
commit d31d0f85fe
8 changed files with 367 additions and 7 deletions
+25 -1
View File
@@ -585,7 +585,31 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
SCAN_SIMPLE_CASE(PCT2075_ADDR, PCT2075, "PCT2075", (uint8_t)addr.address);
SCAN_SIMPLE_CASE(SCD30_ADDR, SCD30, "SCD30", (uint8_t)addr.address);
case CST328_ADDR:
// Do we have the CST328 or the CST226SE
// Do we have the CST328 or the CST226SE,CST3530
{
// T-Deck pro V1.1 new touch panel use CST3530
int retry = 5;
while (retry--) {
uint8_t buffer[7];
uint8_t r_cmd[] = {0x0d0, 0x03, 0x00, 0x00};
i2cBus->beginTransmission(addr.address);
i2cBus->write(r_cmd, sizeof(r_cmd));
if (i2cBus->endTransmission() == 0) {
i2cBus->requestFrom((int)addr.address, 7);
i2cBus->readBytes(buffer, 7);
if (buffer[2] == 0xCA && buffer[3] == 0xCA) {
logFoundDevice("CST3530", (uint8_t)addr.address);
type = CST3530;
break;
}
}
uint8_t cmd1[] = {0xD0, 0x00, 0x04, 0x00};
i2cBus->beginTransmission(addr.address);
i2cBus->write(cmd1, sizeof(cmd1));
i2cBus->endTransmission();
delay(50);
}
}
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xAB), 1);
if (registerValue == 0xA9) {
type = CST226SE;