Platform/ECM3532/M3/hw/csp/ecm3532/m3/csp/src/eta_csp_spi.c
/***************************************************************************/
/**
 *
 *  EtaCspSpiProcessIntCmdDone - Process SPI Interrupt for Command Done
 *
 *  @param iNum the SPI number.
 *
 ******************************************************************************/
Process SPI Interrupt for Command Done
@param iNum the SPI number.
Process SPI Interrupt for Command Done @param iNum the SPI number .
tEtaStatus EtaCspSpiProcessIntCmdDone (tSpiNum iNum)
{
  if ((g_pEtaCspSpiCmd[iNum]->bCmdActive == 0) || (g_pEtaCspSpiCmd[iNum]->ui32TxLen != 0) || (g_pEtaCspSpiCmd[iNum]->ui32RxLen != 0))
  {
#ifdef ETA_CSP_SPI_DEBUG
    ETA_DIAGS_PRINTF("ERROR: received spi_int_done but command is already done or has work left to do. bCmdActive=%x  ui32TxLen=%x  ui32RxLen=%x\r\n", g_pEtaCspSpiCmd[iNum]->bCmdActive, g_pEtaCspSpiCmd[iNum]->ui32TxLen, g_pEtaCspSpiCmd[iNum]->ui32RxLen);
#endif
    return eEtaSpiCmdSequenceErr;
  }
#ifdef ETA_CSP_SPI_DETAILED_DEBUG
  ETA_DIAGS_PRINTF("DETAILED_SPI:SPI command interrupt done\r\n");
#endif
  g_pEtaCspSpiCmd[iNum]->bCmdActive = 0;
  g_pEtaCspSpiCmd[iNum]->spiStatus = eEtaSuccess;
  REGN_M1(iNum, SPI_INT_EN, CMD_IS_DONE_EN0, 0);
  return eEtaSuccess;
}
tEtaStatus EtaCspSpiProcessIntCmdDone ( tSpiNum iNum ) { if ( ( g_pEtaCspSpiCmd [ iNum ] -> bCmdActive == 0 ) || ( g_pEtaCspSpiCmd [ iNum ] -> ui32TxLen != 0 ) || ( g_pEtaCspSpiCmd [ iNum ] -> ui32RxLen != 0 ) ) { #ifdef ETA_CSP_SPI_DEBUG ETA_DIAGS_PRINTF ( " \r \n " , g_pEtaCspSpiCmd [ iNum ] -> bCmdActive , g_pEtaCspSpiCmd [ iNum ] -> ui32TxLen , g_pEtaCspSpiCmd [ iNum ] -> ui32RxLen ) ; #endif return eEtaSpiCmdSequenceErr ; } #ifdef ETA_CSP_SPI_DETAILED_DEBUG ETA_DIAGS_PRINTF ( " \r \n " ) ; #endif g_pEtaCspSpiCmd [ iNum ] -> bCmdActive = 0 ; g_pEtaCspSpiCmd [ iNum ] -> spiStatus = eEtaSuccess ; REGN_M1 ( iNum , SPI_INT_EN , CMD_IS_DONE_EN0 , 0 ) ; return eEtaSuccess ; }
EtaCspSpiProcessIntCmdDone - Process SPI Interrupt for Command Done
  @param iNum the SPI number.
EtaCspSpiProcessIntCmdDone - Process SPI Interrupt for Command Done @param iNum the SPI number .