becky_s Wire.endTransmission() returns 3 - received NACK on transmit of data.
hmm that would make me think that it correctly gets an ACK when sending the address, which would mean that the wiring and pullups should be OK ... If that's the case, then this makes it even more mysterious.
I am not familiar with that, but if you are looking to try it out, here is a basic implementation without Trill library. This uses the STM32 HAL, but it should be straightforward to port to any I2C library you may want to try.
enum {
kOffsetCommand = 0,
kOffsetData = 4
};
enum {
kCommandNone = 0,
kCommandMode = 1,
kCommandScanSettings = 2,
kCommandPrescaler = 3,
kCommandNoiseThreshold = 4,
kCommandIdac = 5,
kCommandBaselineUpdate = 6,
kCommandMinimumSize = 7,
kCommandAdjacentCentroidNoiseThreshold = 8,
kCommandAutoScanInterval = 16,
kCommandIdentify = 255
};
enum {
kModeCentroid = 0,
kModeRaw = 1,
kModeBaseline = 2,
kModeDiff = 3
};
uint8_t identifyBuf[] = {kOffsetCommand, kCommandIdentify};
int ret = HAL_I2C_Master_Transmit(&trillHi2c, gI2cAddress, identifyBuf, sizeof(identifyBuf), kTimeout);
HAL_Delay(10);
uint8_t receiveBuffer[4];
ret = HAL_I2C_Master_Receive(&trillHi2c, gI2cAddress, receiveBuffer, sizeof(receiveBuffer), kTimeout);
printf("identify: %#4x %#4x %#4x %#4x\n\r", receiveBuffer[0], receiveBuffer[1], receiveBuffer[2], receiveBuffer[3]);
HAL_Delay(10);
// set to centroid mode (you can use Raw, Diff instead)
uint8_t diffBuf[] = {kOffsetCommand, kCommandMode, kModeCentroid};
ret = HAL_I2C_Master_Transmit(&trillHi2c, gI2cAddress, diffBuf, sizeof(diffBuf), kTimeout);
// prepare to read data
uint8_t transmitBuffer[] = {kOffsetData};
ret = HAL_I2C_Master_Transmit(&trillHi2c, gI2cAddress, transmitBuffer, sizeof(transmitBuffer), kTimeout);
// then read `enough` data. `enough` should be 2 bytes per touch (in Centroid mode) or 2 bytes per pad (in any other mode)
uint8_t receiveBuffer[enough];
ret = HAL_I2C_Master_Receive(&trillHi2c, gI2cAddress, receiveBuffer, sizeof(receiveBuffer), kTimeout);