This change uses the `_RST` bit of the i2c peripheral to force the hardware into power on reset state. The prior code assumed the peripheral was already in a reset, it just cleared the reset bit.
Chuck.
The existing code did not follow protocol with 10bit addressed devices. Per _Philps/NXP Semiconductors UM10204 I2C-bus specification and user manual Rev. 6 4April2014_ pg.15 3.1.11 10-bit addressing:
~The first seven bits of the first byte are the combination of 1111 0xx of which the last two bits (xx) are the two Most-Significant Bits (MSB) of the 10-bit address; the eighth bit of the first byte is the R/!W! bit the determines the direction of the message~
The i2cWrite() function was returning to the app before the i2c transaction had completed. This caused the next Wire() call to return a I2C_ERROR_BUSY.
* Addition of a i2cReset method and timeout handling for the case where the i2c hardware FSM (state machine) gets stuck in a busy state.
* Use newly added i2cReset function within the wire library.
IDF Options:
- Autostart Arduino (implements app_main)
- Disable HAL locks
- Set HAL debug level
- Auto-connect STA if configured (else will connect after WiFi.begin())