/* Returns 1 if there is no pending write operation on the SPI; otherwise returns 0.  */
unsigned char SPI_IsFinished(AT91S_SPI *pSpi)
/* Returns 1 if there is no pending write operation on the SPI; otherwise returns 0.  */
unsigned char SPI_IsFinished(AT91S_SPI *pSpi)
{
    return ((pSpi->SPI_SR & AT91C_SPI_TXEMPTY) != 0);
}