/* Checks whether the specified interrupt has occurred or not.  */
uint8_t SPI_ReadIntFlag(SPI_T *spi, SPI_INT_FLAG_T flag)
/* Checks whether the specified interrupt has occurred or not.  */
uint8_t SPI_ReadIntFlag(SPI_T *spi, SPI_INT_FLAG_T flag)
{
    uint32_t intEnable;
    uint32_t intStatus;
    intEnable = (uint32_t)(spi->CTRL2 & (uint32_t)(flag >> 16));
    intStatus = (uint32_t)(spi->STS & (uint32_t)(flag & 0x1ff));
    if (intEnable && intStatus)
    {
        return SET;
    }
    return RESET;
}