Skip to content
Snippets Groups Projects
Commit f9523ce6 authored by EmilioCorigliano's avatar EmilioCorigliano Committed by Alberto Nidasio
Browse files

[I2C] Updated scl/sda pin modes to embed pull-up in f7 driver

parent 894f7125
No related branches found
No related tags found
No related merge requests found
...@@ -356,8 +356,8 @@ I2CDriver::I2CDriver(I2C_TypeDef *i2c, miosix::GpioPin scl, miosix::GpioPin sda) ...@@ -356,8 +356,8 @@ I2CDriver::I2CDriver(I2C_TypeDef *i2c, miosix::GpioPin scl, miosix::GpioPin sda)
// logical values. // logical values.
scl.alternateFunction(I2CConsts::I2C_PIN_ALTERNATE_FUNCTION); scl.alternateFunction(I2CConsts::I2C_PIN_ALTERNATE_FUNCTION);
sda.alternateFunction(I2CConsts::I2C_PIN_ALTERNATE_FUNCTION); sda.alternateFunction(I2CConsts::I2C_PIN_ALTERNATE_FUNCTION);
scl.mode(miosix::Mode::ALTERNATE_OD); scl.mode(miosix::Mode::ALTERNATE_OD_PULL_UP);
sda.mode(miosix::Mode::ALTERNATE_OD); sda.mode(miosix::Mode::ALTERNATE_OD_PULL_UP);
} }
// Checking that this particular I2C port hasn't been already instantiated // Checking that this particular I2C port hasn't been already instantiated
...@@ -642,7 +642,7 @@ void I2CDriver::flushBus() ...@@ -642,7 +642,7 @@ void I2CDriver::flushBus()
// Recovery from the locked state due to a stuck Slave. // Recovery from the locked state due to a stuck Slave.
// We bit-bang 16 clocks on the scl line in order to restore pending // We bit-bang 16 clocks on the scl line in order to restore pending
// packets of the slaves. // 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++) for (size_t c = 0; c < I2CConsts::N_SCL_BITBANG; c++)
...@@ -657,7 +657,7 @@ void I2CDriver::flushBus() ...@@ -657,7 +657,7 @@ void I2CDriver::flushBus()
miosix::FastInterruptDisableLock dLock; miosix::FastInterruptDisableLock dLock;
// We set again the scl pin to the correct Alternate function // 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); scl.alternateFunction(I2CConsts::I2C_PIN_ALTERNATE_FUNCTION);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment