I have implemented some PreCheck function, where I check the availability of several chips on the bus. It serves mostly debug and programmers demands.
Code: Select all
snip
data = 0;
for (i2c_addr = 1; i2c_addr < 0x7e; i2c_addr++)
{
res = I2CH_MasterTransmitTimeout(drvp, i2c_addr, &data, 1, NULL, 0, MS2ST(5));
if (res == RDY_OK)
my_printf("%s: Device at %02x\n", __func__, i2c_addr);
else
my_printf("%s: Device NOT at %02x\n", __func__, i2c_addr);
}
The code works perfectly for several devices I had in the past.
Now I have some new Chip, a charger controller. This chip has not all registers as writeable, only very selected regs are readable, some are writable.
If I run the quoted code on this chip, Chibi does not see it, because first it transfers the i2c-address (this is ack'd as I see on the oszi) and afterwards the register is written but this sub-Transaction is not ack'd by the charger-controller.
After all the function fails.
How can I get Chibi to only set the address, and return the result to me?
I also tried to set tx_bytes to 0, does not work?
BR
Marc