Avoid SDA/SCL low during pin config

This commit is contained in:
bjoernQ 2023-06-26 11:06:01 +02:00
parent a562863cde
commit bd157fe3f0
2 changed files with 6 additions and 2 deletions

View File

@ -54,6 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed wrong variable access (FOSC CLK calibration for ESP32-C6 #593)
- Fixed [trap location in ram](https://github.com/esp-rs/esp-hal/pull/605#issuecomment-1604039683) (#605)
- Fixed a possible overlap of `.data` and `.rwtext` (#616)
- Avoid SDA/SCL being low while configuring pins for I2C
### Changed

View File

@ -250,7 +250,10 @@ where
let mut i2c = I2C { peripheral: i2c };
// initialize SCL first to not confuse some devices like MPU6050
// avoid SCL/SDA going low during configuration
scl.set_output_high(true);
sda.set_output_high(true);
scl.set_to_open_drain_output()
.enable_input(true)
.internal_pull_up(true)