/* Checks whether the specified I2C interrupt has occurred or not.  */
INTStatus I2C_GetIntStatus(I2C_Module *I2Cx, uint32_t I2C_IT)
/* Checks whether the specified I2C interrupt has occurred or not.  */
INTStatus I2C_GetIntStatus(I2C_Module *I2Cx, uint32_t I2C_IT)
{
    INTStatus bitstatus   = RESET;
    uint32_t enablestatus = 0;
    assert_param(IS_I2C_PERIPH(I2Cx));
    assert_param(IS_I2C_GET_INT(I2C_IT));
    enablestatus = (uint32_t)(((I2C_IT & INTEN_MASK) >> 16) & (I2Cx->CTRL2));
    I2C_IT &= FLAG_MASK;
    if (((I2Cx->STS1 & I2C_IT) != (uint32_t)RESET) && enablestatus)
    {
        bitstatus = SET;
    }
    else
    {
        bitstatus = RESET;
    }
    return bitstatus;
}