/* Check SPI status. This function check whether the spi status flag has been set.  */
xtBoolean SPIStatCheck(unsigned long ulBase, unsigned long ulFlags)
/* Check SPI status. This function check whether the spi status flag has been set.  */
xtBoolean SPIStatCheck(unsigned long ulBase, unsigned long ulFlags)
{
    xASSERT(ulBase == SPI0_BASE);
    xASSERT( (ulCfg & ~(
                           SPI_ABRT |
                           SPI_MODF |
                           SPI_ROVR |
                           SPI_WCOL |
                           SPI_SPIF
                        )
              ) == 0);
    if(xHWREG(ulBase + S0SPSR) & ulFlags)
    {
        return (xtrue);
    }
    else
    {
        return (xfalse);
    }
}