NXP Reader Library  v17.1.0.2535

I2C Peripheral Command of HAL DUT Command dispatcher frame. More...

Collaboration diagram for Command_I2C:

Modules

 Command_Codes
 I2C Command Codes of HAL DUT Command dispatcher frame.
 

Functions

phStatus_t phhalHw_DUT_Cmd_I2C_Exchange (phhalHw_DUT_DataParams_t *pDataParams, uint16_t wOption, uint16_t wSlaveAddr, uint8_t *pTxBuff, uint16_t wTxLen, uint16_t wBytesToRead, uint8_t **ppRxBuff, uint16_t *pRxLen)
 Perform Data Exchange with I2C slave device. More...
 
phStatus_t phhalHw_DUT_Cmd_I2C_Transmit (phhalHw_DUT_DataParams_t *pDataParams, uint16_t wOption, uint16_t wSlaveAddr, uint8_t *pTxBuff, uint16_t wTxLen)
 Perform Transmission of data to I2C slave device. More...
 
phStatus_t phhalHw_DUT_Cmd_I2C_Receive (phhalHw_DUT_DataParams_t *pDataParams, uint16_t wOption, uint16_t wSlaveAddr, uint16_t wBytesToRead, uint8_t **ppRxBuff, uint16_t *pRxLen)
 Perform Reception of Data from I2C Slave device. More...
 
phStatus_t phhalHw_DUT_Cmd_I2C_Start (phhalHw_DUT_DataParams_t *pDataParams)
 Perform I2C Start Sequence. More...
 
phStatus_t phhalHw_DUT_Cmd_I2C_Stop (phhalHw_DUT_DataParams_t *pDataParams)
 Perform I2C Stop Sequence. More...
 
phStatus_t phhalHw_DUT_Cmd_I2C_RepeatedStart (phhalHw_DUT_DataParams_t *pDataParams)
 Perform I2C Repeated Start Sequence. More...
 

Detailed Description

I2C Peripheral Command of HAL DUT Command dispatcher frame.

Note
  • These commands are for exchanging the information via I2C peripheral of the hardware.
  • By using these commands the Interface state of PICC / Tag or ContactCard will not be altered.
  • These commands are specifically for the I2C device that is connected to I2C master of the Reader.
  • Can be used to communicate to SAM connected using I2C interface. Here user needs to provide SAM commands framed in I2C protocol header as specified in Global Platform specification for I2C.

Function Documentation

◆ phhalHw_DUT_Cmd_I2C_Exchange()

phStatus_t phhalHw_DUT_Cmd_I2C_Exchange ( phhalHw_DUT_DataParams_t pDataParams,
uint16_t  wOption,
uint16_t  wSlaveAddr,
uint8_t pTxBuff,
uint16_t  wTxLen,
uint16_t  wBytesToRead,
uint8_t **  ppRxBuff,
uint16_t pRxLen 
)

Perform Data Exchange with I2C slave device.

This command is used to exchange information to I2C Slave device and at the same time receives the payload from I2C slave device if available, including the Status.

wOption can be one of:

  • Normal Exchange
    • Default To frame and exchange the complete payload information to I2C Slave device and also receives the payload from I2C Slave device if available.
    • Buffer Initial Payload To buffer initial payload information. This payload can have the Command header of I2C Slave device. Here the information is not exchanged with I2C Slave device.
    • Buffer Intermediate Payload To buffer intermediate payload information. This payload contains only the Data part for I2C Slave device (if any). Here the information is not exchanged with I2C Slave device.
    • Buffer Final and Exchange To buffer final payload information. This payload contains only the Data part for I2C Slave device (if any). Here the complete buffered information is exchanged to I2C Slave device and also receives the information from I2C Slave device if available.

  • Chained Exchange
    • Chained Transmission
      • To send any pending payload to DUT.
      • If DUT requires more data, then DUT will respond with Require More Data as status for the current exchange call. The interface should be called for this flag until DUT returns Complete as status.
    • Chained Reception
      • To receive any pending payload from DUT.
      • To start using this flag, DUT will return More Data Available as status during previous reception. Payload should be received until Complete as status is returned by DUT.

  • wBytesToRead
Returns
Status code
Return values
PH_ERR_SUCCESSCommand successfully executed.
PH_ERR_INTERFACE_ERRORCommunication error.
PH_ERR_BUFFER_OVERFLOWTransmit data length is longer than the allocated transmit buffer size.
PH_ERR_PROTOCOL_ERRORInvalid frame or unexpected receive data length or command code mismatch.
OtherStatus word returned from the reader after the exchange function.
Parameters
[in]pDataParams[In] Pointer to an initialized HAL parameter structure.
[in]wOption[In] Buffering options to perform exchange. Refer description for more details.
[in]wSlaveAddr[In] Slave address of the Device to perform the Exchange.
  • 7Bit Addressing: Will have one byte address with LSB bit representing the Read or Write operation.
    Ex: WriteAddress: 0x92, ReadAddress: 0x93
[in]pTxBuff[In] Payload information to be exchanged / buffers based on wOption information.
[in]wTxLen[In] Length of bytes available in pTxBuff.
[in]wBytesToRead[In] Number of Bytes to read from I2C Device.
[out]ppRxBuff[Out] Information provided by I2C Slave device.
[out]pRxLen[Out] Length of bytes available in ppRxBuff.

◆ phhalHw_DUT_Cmd_I2C_Transmit()

phStatus_t phhalHw_DUT_Cmd_I2C_Transmit ( phhalHw_DUT_DataParams_t pDataParams,
uint16_t  wOption,
uint16_t  wSlaveAddr,
uint8_t pTxBuff,
uint16_t  wTxLen 
)

Perform Transmission of data to I2C slave device.

This command is used to exchange information to I2C Slave device.

wOption can be one of:

  • Normal Exchange
    • Default To frame and exchange the complete payload information to I2C Slave device and also receives the payload from I2C Slave device if available.
    • Buffer Initial Payload To buffer initial payload information. This payload can have the Command header of I2C Slave device. Here the information is not exchanged with I2C Slave device.
    • Buffer Intermediate Payload To buffer intermediate payload information. This payload contains only the Data part for I2C Slave device (if any). Here the information is not exchanged with I2C Slave device.
    • Buffer Final and Exchange To buffer final payload information. This payload contains only the Data part for I2C Slave device (if any). Here the complete buffered information is exchanged to I2C Slave device and also receives the information from I2C Slave device if available.

  • Chained Exchange
    • Chained Transmission
      • To transmit any pending payload to DUT.
      • If DUT requires more data, then DUT will respond with Require More Data as status for the current exchange call. The interface should be called for this flag until DUT returns Complete as status.
Returns
Status code
Return values
PH_ERR_SUCCESSCommand successfully executed.
PH_ERR_INTERFACE_ERRORCommunication error.
PH_ERR_BUFFER_OVERFLOWTransmit data length is longer than the allocated transmit buffer size.
PH_ERR_PROTOCOL_ERRORInvalid frame or unexpected receive data length or command code mismatch.
OtherStatus word returned from the reader after the exchange function.
Parameters
[in]pDataParams[In] Pointer to an initialized HAL parameter structure.
[in]wOption[In] Buffering options to perform exchange. Refer description for more details.
[in]wSlaveAddr[In] Slave address of the Device to perform the Exchange.
  • 7Bit Addressing: Will have one byte address with LSB bit representing the Read or Write operation.
    Ex: WriteAddress: 0x92, ReadAddress: 0x93
[in]pTxBuff[In] Payload information to be exchanged / buffers based on wOption information.
[in]wTxLen[In] Length of bytes available in pTxBuff.

◆ phhalHw_DUT_Cmd_I2C_Receive()

phStatus_t phhalHw_DUT_Cmd_I2C_Receive ( phhalHw_DUT_DataParams_t pDataParams,
uint16_t  wOption,
uint16_t  wSlaveAddr,
uint16_t  wBytesToRead,
uint8_t **  ppRxBuff,
uint16_t pRxLen 
)

Perform Reception of Data from I2C Slave device.

This command is used to receive information from I2C Slave device.

wOption can be one of:

  • Normal Exchange
    • Default To frame and exchange the complete payload information to I2C Slave device and also receives the payload from I2C Slave device if available.
    • Buffer Initial Payload To buffer initial payload information. This payload can have the Command header of I2C Slave device. Here the information is not exchanged with I2C Slave device.
    • Buffer Intermediate Payload To buffer intermediate payload information. This payload contains only the Data part for I2C Slave device (if any). Here the information is not exchanged with I2C Slave device.
    • Buffer Final and Exchange To buffer final payload information. This payload contains only the Data part for I2C Slave device (if any). Here the complete buffered information is exchanged to I2C Slave device and also receives the information from I2C Slave device if available.

  • Chained Exchange
    • Chained Reception
      • To receive any pending payload from DUT.
      • To start using this flag, DUT will return More Data Available as status during previous reception. Payload should be received until Complete as status is returned by DUT.

  • wBytesToRead
Returns
Status code
Return values
PH_ERR_SUCCESSCommand successfully executed.
PH_ERR_INTERFACE_ERRORCommunication error.
PH_ERR_PROTOCOL_ERRORInvalid frame or unexpected receive data length or command code mismatch.
OtherStatus word returned from the reader after the exchange function.
Parameters
[in]pDataParams[In] Pointer to an initialized HAL parameter structure.
[in]wOption[In] Buffering options to perform exchange. Refer description for more details.
[in]wSlaveAddr[In] Slave address of the Device to perform the Exchange.
  • 7Bit Addressing: Will have one byte address with LSB bit representing the Read or Write operation.
    Ex: WriteAddress: 0x92, ReadAddress: 0x93
[in]wBytesToRead[In] Number of Bytes to read from I2C Device.
[out]ppRxBuff[Out] Information provided by I2C Slave device.
[out]pRxLen[Out] Length of bytes available in ppRxBuff.

◆ phhalHw_DUT_Cmd_I2C_Start()

phStatus_t phhalHw_DUT_Cmd_I2C_Start ( phhalHw_DUT_DataParams_t pDataParams)

Perform I2C Start Sequence.

Note
Returns
Status code
Return values
PH_ERR_SUCCESSCommand successfully executed.
PH_ERR_INTERFACE_ERRORCommunication error.
PH_ERR_PROTOCOL_ERRORInvalid frame or unexpected receive data length or command code mismatch.
OtherStatus word returned from the reader after the exchange function.
Parameters
[in]pDataParams[In] Pointer to an initialized HAL parameter structure.

◆ phhalHw_DUT_Cmd_I2C_Stop()

phStatus_t phhalHw_DUT_Cmd_I2C_Stop ( phhalHw_DUT_DataParams_t pDataParams)

Perform I2C Stop Sequence.

Returns
Status code
Return values
PH_ERR_SUCCESSCommand successfully executed.
PH_ERR_INTERFACE_ERRORCommunication error.
PH_ERR_PROTOCOL_ERRORInvalid frame or unexpected receive data length or command code mismatch.
OtherStatus word returned from the reader after the exchange function.
Parameters
[in]pDataParams[In] Pointer to an initialized HAL parameter structure.

◆ phhalHw_DUT_Cmd_I2C_RepeatedStart()

phStatus_t phhalHw_DUT_Cmd_I2C_RepeatedStart ( phhalHw_DUT_DataParams_t pDataParams)

Perform I2C Repeated Start Sequence.

Note
Post this interface call any of the below interfaces to perform exchanges.
Returns
Status code
Return values
PH_ERR_SUCCESSCommand successfully executed.
PH_ERR_INTERFACE_ERRORCommunication error.
PH_ERR_PROTOCOL_ERRORInvalid frame or unexpected receive data length or command code mismatch.
OtherStatus word returned from the reader after the exchange function.
Parameters
[in]pDataParams[In] Pointer to an initialized HAL parameter structure.