NXP Reader Library  v17.1.0.2535
ISO/IEC 18092 Mode Passive Initiator

These Components implement the ISO/IEC ISO18092 contactless protocol. Supported mode is passive initiator, i.e. using these components it is possible to communicate with a passive target in peer to peer mode. More...

Collaboration diagram for ISO/IEC 18092 Mode Passive Initiator:

Modules

 Component : Software
 

Macros

#define PHPAL_I18092MPI_DID_MAX   0x0EU
 The last valid DID.
 
#define PHPAL_I18092MPI_WT_MAX   0x0EU
 The maximum allowed WT value, NFCForum-TS-DigitalProtocol-1.0 section 14.11.
 
#define PHPAL_I18092MPI_FSL_MAX   0x03U
 The maximum allowed FSL value.
 
#define PHPAL_I18092MPI_PNI_MAX   0x03U
 The maximum allowed PNI value.
 

Functions

phStatus_t phpalI18092mPI_ResetProtocol (void *pDataParams)
 Reset the ISO18092 protocol parameters. More...
 
phStatus_t phpalI18092mPI_Atr (void *pDataParams, uint8_t *pNfcid3i, uint8_t bDid, uint8_t bLri, uint8_t bNadEnable, uint8_t bNad, uint8_t *pGi, uint8_t bGiLength, uint8_t *pAtrRes, uint8_t *pAtrResLength)
 Perform an ISO18092 "Attribute Request" command. More...
 
phStatus_t phpalI18092mPI_Psl (void *pDataParams, uint8_t bDsi, uint8_t bDri, uint8_t bFsl)
 Perform an ISO18092 "Parameter Select" command. More...
 
phStatus_t phpalI18092mPI_ActivateCard (void *pDataParams, uint8_t *pNfcid3i, uint8_t bDid, uint8_t bNadEnable, uint8_t bNad, uint8_t bDsi, uint8_t bDri, uint8_t bFsl, uint8_t *pGi, uint8_t bGiLength, uint8_t *pAtrRes, uint8_t *pAtrResLength)
 Perform an ISO18092 ATR and PSL command. More...
 
phStatus_t phpalI18092mPI_Deselect (void *pDataParams, uint8_t bDeselectCommand)
 Deselect ISO18092 target by either sending DSL or RLS request. More...
 
phStatus_t phpalI18092mPI_PresCheck (void *pDataParams)
 Perform presence check for current target. More...
 
phStatus_t phpalI18092mPI_Exchange (void *pDataParams, uint16_t wOption, uint8_t *pTxBuffer, uint16_t wTxLength, uint8_t **ppRxBuffer, uint16_t *pRxLength)
 Perform ISO18092 Data Exchange with target. More...
 
phStatus_t phpalI18092mPI_SetConfig (void *pDataParams, uint16_t wConfig, uint16_t wValue)
 Set configuration parameter. More...
 
phStatus_t phpalI18092mPI_GetConfig (void *pDataParams, uint16_t wConfig, uint16_t *pValue)
 Get configuration parameter. More...
 
phStatus_t phpalI18092mPI_GetSerialNo (void *pDataParams, uint8_t *pNfcId3Out)
 Retrieve the serial number (NFC ID3). More...
 

ISO18092 Mode Passive Initiator Parameters

#define PHPAL_I18092MPI_CONFIG_PACKETNO   0x0000U
 Set / Get packet number.
 
#define PHPAL_I18092MPI_CONFIG_DID   0x0001U
 Set / Get Device Identifier.
 
#define PHPAL_I18092MPI_CONFIG_NAD   0x0002U
 Set / Get Node Address. More...
 
#define PHPAL_I18092MPI_CONFIG_WT   0x0003U
 Set / Get Waiting Time.
 
#define PHPAL_I18092MPI_CONFIG_FSL   0x0004U
 Set / Get Frame Length.
 
#define PHPAL_I18092MPI_CONFIG_MAXRETRYCOUNT   0x0005U
 Set / Get Maximum Retry Count.
 

Values for #phpalI18092mPI_Deselect \c bDeselectCommand parameter.

#define PHPAL_I18092MPI_DESELECT_DSL   0x08U
 DSL is sent for deselection of target.
 
#define PHPAL_I18092MPI_DESELECT_RLS   0x0AU
 RLS is sent for deselection of target.
 

DRI/DSI (BRI/BSI) Values

#define PHPAL_I18092MPI_DATARATE_106   0x00U
 DRI/DSI value for 106 kBit/s.
 
#define PHPAL_I18092MPI_DATARATE_212   0x01U
 DRI/DSI value for 212 kBit/s.
 
#define PHPAL_I18092MPI_DATARATE_424   0x02U
 DRI/DSI value for 424 kBit/s.
 

FSL/LRI Values

#define PHPAL_I18092MPI_FRAMESIZE_64   0x00U
 FSL value for max. More...
 
#define PHPAL_I18092MPI_FRAMESIZE_128   0x01U
 FSL value for max. More...
 
#define PHPAL_I18092MPI_FRAMESIZE_192   0x02U
 FSL value for max. More...
 
#define PHPAL_I18092MPI_FRAMESIZE_254   0x03U
 FSL value for max. More...
 

Maximum Values

#define PHPAL_I18092MPI_MAX_GI_LENGTH   48U
 Maximum length of Gi data. More...
 

Detailed Description

These Components implement the ISO/IEC ISO18092 contactless protocol. Supported mode is passive initiator, i.e. using these components it is possible to communicate with a passive target in peer to peer mode.

Macro Definition Documentation

◆ PHPAL_I18092MPI_CONFIG_NAD

#define PHPAL_I18092MPI_CONFIG_NAD   0x0002U

Set / Get Node Address.

wValue is parsed as follows:

* NadEnabled = (wValue & 0xFF00) ? 1 : 0;
* Nad = (wValue & 0x00FF);
* 

◆ PHPAL_I18092MPI_FRAMESIZE_64

#define PHPAL_I18092MPI_FRAMESIZE_64   0x00U

FSL value for max.

framesize of 64 Bytes.

◆ PHPAL_I18092MPI_FRAMESIZE_128

#define PHPAL_I18092MPI_FRAMESIZE_128   0x01U

FSL value for max.

framesize of 128 Bytes.

◆ PHPAL_I18092MPI_FRAMESIZE_192

#define PHPAL_I18092MPI_FRAMESIZE_192   0x02U

FSL value for max.

framesize of 192 Bytes.

◆ PHPAL_I18092MPI_FRAMESIZE_254

#define PHPAL_I18092MPI_FRAMESIZE_254   0x03U

FSL value for max.

framesize of 254 Bytes.

◆ PHPAL_I18092MPI_MAX_GI_LENGTH

#define PHPAL_I18092MPI_MAX_GI_LENGTH   48U

Maximum length of Gi data.


Function Documentation

◆ phpalI18092mPI_ResetProtocol()

phStatus_t phpalI18092mPI_ResetProtocol ( void *  pDataParams)

Reset the ISO18092 protocol parameters.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.

◆ phpalI18092mPI_Atr()

phStatus_t phpalI18092mPI_Atr ( void *  pDataParams,
uint8_t pNfcid3i,
uint8_t  bDid,
uint8_t  bLri,
uint8_t  bNadEnable,
uint8_t  bNad,
uint8_t pGi,
uint8_t  bGiLength,
uint8_t pAtrRes,
uint8_t pAtrResLength 
)

Perform an ISO18092 "Attribute Request" command.

The following values for bLri are possible:

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_PROTOCOL_ERRORReceived response is not ISO/IEC 18092 compliant.
PH_ERR_IO_TIMEOUTTimeout waiting for reply, e.g. target removal.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]pNfcid3i[In] NFCID3 - randomly generated in case of 106kbps initial datarate or NFCID2 in case of 212/424kbps datarate; uint8_t[10]
[in]bDid[In] Device Identifier; '0' to disable usage else 1-14.
[in]bLri[In] Length Reduction of Initiator; 0-3
[in]bNadEnable[In] Enable usage of Node Address; Unequal '0' to enable.
[in]bNad[In] Node Address; Ignored if bNadEnabled is equal '0'.
[in]pGi[In] Optional General Information bytes.
[in]bGiLength[In] Number of General Information bytes; Not more than PHPAL_I18092MPI_MAX_GI_LENGTH.
[out]pAtrRes[Out] Attribute Response; uint8_t[64].
[out]pAtrResLength[Out] Attribute Response Length.

◆ phpalI18092mPI_Psl()

phStatus_t phpalI18092mPI_Psl ( void *  pDataParams,
uint8_t  bDsi,
uint8_t  bDri,
uint8_t  bFsl 
)

Perform an ISO18092 "Parameter Select" command.

The following values for bDri and bDsi are possible:

The following values for bFsl are possible:

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_PROTOCOL_ERRORReceived response is not ISO/IEC 18092 compliant.
PH_ERR_IO_TIMEOUTTimeout waiting for reply, e.g. target removal.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bDsi[In] Divisor Send (target to initiator) Integer; 0-2
[in]bDri[In] Divisor Receive (initiator to target) Integer; 0-2
[in]bFsl[In] Frame Length Byte; 0-3

◆ phpalI18092mPI_ActivateCard()

phStatus_t phpalI18092mPI_ActivateCard ( void *  pDataParams,
uint8_t pNfcid3i,
uint8_t  bDid,
uint8_t  bNadEnable,
uint8_t  bNad,
uint8_t  bDsi,
uint8_t  bDri,
uint8_t  bFsl,
uint8_t pGi,
uint8_t  bGiLength,
uint8_t pAtrRes,
uint8_t pAtrResLength 
)

Perform an ISO18092 ATR and PSL command.

The following values for bDri and bDsi are possible:

The following values for bFsl are possible:

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful, target activated.
PH_ERR_PROTOCOL_ERRORReceived response is not ISO/IEC 18092 compliant.
PH_ERR_IO_TIMEOUTTimeout waiting for reply, e.g. target removal.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]pNfcid3i[In] NFCID3 - any number in case of 106kbps initial datarate. For 212/424kbps datarate bytes 0 - 7 have to be NFCID2, bytes 8 - 9 need to be set to 0; uint8_t[10]
[in]bDid[In] Device Identifier; '0' to disable usage else 1-14.
[in]bNadEnable[In] Enable usage of Node Address; Unequal '0' to enable.
[in]bNad[In] Node Address; Ignored if bNadEnabled is equal '0'.
[in]bDsi[In] Divisor Send (target to initiator) Integer; 0-7
[in]bDri[In] Divisor Receive (initiator to target) Integer; 0-7
[in]bFsl[In] Frame Length Byte; 0-3
[in]pGi[In] Optional General Information bytes.
[in]bGiLength[In] Number of General Information bytes.
[out]pAtrRes[Out] Attribute Response; uint8_t[64].
[out]pAtrResLength[Out] Attribute Response Length.

◆ phpalI18092mPI_Deselect()

phStatus_t phpalI18092mPI_Deselect ( void *  pDataParams,
uint8_t  bDeselectCommand 
)

Deselect ISO18092 target by either sending DSL or RLS request.

The following values for bDeselectCommand are possible:

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful, target deselected.
PH_ERR_PROTOCOL_ERRORReceived response is not ISO/IEC 18092 compliant.
PH_ERR_IO_TIMEOUTTimeout waiting for reply, e.g. target removal.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bDeselectCommand[In] Request to send, either PHPAL_I18092MPI_DESELECT_DSL or PHPAL_I18092MPI_DESELECT_RLS.

◆ phpalI18092mPI_PresCheck()

phStatus_t phpalI18092mPI_PresCheck ( void *  pDataParams)

Perform presence check for current target.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful, target is present.
PH_ERR_PROTOCOL_ERRORReceived response is not ISO/IEC 18092 compliant.
PH_ERR_IO_TIMEOUTTimeout waiting for reply, e.g. target removal.
PHPAL_I18092MPI_ERR_RECOVERY_FAILEDRecovery failed, target does not respond any more.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.

◆ phpalI18092mPI_Exchange()

phStatus_t phpalI18092mPI_Exchange ( void *  pDataParams,
uint16_t  wOption,
uint8_t pTxBuffer,
uint16_t  wTxLength,
uint8_t **  ppRxBuffer,
uint16_t pRxLength 
)

Perform ISO18092 Data Exchange with target.

wOption can be one of:

Additionally, the following options are also available:

Alternatively to the FIRST/CONT/LAST options, the following bits can be combined:

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_PROTOCOL_ERRORReceived response is not ISO/IEC 18092 compliant.
PH_ERR_IO_TIMEOUTTimeout waiting for reply, e.g. target removal.
PHPAL_I18092MPI_ERR_RECOVERY_FAILEDRecovery failed, target does not respond any more.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wOption[In] Option parameter.
[in]pTxBuffer[In] Data to transmit.
[in]wTxLength[In] Length of data to transmit.
[out]ppRxBuffer[Out] Pointer to received data.
[out]pRxLength[Out] number of received data bytes.

◆ phpalI18092mPI_SetConfig()

phStatus_t phpalI18092mPI_SetConfig ( void *  pDataParams,
uint16_t  wConfig,
uint16_t  wValue 
)

Set configuration parameter.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wConfig[In] Configuration Identifier.
[in]wValue[In] Configuration Value.

◆ phpalI18092mPI_GetConfig()

phStatus_t phpalI18092mPI_GetConfig ( void *  pDataParams,
uint16_t  wConfig,
uint16_t pValue 
)

Get configuration parameter.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wConfig[In] Configuration Identifier.
[out]pValue[Out] Configuration Value.

◆ phpalI18092mPI_GetSerialNo()

phStatus_t phpalI18092mPI_GetSerialNo ( void *  pDataParams,
uint8_t pNfcId3Out 
)

Retrieve the serial number (NFC ID3).

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[out]pNfcId3Out[Out] last NFCID3; uint8_t[10].