NXP NFC Reader Library  v4.040.05.011646
ISO/IEC 18092 Mode Initiator

These Components implement the ISO/IEC ISO18092 contact-less protocol. More...

Collaboration diagram for ISO/IEC 18092 Mode Initiator:

Modules

 Component : Software
 

Macros

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

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_Transmit (void *pDataParams, uint16_t wOption, uint8_t *pTxBuffer, uint16_t wTxLength)
 Perform ISO18092 Data Transmit to target. More...
 
phStatus_t phpalI18092mPI_Receive (void *pDataParams, uint16_t wOption, 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...
 
phStatus_t phpalI18092mPI_Wakeup (void *pDataParams)
 Wakeup ISO18092 Active Target by sending WUP request. 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
 Get frame length (FSL) value. More...
 
#define PHPAL_I18092MPI_CONFIG_MAXRETRYCOUNT   0x0005U
 Set / Get maximum retry count.
 
#define PHPAL_I18092MPI_CONFIG_ATN   0x0006U
 Set / Get ATN configuration.
 
#define PHPAL_I18092MPI_CONFIG_ACTIVEMODE   0x0007U
 Get the status if active communication mode is PH_ON / PH_OFF. More...
 

Values for #phpalI18092mPI_Deselect \c bDeselectCommand parameter.

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

DRI/DSI (BRI/BSI) Values

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

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 contact-less 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_DID_MAX

#define PHPAL_I18092MPI_DID_MAX   0x0EU

The last valid DID.

§ PHPAL_I18092MPI_WT_MAX

#define PHPAL_I18092MPI_WT_MAX   0x0EU

The maximum allowed WT value, NFCForum-TS-DigitalProtocol-1.0 section 14.11.

§ PHPAL_I18092MPI_FSL_MAX

#define PHPAL_I18092MPI_FSL_MAX   0x03U

The maximum allowed FSL value.

§ PHPAL_I18092MPI_PNI_MAX

#define PHPAL_I18092MPI_PNI_MAX   0x03U

The maximum allowed PNI value.

§ 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_CONFIG_FSL

#define PHPAL_I18092MPI_CONFIG_FSL   0x0004U

Get frame length (FSL) value.

Indicates either Lri or Lrt value whichever is lesser in case PSL is not exchanged. If PSL is exchanged then the agreed FSL value is returned.

§ PHPAL_I18092MPI_CONFIG_ACTIVEMODE

#define PHPAL_I18092MPI_CONFIG_ACTIVEMODE   0x0007U

Get the status if active communication mode is PH_ON / PH_OFF.


§ PHPAL_I18092MPI_DESELECT_DSL

#define PHPAL_I18092MPI_DESELECT_DSL   0x08U

DSL is sent for deselection of target.

§ PHPAL_I18092MPI_DESELECT_RLS

#define PHPAL_I18092MPI_DESELECT_RLS   0x0AU

RLS is sent for Release of target.

§ PHPAL_I18092MPI_DATARATE_106

#define PHPAL_I18092MPI_DATARATE_106   0x00U

DRI/DSI value for 106 kBit/s.

§ PHPAL_I18092MPI_DATARATE_212

#define PHPAL_I18092MPI_DATARATE_212   0x01U

DRI/DSI value for 212 kBit/s.

§ PHPAL_I18092MPI_DATARATE_424

#define PHPAL_I18092MPI_DATARATE_424   0x02U

DRI/DSI value for 424 kBit/s.

§ 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]pDataParamsPointer 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 underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]pNfcid3iNFCID3 - randomly generated in case of 106kbps initial datarate or NFCID2 in case of 212/424kbps datarate; uint8_t[10]
[in]bDidDevice Identifier; '0' to disable usage else 1-14.
[in]bLriLength Reduction of Initiator; 0-3
[in]bNadEnableEnable usage of Node Address; Unequal '0' to enable.
[in]bNadNode Address; Ignored if bNadEnabled is equal '0'.
[in]pGiOptional General Information bytes.
[in]bGiLengthNumber of General Information bytes; Not more than PHPAL_I18092MPI_MAX_GI_LENGTH.
[out]pAtrResAttribute Response; uint8_t[64].
[out]pAtrResLengthAttribute 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 underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]bDsiDivisor Send (target to initiator) Integer; 0-2
[in]bDriDivisor Receive (initiator to target) Integer; 0-2
[in]bFslFrame 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 underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]pNfcid3iNFCID3 - 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]bDidDevice Identifier; '0' to disable usage else 1-14.
[in]bNadEnableEnable usage of Node Address; Unequal '0' to enable.
[in]bNadNode Address; Ignored if bNadEnabled is equal '0'.
[in]bDsiDivisor Send (target to initiator) Integer; 0-7
[in]bDriDivisor Receive (initiator to target) Integer; 0-7
[in]bFslFrame Length Byte; 0-3
[in]pGiOptional General Information bytes.
[in]bGiLengthNumber of General Information bytes.
[out]pAtrResAttribute Response; uint8_t[64].
[out]pAtrResLengthAttribute 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]pDataParamsPointer to this layer's parameter structure.
[in]bDeselectCommandRequest 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]pDataParamsPointer 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 underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]wOptionOption parameter.
[in]pTxBufferData to transmit.
[in]wTxLengthLength of data to transmit.
[out]ppRxBufferPointer to received data.
[out]pRxLengthnumber of received data bytes.

§ phpalI18092mPI_Transmit()

phStatus_t phpalI18092mPI_Transmit ( void *  pDataParams,
uint16_t  wOption,
uint8_t pTxBuffer,
uint16_t  wTxLength 
)

Perform ISO18092 Data Transmit to 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.
PHPAL_I18092MPI_ERR_RECOVERY_FAILEDRecovery failed, target does not respond any more.
OtherDepending on implementation and underlying component.

§ phpalI18092mPI_Receive()

phStatus_t phpalI18092mPI_Receive ( void *  pDataParams,
uint16_t  wOption,
uint8_t **  ppRxBuffer,
uint16_t pRxLength 
)

Perform ISO18092 Data Exchange with target.

wOption can be one of:

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 underlying component.

§ 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 underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]wConfigConfiguration Identifier.
[in]wValueConfiguration 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 underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]wConfigConfiguration Identifier.
[out]pValueConfiguration 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]pDataParamsPointer to this layer's parameter structure.
[out]pNfcId3Outlast NFCID3; uint8_t[10].

§ phpalI18092mPI_Wakeup()

phStatus_t phpalI18092mPI_Wakeup ( void *  pDataParams)

Wakeup ISO18092 Active Target by sending WUP request.

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.
PHPAL_I18092MPI_ERR_RECOVERY_FAILEDRecovery failed, target does not respond any more.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.