NXP NFC Reader Library v4.040.05.011646

Modules | Functions
ISO/IEC 14443-3B
Protocol Abstraction Layer

These Components implement the ISO/IEC 14443-3 Type-B contactless protocol. More...

Collaboration diagram for ISO/IEC 14443-3B:

## Modules
| Component : Software

## Functions
phStatus_t | phpalI14443p3b_SetConfig (void *pDataParams, uint16_t wConfig, uint16_t wValue)
| Set configuration value. More...
phStatus_t | phpalI14443p3b_GetConfig (void *pDataParams, uint16_t wConfig, uint16_t *pValue)
| Get configuration value. More...
phStatus_t | phpalI14443p3b_RequestB (void *pDataParams, uint8_t bNumSlots, uint8_t bAfi, uint8_t bExtAtqb, uint8_t *pAtqb, uint8_t *pAtqbLen)
| Perform a ISO14443-3B Request command. More...
phStatus_t | phpalI14443p3b_WakeUpB (void *pDataParams, uint8_t bNumSlots, uint8_t bAfi, uint8_t bExtAtqb, uint8_t *pAtqb, uint8_t *pAtqbLen)
| Perform a ISO14443-3B Wakeup command. More...
phStatus_t | phpalI14443p3b_SlotMarker (void *pDataParams, uint8_t bSlotNumber, uint8_t *pAtqb, uint8_t *pAtqbLen)
| Perform a ISO14443-3B Slot-MARKER command. More...
phStatus_t | phpalI14443p3b_HaltB (void *pDataParams)
| Perform a ISO14443-3B Halt command. More...
phStatus_t | phpalI14443p3b_Attrib (void *pDataParams, uint8_t *pAtqb, uint8_t bAtqbLen, uint8_t bFsdi, uint8_t bCid, uint8_t bDri, uint8_t bDsi, uint8_t *pMbli)
| Perform a ISO14443-3B Attrib command. More...
phStatus_t | phpalI14443p3b_ActivateCard (void *pDataParams, uint8_t *pPupi, uint8_t bPupiLength, uint8_t bNumSlots, uint8_t bAfi, uint8_t bExtAtqb, uint8_t bFsdi, uint8_t bCid, uint8_t bDri, uint8_t bDsi, uint8_t *pAtqb, uint8_t *pAtqbLen, uint8_t *pMbli, uint8_t *pMoreCardsAvailable)
| Perform ISO14443-3B ReqB or WupB and Anticollision/Select commands for all cascade levels. More...
phStatus_t | phpalI14443p3b_Exchange (void *pDataParams, uint16_t wOption, uint8_t *pTxBuffer, uint16_t wTxLength, uint8_t **ppRxBuffer, uint16_t *pRxLength)
| Perform ISO14443-3B Data Exchange with Picc. More...
phStatus_t | phpalI14443p3b_GetSerialNo (void *pDataParams, uint8_t *pPupi)
| Retrieve the serial number. More...
phStatus_t | phpalI14443p3b_SetSerialNo (void *pDataParams, uint8_t *pPupi)
| This function will update PUPI in this layer's parameter structure. More...
phStatus_t | phpalI14443p3b_SetHigherLayerInf (void *pDataParams, uint8_t *pTxBuffer, uint16_t wTxLength, uint8_t *pRxBuffer, uint16_t wRxBufSize)
| Set higher layer information. More...
phStatus_t | phpalI14443p3b_GetHigherLayerResp (void *pDataParams, uint8_t **ppRxBuffer, uint16_t *pRxLength)
| Get higher layer response. More...
phStatus_t | phpalI14443p3b_GetProtocolParams (void *pDataParams, uint8_t *pCidEnabled, uint8_t *pCid, uint8_t *pNadSupported, uint8_t *pFwi, uint8_t *pFsdi, uint8_t *pFsci)
| Retrieve the ISO14443-3B protocol parameters. More...

## 14443-3B constant definitions
#define | PHPAL_I14443P3B_CONFIG_ATTRIB_PARAM1 0x0000U
| Set or get the AttribB param1 byte. More...

## Configuration
#define | PHPAL_I14443P3B_CONFIG_OPE_MODE 0x0001U
| Configure Operation Mode for this Layer. More...
#define | PHPAL_I14443P3B_CONFIG_POLL_CMD 0x0002U
| Configure which command to be used for Type B Polling. More...
#define | PHPAL_I14443P3B_CONFIG_ATTRIB_RETRY_COUNT 0x0003U
| Configure retry count for ATTRIB command. More...

## Poll Command
#define | PHPAL_I14443P3B_USE_REQB 0x00U
| Indicate REQB command to be used for Type B Polling.
#define | PHPAL_I14443P3B_USE_WUPB 0x01U
| Indicate WakeupB command to be used for Type B Polling.

## DRI/DSI Values
#define | PHPAL_I14443P3B_DATARATE_106 0x00U
| DRI/DSI value for 106 kBit/s.
#define | PHPAL_I14443P3B_DATARATE_212 0x01U
| DRI/DSI value for 212 kBit/s.
#define | PHPAL_I14443P3B_DATARATE_424 0x02U
| DRI/DSI value for 424 kBit/s.
#define | PHPAL_I14443P3B_DATARATE_848 0x03U
| DRI/DSI value for 848 kBit/s.
#define | PHPAL_I14443P3B_DATARATE_FORCE 0x80U
| Flag that forces the use of the given baud rates.

## Attrib Command Retry Values
#define | PHPAL_I14443P3B_ATTRIB_RETRY_MAX 1
| Maximum retry value of ATTRIB during transmission and timeout error. More...
#define | PHPAL_I14443P3B_ATTRIB_RETRY_MIN 0
| Minimum retry value of ATTRIB during transmission and timeout error. More...

## Detailed Description

These Components implement the ISO/IEC 14443-3 Type-B contactless protocol.

Note: The "Timing before the PCD SOF" (see 7.1.7, ISO/IEC 14443-3:2009(E)) is mandatory and is neither implemented here nor implemented in every Hardware Abstraction Layer layer.
Make sure that either the used HAL or the used application does comply to this rule.

## Macro Definition Documentation

## § PHPAL_I14443P3B_CONFIG_ATTRIB_PARAM1

#define PHPAL_I14443P3B_CONFIG_ATTRIB_PARAM1 0x0000U

Set or get the AttribB param1 byte.

## § PHPAL_I14443P3B_CONFIG_OPE_MODE

#define PHPAL_I14443P3B_CONFIG_OPE_MODE 0x0001U

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.

## § PHPAL_I14443P3B_CONFIG_POLL_CMD

#define PHPAL_I14443P3B_CONFIG_POLL_CMD 0x0002U

Configure which command to be used for Type B Polling.

Possible values are
PHPAL_I14443P3B_USE_WUPB,
PHPAL_I14443P3B_USE_REQB,
Default value is PHPAL_I14443P3B_USE_REQB.

## § PHPAL_I14443P3B_CONFIG_ATTRIB_RETRY_COUNT

#define PHPAL_I14443P3B_CONFIG_ATTRIB_RETRY_COUNT 0x0003U

Configure retry count for ATTRIB command.

Possible values are
PHPAL_I14443P3B_ATTRIB_RETRY_MIN,
PHPAL_I14443P3B_ATTRIB_RETRY_MAX,
Default value is PHPAL_I14443P3B_ATTRIB_RETRY_MAX.
For mode RD_LIB_MODE_EMVCO retry count should be 1.

## § PHPAL_I14443P3B_ATTRIB_RETRY_MAX

#define PHPAL_I14443P3B_ATTRIB_RETRY_MAX 1

Maximum retry value of ATTRIB during transmission and timeout error.

## § PHPAL_I14443P3B_ATTRIB_RETRY_MIN

#define PHPAL_I14443P3B_ATTRIB_RETRY_MIN 0

Minimum retry value of ATTRIB during transmission and timeout error.

## Function Documentation

## § phpalI14443p3b_SetConfig()

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

Set configuration value.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_PROTOCOL_ERROR | Invalid response received.
  Other | Depending on implementation and underlying component.

Parameters

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

## § phpalI14443p3b_GetConfig()

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

Get configuration value.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_PROTOCOL_ERROR | Invalid response received.
  Other | Depending on implementation and underlying component.

Parameters

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

## § phpalI14443p3b_RequestB()

phStatus_t phpalI14443p3b_RequestB | ( | void * | pDataParams,
|  | uint8_t | bNumSlots,
|  | uint8_t | bAfi,
|  | uint8_t | bExtAtqb,
|  | uint8_t * | pAtqb,
|  | uint8_t * | pAtqbLen
| ) |  |

Perform a ISO14443-3B Request command.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_PROTOCOL_ERROR | Invalid response received.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layers parameter structure.
  [in] | bNumSlots | Number of slots.
  [in] | bAfi | AFI; Application Family Indentifier.
  [in] | bExtAtqb | Enable Extended AtqB.
  [out] | pAtqb | AtqB; uint8_t[13].
  [out] | pAtqbLen | length of ATQB (12/13 bytes).

## § phpalI14443p3b_WakeUpB()

phStatus_t phpalI14443p3b_WakeUpB | ( | void * | pDataParams,
|  | uint8_t | bNumSlots,
|  | uint8_t | bAfi,
|  | uint8_t | bExtAtqb,
|  | uint8_t * | pAtqb,
|  | uint8_t * | pAtqbLen
| ) |  |

Perform a ISO14443-3B Wakeup command.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_PROTOCOL_ERROR | Invalid response received.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layers parameter structure.
  [in] | bNumSlots | Number of slots.
  [in] | bAfi | AFI; Application Family Indentifier.
  [in] | bExtAtqb | Enable Extended AtqB.
  [out] | pAtqb | AtqB; uint8_t[12/13].
  [out] | pAtqbLen | length of ATQB (12/13 bytes).

## § phpalI14443p3b_SlotMarker()

phStatus_t phpalI14443p3b_SlotMarker | ( | void * | pDataParams,
|  | uint8_t | bSlotNumber,
|  | uint8_t * | pAtqb,
|  | uint8_t * | pAtqbLen
| ) |  |

Perform a ISO14443-3B Slot-MARKER command.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_PROTOCOL_ERROR | Invalid response received.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layers parameter structure.
  [in] | bSlotNumber | Slot Number.
  [out] | pAtqb | AtqB; uint8_t[12/13].
  [out] | pAtqbLen | length of ATQB (12/13 bytes).

## § phpalI14443p3b_HaltB()

phStatus_t phpalI14443p3b_HaltB | ( | void * | pDataParams | ) |

Perform a ISO14443-3B Halt command.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_PROTOCOL_ERROR | Invalid response received.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layers parameter structure.

## § phpalI14443p3b_Attrib()

phStatus_t phpalI14443p3b_Attrib | ( | void * | pDataParams,
|  | uint8_t * | pAtqb,
|  | uint8_t | bAtqbLen,
|  | uint8_t | bFsdi,
|  | uint8_t | bCid,
|  | uint8_t | bDri,
|  | uint8_t | bDsi,
|  | uint8_t * | pMbli
| ) |  |

Perform a ISO14443-3B Attrib command.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_PROTOCOL_ERROR | Invalid response received.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layers parameter structure.
  [in] | pAtqb | Atqb from ReqB/WupB; uint8_t[12/13].
  [in] | bAtqbLen | Length of Atqb.
  [in] | bFsdi | Frame Size Integer; 0-8.
  [in] | bCid | Card Identifier; 0-14.
  [in] | bDri | Divisor Receive (PCD to PICC) Integer; 0-3.
  [in] | bDsi | Divisor Send (PICC to PCD) Integer; 0-3.
  [out] | pMbli | MBLI byte; uint8_t.

## § phpalI14443p3b_ActivateCard()

phStatus_t phpalI14443p3b_ActivateCard | ( | void * | pDataParams,
|  | uint8_t * | pPupi,
|  | uint8_t | bPupiLength,
|  | uint8_t | bNumSlots,
|  | uint8_t | bAfi,
|  | uint8_t | bExtAtqb,
|  | uint8_t | bFsdi,
|  | uint8_t | bCid,
|  | uint8_t | bDri,
|  | uint8_t | bDsi,
|  | uint8_t * | pAtqb,
|  | uint8_t * | pAtqbLen,
|  | uint8_t * | pMbli,
|  | uint8_t * | pMoreCardsAvailable
| ) |  |

Perform ISO14443-3B ReqB or WupB and Anticollision/Select commands for all cascade levels.

If bLenUidIn is '0' –> CardUid not given, a ReqB is performed. If CardUid is given, a WupB is performed.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_PROTOCOL_ERROR | Invalid response received.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layers parameter structure.
  [in] | pPupi | Pointer to the known PUPI; uint8_t[4].
  [in] | bPupiLength | Length of given PUPI, only a value of 0 or 4 is allowed.
  [in] | bNumSlots | Number of slots.
  [in] | bAfi | AFI; Application Family Indentifier.
  [in] | bExtAtqb | Enable Extended AtqB.
  [in] | bFsdi | Frame Size Integer; 0-8.
  [in] | bCid | Card Identifier; 0-14.
  [in] | bDri | Divisor Receive (PCD to PICC) Integer; 0-3.
  [in] | bDsi | Divisor Send (PICC to PCD) Integer; 0-3.
  [out] | pAtqb | AtqB; uint8_t[13].
  [out] | pAtqbLen | length of ATQB (12/13 bytes).
  [out] | pMbli | MBLI byte; uint8_t.
  [out] | pMoreCardsAvailable | Whether there are more cards in the field or not; uint8_t.

## § phpalI14443p3b_Exchange()

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

Perform ISO14443-3B Data Exchange with Picc.

`wOption` can be one of:

- PH_EXCHANGE_DEFAULT
- PH_EXCHANGE_BUFFER_FIRST
- PH_EXCHANGE_BUFFER_CONT
- PH_EXCHANGE_BUFFER_LAST

Alternatively, 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 layers 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.

## § phpalI14443p3b_GetSerialNo()

phStatus_t phpalI14443p3b_GetSerialNo | ( | void * | pDataParams,
|  | uint8_t * | pPupi
| ) |  |

Retrieve the serial number.

This function will provide 4 byte PUPI.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_USE_CONDITION | No PUPI available.

Parameters

  [in] | pDataParams | Pointer to this layers parameter structure.
  [out] | pPupi | Most recent PUPI.

## § phpalI14443p3b_SetSerialNo()

phStatus_t phpalI14443p3b_SetSerialNo | ( | void * | pDataParams,
|  | uint8_t * | pPupi
| ) |  |

This function will update PUPI in this layer's parameter structure.

This function must be called with valid PUPI. Once set the subsequent type B commands use this PUPI.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.

Parameters

  [in] | pDataParams | Pointer to this layers parameter structure.
  [in] | pPupi | 4 byte PUPI.

## § phpalI14443p3b_SetHigherLayerInf()

phStatus_t phpalI14443p3b_SetHigherLayerInf | ( | void * | pDataParams,
|  | uint8_t * | pTxBuffer,
|  | uint16_t | wTxLength,
|  | uint8_t * | pRxBuffer,
|  | uint16_t | wRxBufSize
| ) |  |

Set higher layer information.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_USE_CONDITION | Feature not available.

Parameters

  [in] | pDataParams | Pointer to this layers parameter structure.
  [in] | pTxBuffer | Higher layer Information; Can be NULL if /c wTxLength is 0.
  [in] | wTxLength | Length of the Higher layer Information. Can be 0.
  [in] | pRxBuffer | Higher layer response buffer.
  [in] | wRxBufSize | Size of Higher layer response buffer.

## § phpalI14443p3b_GetHigherLayerResp()

phStatus_t phpalI14443p3b_GetHigherLayerResp | ( | void * | pDataParams,
|  | uint8_t ** | ppRxBuffer,
|  | uint16_t * | pRxLength
| ) |  |

Get higher layer response.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_USE_CONDITION | Feature not available.

Parameters

  [in] | pDataParams | Pointer to this layers parameter structure.
  [out] | ppRxBuffer | Higher layer response.
  [out] | pRxLength | Length of Higher layer response.

## § phpalI14443p3b_GetProtocolParams()

phStatus_t phpalI14443p3b_GetProtocolParams | ( | void * | pDataParams,
|  | uint8_t * | pCidEnabled,
|  | uint8_t * | pCid,
|  | uint8_t * | pNadSupported,
|  | uint8_t * | pFwi,
|  | uint8_t * | pFsdi,
|  | uint8_t * | pFsci
| ) |  |

Retrieve the ISO14443-3B protocol parameters.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.

Parameters

  [in] | pDataParams | Pointer to this layers parameter structure.
  [out] | pCidEnabled | Unequal '0' if Card Identifier is enabled.
  [out] | pCid | Card Identifier.
  [out] | pNadSupported | Node Address Support; Unequal '0' if supported.
  [out] | pFwi | Frame Waiting Integer.
  [out] | pFsdi | PCD Frame Size Integer; 0-8.
  [out] | pFsci | PICC Frame Size Integer; 0-8.