STM32 I2C: Fix some spelling; duplicate I2C reset fix on other variants of the driver
This commit is contained in:
parent
36edaaa502
commit
550e0f945b
@ -1833,8 +1833,8 @@ static int stm32_i2c_reset(FAR struct i2c_master_s *dev)
|
||||
unsigned int stretch_count;
|
||||
uint32_t scl_gpio;
|
||||
uint32_t sda_gpio;
|
||||
uint32_t frequency;
|
||||
int ret = ERROR;
|
||||
uint32_t freqency;
|
||||
|
||||
ASSERT(dev);
|
||||
|
||||
@ -1848,7 +1848,7 @@ static int stm32_i2c_reset(FAR struct i2c_master_s *dev)
|
||||
|
||||
/* Save the current frequency */
|
||||
|
||||
freqency = priv->frequency;
|
||||
frequency = priv->frequency;
|
||||
|
||||
/* De-init the port */
|
||||
|
||||
@ -1931,7 +1931,7 @@ static int stm32_i2c_reset(FAR struct i2c_master_s *dev)
|
||||
|
||||
/* Restore the frequecncy */
|
||||
|
||||
stm32_i2c_setclock(priv, freqency);
|
||||
stm32_i2c_setclock(priv, frequency);
|
||||
ret = OK;
|
||||
|
||||
out:
|
||||
|
@ -1987,6 +1987,11 @@ static int stm32_i2c_init(FAR struct stm32_i2c_priv_s *priv)
|
||||
*/
|
||||
|
||||
stm32_i2c_putreg(priv, STM32_I2C_CR2_OFFSET, (STM32_PCLK1_FREQUENCY / 1000000));
|
||||
|
||||
/* Force a frequency update */
|
||||
|
||||
priv->frequency = 0;
|
||||
|
||||
stm32_i2c_setclock(priv, 100000);
|
||||
|
||||
/* Enable I2C */
|
||||
@ -2276,6 +2281,7 @@ static int stm32_i2c_reset(FAR struct i2c_master_s * dev)
|
||||
unsigned int stretch_count;
|
||||
uint32_t scl_gpio;
|
||||
uint32_t sda_gpio;
|
||||
uint32_t frequency;
|
||||
int ret = ERROR;
|
||||
|
||||
ASSERT(dev);
|
||||
@ -2288,6 +2294,10 @@ static int stm32_i2c_reset(FAR struct i2c_master_s * dev)
|
||||
|
||||
stm32_i2c_sem_wait(priv);
|
||||
|
||||
/* Save the current frequency */
|
||||
|
||||
frequency = priv->frequency;
|
||||
|
||||
/* De-init the port */
|
||||
|
||||
stm32_i2c_deinit(priv);
|
||||
@ -2363,6 +2373,10 @@ static int stm32_i2c_reset(FAR struct i2c_master_s * dev)
|
||||
/* Re-init the port */
|
||||
|
||||
stm32_i2c_init(priv);
|
||||
|
||||
/* Restore the frequecncy */
|
||||
|
||||
stm32_i2c_setclock(priv, frequency);
|
||||
ret = OK;
|
||||
|
||||
out:
|
||||
|
@ -1580,6 +1580,10 @@ static int stm32_i2c_init(FAR struct stm32_i2c_priv_s *priv)
|
||||
* or 4 MHz for 400 kHz. This also disables all I2C interrupts.
|
||||
*/
|
||||
|
||||
/* Force a frequency update */
|
||||
|
||||
priv->frequency = 0;
|
||||
|
||||
/* TODO: f303 i2c clock source RCC_CFGR3 */
|
||||
/* RCC_CFGR3_I2C1SW (default is HSI clock) */
|
||||
|
||||
@ -1832,6 +1836,7 @@ static int stm32_i2c_reset(FAR struct i2c_master_s * dev)
|
||||
unsigned int stretch_count;
|
||||
uint32_t scl_gpio;
|
||||
uint32_t sda_gpio;
|
||||
uint32_t frequency;
|
||||
int ret = ERROR;
|
||||
|
||||
ASSERT(dev);
|
||||
@ -1844,6 +1849,10 @@ static int stm32_i2c_reset(FAR struct i2c_master_s * dev)
|
||||
|
||||
stm32_i2c_sem_wait(priv);
|
||||
|
||||
/* Save the current frequency */
|
||||
|
||||
frequency = priv->frequency;
|
||||
|
||||
/* De-init the port */
|
||||
|
||||
stm32_i2c_deinit(priv);
|
||||
@ -1919,6 +1928,10 @@ static int stm32_i2c_reset(FAR struct i2c_master_s * dev)
|
||||
/* Re-init the port */
|
||||
|
||||
stm32_i2c_init(priv);
|
||||
|
||||
/* Restore the frequecncy */
|
||||
|
||||
stm32_i2c_setclock(priv, frequency);
|
||||
ret = OK;
|
||||
|
||||
out:
|
||||
|
Loading…
Reference in New Issue
Block a user