Platform/ECM3532/M3/hw/csp/ecm3532/m3/csp/src/eta_csp_i2c.c
/***************************************************************************/
/**
 *
 * EtaCspI2cDeviceAck - Read and or write to an I2C device.
 *
 * @param iNum I2C instance number
 * @param ui8TxData DevAddr and Read(write not) of device to poll for ack
 * @return Return the status.
 *
 ******************************************************************************/
Read and or write to an I2C device.
@param iNum I2C instance number
@param ui8TxData DevAddr and Read(write not) of device to poll for ack
@return Return the status.
Read and or write to an I2C device . @param iNum I2C instance number @param ui8TxData DevAddr and Read ( write not ) of device to poll for ack @return Return the status .
tEtaStatus
EtaCspI2cDeviceAck (tI2cNum iNum, uint8_t ui8TxData){
  tEtaStatus result = eEtaSuccess;
  REG_I2C_CONFIG(iNum).BF.IGNORE_NACK = 1;
  result |= EtaCspI2cTransferPoll(iNum, &ui8TxData, 1, &ui8TxData, 0, 1);
  result |= EtaCspI2cDonePoll(iNum);
  REG_I2C_CONFIG(iNum).BF.IGNORE_NACK = 0;
  if (result)
  {
    return result;
  }
  if (REG_I2C_GENERAL_DEBUG(iNum).BF.LAST_BYTE_HAD_NACK)
    result = eEtaI2cUnexpectedNack;
  else
    result = eEtaSuccess;
  return result;
}
tEtaStatus EtaCspI2cDeviceAck ( tI2cNum iNum , uint8_t ui8TxData ) { tEtaStatus result = eEtaSuccess ; REG_I2C_CONFIG ( iNum ) . BF . IGNORE_NACK = 1 ; result |= EtaCspI2cTransferPoll ( iNum , & ui8TxData , 1 , & ui8TxData , 0 , 1 ) ; result |= EtaCspI2cDonePoll ( iNum ) ; REG_I2C_CONFIG ( iNum ) . BF . IGNORE_NACK = 0 ; if ( result ) { return result ; } if ( REG_I2C_GENERAL_DEBUG ( iNum ) . BF . LAST_BYTE_HAD_NACK ) result = eEtaI2cUnexpectedNack ; else result = eEtaSuccess ; return result ; }
EtaCspI2cDeviceAck - Read and or write to an I2C device.
EtaCspI2cDeviceAck - Read and or write to an I2C device .
// Turn off NACK hold // upper 7 is device id, lower bit is Read (write not) // Turn back on NACK hold