]> granicus.if.org Git - esp-idf/commit
bugfix(i2c): reduce speed of I2C master bus reset routine and release SDA
authorWangjialin <wangjialin@espressif.com>
Wed, 28 Nov 2018 07:41:46 +0000 (15:41 +0800)
committermorris <maoshengrong@espressif.com>
Tue, 22 Jan 2019 03:43:55 +0000 (11:43 +0800)
commit553ba519249c251925cf569223fee25850a06e64
tree8c3340649f5a9e6b434a2d16ec83c78dcf7e1003
parent929d98538e325e96f0a13d8b3cc5d4a03dd75573
bugfix(i2c): reduce speed of I2C master bus reset routine and release SDA

closes https://github.com/espressif/esp-idf/issues/2494
closes https://github.com/espressif/esp-idf/pull/2493
closes https://github.com/espressif/esp-idf/pull/2496

1. Change bus reset to handle interrupted READ sequences.
2. Slow down I2C to 100khz during reset
3. If a SLAVE device was in a read operation when the bus was interrupted, the SLAVE device is controlling SDA.The only bit during the 9 clock cycles of a byte READ the MASTER(ESP32) is guaranteed control over, is during the ACK bit period.
If the SLAVE is sending a stream of ZERO bytes, it will only release SDA during the ACK bit period. The master(ESP32) cannot generate a STOP unless SDA is HIGH. So, this reset code synchronizes the bit stream with, Either, the ACK bit, Or a 1 bit.
components/driver/i2c.c