Platform/ECM3532/M3/hw/csp/ecm3532/m3/csp/src/eta_csp_i2c.c
/***************************************************************************/
/**
 *
 *  EtaCspI2cProcessIntCmdDone - Process I2C Interrupt for Command Done
 *
 *  @param iNum the I2C number.
 *
 ******************************************************************************/
Process I2C Interrupt for Command Done
@param iNum the I2C number.
Process I2C Interrupt for Command Done @param iNum the I2C number .
tEtaStatus EtaCspI2cProcessIntCmdDone (tI2cNum iNum)
{
  #ifdef ETA_CSP_I2C_INT_DEBUG
    ETA_DIAGS_PRINTF("DETAILED_I2C:entered EtaCspI2cProcessIntCmdDone\r\n");
  #endif
  if ((g_pEtaCspI2cCmd[iNum]->bCmdActive == 0) || (g_pEtaCspI2cCmd[iNum]->ui32TxLen != 0) || (g_pEtaCspI2cCmd[iNum]->ui32RxLen != 0))
  {
#ifdef ETA_CSP_I2C_DEBUG
    ETA_DIAGS_PRINTF("ERROR: received i2c_int_done but command is already done or has work left to do. bCmdActive=%x  ui32TxLen=%x  ui32RxLen=%x\r\n", g_pEtaCspI2cCmd[iNum]->bCmdActive, g_pEtaCspI2cCmd[iNum]->ui32TxLen, g_pEtaCspI2cCmd[iNum]->ui32RxLen);
#endif
    return eEtaI2cCmdSequenceErr;
  }
  #ifdef ETA_CSP_I2C_INT_DEBUG
   ETA_DIAGS_PRINTF("DETAILED_I2C:I2C command interrupt done\r\n");
  #endif
  g_pEtaCspI2cCmd[iNum]->i2cStatus = eEtaSuccess;
  g_pEtaCspI2cCmd[iNum]->bCmdActive = 0;
  REG_I2C_INT_EN(iNum).V = 0;
  return eEtaSuccess;
}
tEtaStatus EtaCspI2cProcessIntCmdDone ( tI2cNum iNum ) { #ifdef ETA_CSP_I2C_INT_DEBUG ETA_DIAGS_PRINTF ( " \r \n " ) ; #endif if ( ( g_pEtaCspI2cCmd [ iNum ] -> bCmdActive == 0 ) || ( g_pEtaCspI2cCmd [ iNum ] -> ui32TxLen != 0 ) || ( g_pEtaCspI2cCmd [ iNum ] -> ui32RxLen != 0 ) ) { #ifdef ETA_CSP_I2C_DEBUG ETA_DIAGS_PRINTF ( " \r \n " , g_pEtaCspI2cCmd [ iNum ] -> bCmdActive , g_pEtaCspI2cCmd [ iNum ] -> ui32TxLen , g_pEtaCspI2cCmd [ iNum ] -> ui32RxLen ) ; #endif return eEtaI2cCmdSequenceErr ; } #ifdef ETA_CSP_I2C_INT_DEBUG ETA_DIAGS_PRINTF ( " \r \n " ) ; #endif g_pEtaCspI2cCmd [ iNum ] -> i2cStatus = eEtaSuccess ; g_pEtaCspI2cCmd [ iNum ] -> bCmdActive = 0 ; REG_I2C_INT_EN ( iNum ) . V = 0 ; return eEtaSuccess ; }
EtaCspI2cProcessIntCmdDone - Process I2C Interrupt for Command Done
  @param iNum the I2C number.
EtaCspI2cProcessIntCmdDone - Process I2C Interrupt for Command Done @param iNum the I2C number .