diff --git a/src/configuration.h b/src/configuration.h index baf24a636..524dacdea 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -228,6 +228,7 @@ along with this program. If not, see . #define ICM20948_ADDR_ALT 0x68 #define BHI260AP_ADDR 0x28 #define BMM150_ADDR 0x13 +#define DA217_ADDR 0x26 // ----------------------------------------------------------------------------- // LED diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index e7bdf58c5..cca867851 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -83,7 +83,8 @@ class ScanI2C BMM150, TSL2561, DRV2605, - BH1750 + BH1750, + DA217 } DeviceType; // typedef uint8_t DeviceAddress; diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 95ae5d31e..66697c109 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -465,8 +465,23 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) break; SCAN_SIMPLE_CASE(LSM6DS3_ADDR, LSM6DS3, "LSM6DS3", (uint8_t)addr.address); - SCAN_SIMPLE_CASE(TCA9555_ADDR, TCA9555, "TCA9555", (uint8_t)addr.address); SCAN_SIMPLE_CASE(VEML7700_ADDR, VEML7700, "VEML7700", (uint8_t)addr.address); + case TCA9555_ADDR: + registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x01), 1); + if (registerValue == 0x13) { + registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1); + if (registerValue == 0x81) { + type = DA217; + logFoundDevice("DA217", (uint8_t)addr.address); + } else { + type = TCA9555; + logFoundDevice("TCA9555", (uint8_t)addr.address); + } + } else { + type = TCA9555; + logFoundDevice("TCA9555", (uint8_t)addr.address); + } + break; case TSL25911_ADDR: registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x12), 1); if (registerValue == 0x50) {