mciantyre / teensy4-rs

Rust support for the Teensy 4
Apache License 2.0
271 stars 31 forks source link

I2C lines are not open drain #153

Closed mciantyre closed 7 months ago

mciantyre commented 8 months ago

Describe the bug When the BSP presents I2C drivers to the user, it should ensure that the I2C lines are configured for open drain. As of today, this configuration doesn't happen in imxrt-hal's driver. Therefore, the BSP is leaving the I2C lines in default, push-pull configuration.

To Reproduce Change I2C circuits, and observe that the MCU drives the lines.

Expected behavior I2C controllers continue to communicate with their devices. The MCU does not drive the lines.

Additional context The iomuxc::configure documentation demonstrates one way to define an open drain. The BSP should make sure something like that is happening before the user has access to the driver. It could happen here, or down in the driver.

mciantyre commented 7 months ago

imxrt-iomuxc 0.2.6 will automatically enable an open drain for LPI2C pins. Users affected by this issue should