Platform/ECM3532/M3/hw/csp/ecm3532/m3/csp/src/eta_csp_spi.c
/***************************************************************************/
/**
 *
 * EtaCspSpiTxReadyPoll - Poll for TX ready.
 *
 * @param iNum SPI instance number
 * @return Return the status.
 *
 ******************************************************************************/
Poll for TX ready.
@param iNum SPI instance number
@return Return the status.
Poll for TX ready . @param iNum SPI instance number @return Return the status .
tEtaStatus
EtaCspSpiTxReadyPoll(tSpiNum iNum)
{
    uint32_t ui32Timeout = 10000000;
    while((--ui32Timeout) && (REG_SPI_STATUS(iNum).BF.TXFIFO_HAS_1SPACE == 0))
    {
    }
    if(ui32Timeout == 0)
    {
#ifdef ETA_CSP_SPI_DEBUG
        ETA_DIAGS_PRINTF("ERROR: Time out waiting for SPI%d TX (STATUS=%x)" \
                          "\r\n", !!iNum, REG_SPI_STATUS(iNum).V);
#endif
        return(eEtaSpiSendTimeout);
    }
    else
    {
        return(eEtaSuccess);
    }
}
tEtaStatus EtaCspSpiTxReadyPoll ( tSpiNum iNum ) { uint32_t ui32Timeout = 10000000 ; while ( ( -- ui32Timeout ) && ( REG_SPI_STATUS ( iNum ) . BF . TXFIFO_HAS_1SPACE == 0 ) ) { } if ( ui32Timeout == 0 ) { #ifdef ETA_CSP_SPI_DEBUG ETA_DIAGS_PRINTF ( " " " \r \n " , ! ! iNum , REG_SPI_STATUS ( iNum ) . V ) ; #endif return ( eEtaSpiSendTimeout ) ; } else { return ( eEtaSuccess ) ; } }
EtaCspSpiTxReadyPoll - Poll for TX ready.
EtaCspSpiTxReadyPoll - Poll for TX ready .
// In the extremes, this should // be 10,000 bit times.