/* Checks whether the specified SPI/I2S interrupt has occurred or not.  */
uint8_t SPI_I2S_ReadIntFlag(SPI_T *spi, SPI_I2S_INT_T flag)
/* Checks whether the specified SPI/I2S interrupt has occurred or not.  */
uint8_t SPI_I2S_ReadIntFlag(SPI_T *spi, SPI_I2S_INT_T flag)
{
    uint32_t intEnable;
    uint32_t intStatus;
    intEnable = (uint32_t)(spi->CTRL2 & (flag>>8));
    intStatus = (uint32_t)(spi->STS & flag);
    if (intEnable && intStatus)
    {
        return SET;
    }
    return RESET;
}