]> granicus.if.org Git - esp-idf/commit
1. Slow down I2C to 100khz During Reset
authorchuck todd <stickbreaker@users.noreply.github.com>
Sun, 30 Sep 2018 20:47:05 +0000 (14:47 -0600)
committermorris <maoshengrong@espressif.com>
Fri, 30 Nov 2018 02:08:28 +0000 (10:08 +0800)
commite55f9c1e98c293fed95d740b1db3735021639cab
treea1a4269934728d103c12ae7bd3921ef4dbf4ae63
parent34c1d25c7ff2a5d5c9acc933e3a07c2fdba06ac4
1. Slow down I2C to 100khz During Reset

I am stealing this delay coding from @jeremyherbert #2493 pr.

2. Change Bus Reset to handle interrupted READ sequences.

The current code does not handle interrupted READ cycles.

 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.

3. fix typo

correct `sda_id` to `sda_io` in `i2c_master_clear_bus()` @ryan-ma found it.  This typo was generated when I manually edited this patch on GitHub, I should have done a Copy/Paste operation!
components/driver/i2c.c