- i2c->hw->base->CR1 |= CR1_STOP_SET;
-}
-
-static void i2c_stm32_start(struct I2c *i2c, uint16_t slave_addr)
-{
- i2c->hw->cached = false;
-
- if (I2C_TEST_START(i2c->flags) == I2C_START_W)
- {
- /*
- * Loop on the select write sequence: when the eeprom is busy
- * writing previously sent data it will reply to the SLA_W
- * control byte with a NACK. In this case, we must
- * keep trying until the eeprom responds with an ACK.
- */
- ticks_t start = timer_clock();
- while (i2c_hw_restart(i2c))
- {
- i2c->hw->base->DR = slave_addr & OAR1_ADD0_RESET;
-
- if(check_i2cStatus(i2c, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED))
- break;
-
- if (timer_clock() - start > ms_to_ticks(CONFIG_I2C_START_TIMEOUT))
- {
- LOG_ERR("Timeout on I2C START\n");
- i2c->errors |= I2C_NO_ACK;
- i2c_hw_stop(i2c);
- break;
- }
- }
-
- }
- else if (I2C_TEST_START(i2c->flags) == I2C_START_R)
+ /*
+ * Loop on the select write sequence: when the eeprom is busy
+ * writing previously sent data it will reply to the SLA_W
+ * control byte with a NACK. In this case, we must
+ * keep trying until the eeprom responds with an ACK.
+ */
+ ticks_t start = timer_clock();
+ while (true)