/* Reset I2C to same state as after a HW reset.  */
void I2C_Reset(I2C_TypeDef *i2c)
/* Reset I2C to same state as after a HW reset.  */
void I2C_Reset(I2C_TypeDef *i2c)
{
  i2c->CTRL      = _I2C_CTRL_RESETVALUE;
  i2c->CLKDIV    = _I2C_CLKDIV_RESETVALUE;
  i2c->SADDR     = _I2C_SADDR_RESETVALUE;
  i2c->SADDRMASK = _I2C_SADDRMASK_RESETVALUE;
  i2c->IEN       = _I2C_IEN_RESETVALUE;
  i2c->IFC       = _I2C_IFC_MASK;
}