NXP NFC Reader Library v4.040.05.011646

Modules | Macros | Functions
ISO/IEC 14443-4
Protocol Abstraction Layer

These Components implement the ISO/IEC 14443-4:2008(E) contactless protocol. More...

Collaboration diagram for ISO/IEC 14443-4:

## Modules
| Component : Software

## Macros
#define | PHPAL_I14443P4_CID_MAX 14
| The last valid CID. More...
#define | PHPAL_I14443P4_FWI_MAX 14
| The maximum allowed FWI value. More...
#define | PHPAL_I14443P4_FRAMESIZE_MAX 12
| The maximum allowed FSDI/FSCI value. More...

## Functions
phStatus_t | phpalI14443p4_SetProtocol (void *pDataParams, uint8_t bCidEnable, uint8_t bCid, uint8_t bNadEnable, uint8_t bNad, uint8_t bFwi, uint8_t bFsdi, uint8_t bFsci)
| Set the ISO14443-4 protocol parameters. More...
phStatus_t | phpalI14443p4_ResetProtocol (void *pDataParams)
| Reset the ISO14443-4 protocol parameters. More...
phStatus_t | phpalI14443p4_Deselect (void *pDataParams)
| Deselect ISO14443-4 card. More...
phStatus_t | phpalI14443p4_PresCheck (void *pDataParams)
| Perform presence check for current card. More...
phStatus_t | phpalI14443p4_Exchange (void *pDataParams, uint16_t wOption, uint8_t *pTxBuffer, uint16_t wTxLength, uint8_t **ppRxBuffer, uint16_t *pRxLength)
| Perform ISO14443-4 Data Exchange with Picc. More...
phStatus_t | phpalI14443p4_SetConfig (void *pDataParams, uint16_t wConfig, uint16_t wValue)
| Set configuration parameter. More...
phStatus_t | phpalI14443p4_GetConfig (void *pDataParams, uint16_t wConfig, uint16_t *pValue)
| Get configuration parameter. More...

## ISO14443-4 Parameters
#define | PHPAL_I14443P4_CONFIG_BLOCKNO 0x0000U
| Set / Get Blocknumber.
#define | PHPAL_I14443P4_CONFIG_CID 0x0001U
| Set / Get Card Identifier. More...
#define | PHPAL_I14443P4_CONFIG_NAD 0x0002U
| Set / Get Node Address. More...
#define | PHPAL_I14443P4_CONFIG_FWI 0x0003U
| Set / Get Frame Waiting Integer.
#define | PHPAL_I14443P4_CONFIG_FSI 0x0004U
| Set / Get PCD & PICC Frame Size Integer. More...
#define | PHPAL_I14443P4_CONFIG_MAXRETRYCOUNT 0x0005U
| Set / Get Maximum Retry Count.
#define | PHPAL_I14443P4_CONFIG_OPE_MODE 0x0006U
| Configure Operation mode. More...

## Detailed Description

These Components implement the ISO/IEC 14443-4:2008(E) contactless protocol.

## Macro Definition Documentation

## § PHPAL_I14443P4_CID_MAX

#define PHPAL_I14443P4_CID_MAX 14

The last valid CID.

## § PHPAL_I14443P4_FWI_MAX

#define PHPAL_I14443P4_FWI_MAX 14

The maximum allowed FWI value.

## § PHPAL_I14443P4_FRAMESIZE_MAX

#define PHPAL_I14443P4_FRAMESIZE_MAX 12

The maximum allowed FSDI/FSCI value.

## § PHPAL_I14443P4_CONFIG_CID

#define PHPAL_I14443P4_CONFIG_CID 0x0001U

Set / Get Card Identifier.

`wValue` is parsed as follows:

    * CidEnabled = (wValue & 0xFF00) ? 1 : 0;
    * Cid = (wValue & 0x00FF);
    *

## § PHPAL_I14443P4_CONFIG_NAD

#define PHPAL_I14443P4_CONFIG_NAD 0x0002U

Set / Get Node Address.

`wValue` is parsed as follows:

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

## § PHPAL_I14443P4_CONFIG_FSI

#define PHPAL_I14443P4_CONFIG_FSI 0x0004U

Set / Get PCD & PICC Frame Size Integer.

`wValue` is parsed as follows:

    * Fsdi = ((wValue & 0xFF00) >> 8);
    * Fsci = (wValue & 0x00FF);
    *

## § PHPAL_I14443P4_CONFIG_OPE_MODE

#define PHPAL_I14443P4_CONFIG_OPE_MODE 0x0006U

Configure Operation mode.

Configure Operation Mode for this Layer.
Possible values are
RD_LIB_MODE_EMVCO,
RD_LIB_MODE_NFC,
RD_LIB_MODE_ISO,
Default value is RD_LIB_MODE_NFC.

## Function Documentation

## § phpalI14443p4_SetProtocol()

phStatus_t phpalI14443p4_SetProtocol | ( | void * | pDataParams,
|  | uint8_t | bCidEnable,
|  | uint8_t | bCid,
|  | uint8_t | bNadEnable,
|  | uint8_t | bNad,
|  | uint8_t | bFwi,
|  | uint8_t | bFsdi,
|  | uint8_t | bFsci
| ) |  |

Set the ISO14443-4 protocol parameters.

This sets the protocol parameters for this layer. It is recommended to input this function with the parameters retrieved from either phpalI14443p4a_GetProtocolParams or phpalI14443p3b_GetProtocolParams respectively after card activation. Note: Refer to the ISO/IEC 14443-4:2008(E) specification for a detailed description of the parameters.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | bCidEnable | Enable usage of Card Identifier; Unequal '0' if enabled.
  [in] | bCid | Card Identifier; Ignored if `bCidEnable` is equal '0'.
  [in] | bNadEnable | Enabler usage of Node Address; Unequal '0' if enabled.
  [in] | bNad | Node Address; Ignored if bNadEnabled is equal '0'.
  [in] | bFwi | Frame Waiting Integer.
  [in] | bFsdi | PCD Frame Size Integer; 0-8
  [in] | bFsci | PICC Frame Size Integer; 0-8

## § phpalI14443p4_ResetProtocol()

phStatus_t phpalI14443p4_ResetProtocol | ( | void * | pDataParams | ) |

Reset the ISO14443-4 protocol parameters.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.

## § phpalI14443p4_Deselect()

phStatus_t phpalI14443p4_Deselect | ( | void * | pDataParams | ) |

Deselect ISO14443-4 card.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.

## § phpalI14443p4_PresCheck()

phStatus_t phpalI14443p4_PresCheck | ( | void * | pDataParams | ) |

Perform presence check for current card.

(Perform R(NAK) polling as defined in ISO 14443-4:2008(E)).

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.

## § phpalI14443p4_Exchange()

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

Perform ISO14443-4 Data Exchange with Picc.

`wOption` can be one of:

- PH_EXCHANGE_DEFAULT
- PH_EXCHANGE_TXCHAINING
- PH_EXCHANGE_RXCHAINING
- PH_EXCHANGE_RXCHAINING_BUFSIZE

Additionally, the following options are also available:

- PH_EXCHANGE_BUFFER_FIRST
- PH_EXCHANGE_BUFFER_CONT
- PH_EXCHANGE_BUFFER_LAST

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

- PH_EXCHANGE_BUFFERED_BIT
- PH_EXCHANGE_LEAVE_BUFFER_BIT

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | wOption | Option parameter.
  [in] | pTxBuffer | Data to transmit.
  [in] | wTxLength | Length of data to transmit.
  [out] | ppRxBuffer | Pointer to received data.
  [out] | pRxLength | number of received data bytes.

## § phpalI14443p4_SetConfig()

phStatus_t phpalI14443p4_SetConfig | ( | void * | pDataParams,
|  | uint16_t | wConfig,
|  | uint16_t | wValue
| ) |  |

Set configuration parameter.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | wConfig | Configuration Identifier
  [in] | wValue | Configuration Value

## § phpalI14443p4_GetConfig()

phStatus_t phpalI14443p4_GetConfig | ( | void * | pDataParams,
|  | uint16_t | wConfig,
|  | uint16_t * | pValue
| ) |  |

Get configuration parameter.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | wConfig | Configuration Identifier
  [out] | pValue | Configuration Value