Richard-Gemmell / teensy4_i2c

An I2C library for the Teensy 4. Provides slave and master mode.
MIT License
92 stars 20 forks source link

Busidle fix #9

Closed AndrewCapon closed 4 years ago

AndrewCapon commented 4 years ago

Whenever the LPI2C is enabled, it monitors the I2C bus to detect when the I2C bus is idle (MSR[BBF]). The I2C bus is no longer considered idle if either SCL or SDA are low, and the I2C bus becomes idle if a STOP condition is detected or if a bus idle timeout is detected (as configured by MCFGR2[BUSIDLE]).

From the datasheet page 2751 the minimum BUSIDLE is: (CLKLO+SETHOLD+2) × 2

This PR just changes the BUSIDLE to minimise the delay before the bus is considered idle.