/* Checks whether the last i2c Event is equal to the one passed as parameter.  */
ErrorStatus I2C_CheckEvent(I2C_TypeDef *i2c, u32 event)
/* Checks whether the last i2c Event is equal to the one passed as parameter.  */
ErrorStatus I2C_CheckEvent(I2C_TypeDef *i2c, u32 event)
{
    if ((event == I2C_EVENT_RX_FULL) && (I2C_CMD_DIR == 0)) {
        i2c->IC_DATA_CMD = I2C_DR_CMD;
        I2C_CMD_DIR       = 1;
    }
    return (ErrorStatus)((i2c->IC_RAW_INTR_STAT & event) == event);
}