/* Deinitializes the i2c peripheral registers to their default reset values.  */
void I2C_DeInit(I2C_TypeDef *i2c)
/* Deinitializes the i2c peripheral registers to their default reset values.  */
void I2C_DeInit(I2C_TypeDef *i2c)
{
    switch (*(vu32*)&i2c) {
        case (u32)I2C1:
            exRCC_APB1PeriphReset(RCC_APB1ENR_I2C1);
            break;
        case (u32)I2C2:
            exRCC_APB1PeriphReset(RCC_APB1ENR_I2C2);
            break;
        default:
            break;
    }
}