diff --git a/src/shared/drivers/i2c/I2CDriver-f7.cpp b/src/shared/drivers/i2c/I2CDriver-f7.cpp index 2ef687279bbbe89860c99ed77d2a2d19d493035f..13640f2027bec206405d2f3512aae1df1c50aac5 100644 --- a/src/shared/drivers/i2c/I2CDriver-f7.cpp +++ b/src/shared/drivers/i2c/I2CDriver-f7.cpp @@ -356,8 +356,8 @@ I2CDriver::I2CDriver(I2C_TypeDef *i2c, miosix::GpioPin scl, miosix::GpioPin sda) // logical values. scl.alternateFunction(I2CConsts::I2C_PIN_ALTERNATE_FUNCTION); sda.alternateFunction(I2CConsts::I2C_PIN_ALTERNATE_FUNCTION); - scl.mode(miosix::Mode::ALTERNATE_OD); - sda.mode(miosix::Mode::ALTERNATE_OD); + scl.mode(miosix::Mode::ALTERNATE_OD_PULL_UP); + sda.mode(miosix::Mode::ALTERNATE_OD_PULL_UP); } // Checking that this particular I2C port hasn't been already instantiated @@ -642,7 +642,7 @@ void I2CDriver::flushBus() // Recovery from the locked state due to a stuck Slave. // We bit-bang 16 clocks on the scl line in order to restore pending // packets of the slaves. - scl.mode(miosix::Mode::OPEN_DRAIN); + scl.mode(miosix::Mode::OPEN_DRAIN_PULL_UP); } for (size_t c = 0; c < I2CConsts::N_SCL_BITBANG; c++) @@ -657,7 +657,7 @@ void I2CDriver::flushBus() miosix::FastInterruptDisableLock dLock; // We set again the scl pin to the correct Alternate function - scl.mode(miosix::Mode::ALTERNATE_OD); + scl.mode(miosix::Mode::ALTERNATE_OD_PULL_UP); scl.alternateFunction(I2CConsts::I2C_PIN_ALTERNATE_FUNCTION); }