I2C: i2cMasterTransmitTimeout() without STOP at the end?
Posted: Mon Nov 10, 2014 11:05 pm
Hi,
I am using I2C on STM32F0, but the question is not platform specific.
I am looking for a way to send write command followed by immediate read command, but without STOP in between.
This is needed for the slave chip I am using - ADV7180. At page 78 of the datasheet is shown the READ sequence. It needs first writing to the slave with one byte the gives the register address, then read from the slave (sending the slave address again). Just to note that the WRITE sequence is easily achievable with single call to i2cMasterTransmitTimeout() and it works fine.
My initial idea (for the READ register) was to perform first i2cMasterTransmitTimeout() and then to make i2cMasterReceiveTimeout(). But the chip refuses the second read with NAK. Comparing my logic analyzer trace with those diagrams at page 78 I saw that I have one STOP condition at the end of the i2cMasterTransmitTimeout(). So I think that this is the reason for getting NAK-ed.
Is there a way to do this with the current I2C API?
I am using I2C on STM32F0, but the question is not platform specific.
I am looking for a way to send write command followed by immediate read command, but without STOP in between.
This is needed for the slave chip I am using - ADV7180. At page 78 of the datasheet is shown the READ sequence. It needs first writing to the slave with one byte the gives the register address, then read from the slave (sending the slave address again). Just to note that the WRITE sequence is easily achievable with single call to i2cMasterTransmitTimeout() and it works fine.
My initial idea (for the READ register) was to perform first i2cMasterTransmitTimeout() and then to make i2cMasterReceiveTimeout(). But the chip refuses the second read with NAK. Comparing my logic analyzer trace with those diagrams at page 78 I saw that I have one STOP condition at the end of the i2cMasterTransmitTimeout(). So I think that this is the reason for getting NAK-ed.
Is there a way to do this with the current I2C API?