Platform/ECM3532/M3/hw/csp/ecm3532/m3/csp/src/eta_csp_spi.c
tEtaStatus
EtaCspSpiXmitDonePoll(tSpiNum iNum)
{
    // In the extremes, this should
    // be 10,000 bit times.
    uint32_t ui32Timeout = 10000000;

    while((--ui32Timeout) && (REG_SPI_STATUS(iNum).BF.XMIT_COMPLETE == 0))
    {
    }

    if(ui32Timeout == 0)
    {
#ifdef ETA_CSP_SPI_DEBUG
        ETA_DIAGS_PRINTF("ERROR: Time out waiting for SPI%d XMIT to be done " \
                          "(STATUS=%x)\r\n", !!iNum, REG_SPI_STATUS(iNum).V);
#endif
        return(eEtaSpiDoneTimeout);
    }
    else
    {
        return(eEtaSuccess);
    }
}
/***************************************************************************/
/**
 *
 * EtaCspSpiXmitDonePoll - Poll for All Transmit / Receive to be Done
 *
 * @param iNum SPI instance number
 * @return Return the status.
 *
 ******************************************************************************/
Poll for All Transmit / Receive to be Done
@param iNum SPI instance number
@return Return the status.
Poll for All Transmit / Receive to be Done @param iNum SPI instance number @return Return the status .
tEtaStatus
EtaCspSpiXmitDonePoll(tSpiNum iNum)
{
    uint32_t ui32Timeout = 10000000;
    while((--ui32Timeout) && (REG_SPI_STATUS(iNum).BF.XMIT_COMPLETE == 0))
    {
    }
    if(ui32Timeout == 0)
    {
#ifdef ETA_CSP_SPI_DEBUG
        ETA_DIAGS_PRINTF("ERROR: Time out waiting for SPI%d XMIT to be done " \
                          "(STATUS=%x)\r\n", !!iNum, REG_SPI_STATUS(iNum).V);
#endif
        return(eEtaSpiDoneTimeout);
    }
    else
    {
        return(eEtaSuccess);
    }
}
tEtaStatus EtaCspSpiXmitDonePoll ( tSpiNum iNum ) { uint32_t ui32Timeout = 10000000 ; while ( ( -- ui32Timeout ) && ( REG_SPI_STATUS ( iNum ) . BF . XMIT_COMPLETE == 0 ) ) { } if ( ui32Timeout == 0 ) { #ifdef ETA_CSP_SPI_DEBUG ETA_DIAGS_PRINTF ( " " " \r \n " , ! ! iNum , REG_SPI_STATUS ( iNum ) . V ) ; #endif return ( eEtaSpiDoneTimeout ) ; } else { return ( eEtaSuccess ) ; } }
EtaCspSpiXmitDonePoll - Poll for All Transmit / Receive to be Done
 @param iNum SPI instance number
 @return Return the status.
EtaCspSpiXmitDonePoll - Poll for All Transmit / Receive to be Done @param iNum SPI instance number @return Return the status .
// In the extremes, this should // be 10,000 bit times.