NXP NFC Reader Library v4.040.05.011646

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

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

Collaboration diagram for ISO/IEC 14443-3A:

## Modules
| Component : Software

## Macros
#define | PHPAL_I14443P3A_CASCADE_LEVEL_1 0x93
| Cascade Level 1 code for ISO14443-3A anticollision/select command. More...
#define | PHPAL_I14443P3A_CASCADE_LEVEL_2 0x95
| Cascade Level 2 code for ISO14443-3A anticollision/select command. More...
#define | PHPAL_I14443P3A_CASCADE_LEVEL_3 0x97
| Cascade Level 3 code for ISO14443-3A anticollision/select command. More...
#define | PHPAL_I14443P3A_TIMEOUT_DEFAULT_MS 10
| Timeout after card selection in milliseconds. More...

## Functions
phStatus_t | phpalI14443p3a_SetConfig (void *pDataParams, uint16_t wConfig, uint16_t wValue)
| Set configuration parameter. More...
phStatus_t | phpalI14443p3a_GetConfig (void *pDataParams, uint16_t wConfig, uint16_t *pValue)
| Get configuration parameter. More...
phStatus_t | phpalI14443p3a_RequestA (void *pDataParams, uint8_t *pAtqa)
| Perform a ISO14443-3A Request command. More...
phStatus_t | phpalI14443p3a_WakeUpA (void *pDataParams, uint8_t *pAtqa)
| Perform a ISO14443-3A Wakeup command. More...
phStatus_t | phpalI14443p3a_HaltA (void *pDataParams)
| Perform a ISO14443-3A Halt command. More...
phStatus_t | phpalI14443p3a_Anticollision (void *pDataParams, uint8_t bCascadeLevel, uint8_t *pUidIn, uint8_t bNvbUidIn, uint8_t *pUidOut, uint8_t *pNvbUidOut)
| Perform a ISO14443-3A Anticollision or Select command. More...
phStatus_t | phpalI14443p3a_Select (void *pDataParams, uint8_t bCascadeLevel, uint8_t *pUidIn, uint8_t *pSak)
| Perform a ISO14443-3A Select command. More...
phStatus_t | phpalI14443p3a_ActivateCard (void *pDataParams, uint8_t *pUidIn, uint8_t bLenUidIn, uint8_t *pUidOut, uint8_t *pLenUidOut, uint8_t *pSak, uint8_t *pMoreCardsAvailable)
| Perform ISO14443-3A ReqA or WupA and Anticollision/Select commands for all cascade levels. More...
phStatus_t | phpalI14443p3a_Exchange (void *pDataParams, uint16_t wOption, uint8_t *pTxBuffer, uint16_t wTxLength, uint8_t **ppRxBuffer, uint16_t *pRxLength)
| Perform ISO14443-3A Data Exchange with Picc. More...
phStatus_t | phpalI14443p3a_GetSerialNo (void *pDataParams, uint8_t *pUidOut, uint8_t *pLenUidOut)
| Retrieve the serial number. More...

## Poll Command
#define | PHPAL_I14443P3A_USE_REQA 0x00U
| Indicate REQA command to be used for Type A Polling.
#define | PHPAL_I14443P3A_USE_WUPA 0x01U
| Indicate WakeupA command to be used for Type A Polling.

## Configuration
#define | PHPAL_I14443P3A_CONFIG_OPE_MODE 0x001U
| Configure Operation Mode for this Layer. More...
#define | PHPAL_I14443P3A_CONFIG_POLL_CMD 0x002U
| Configure which command to be used for Type A Polling. More...
#define | PHPAL_I14443P3A_CONFIG_TIMEOUT_VALUE_US 0x003U
| Configure timeout in microseconds. More...

## Detailed Description

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

## Macro Definition Documentation

## § PHPAL_I14443P3A_CASCADE_LEVEL_1

#define PHPAL_I14443P3A_CASCADE_LEVEL_1 0x93

Cascade Level 1 code for ISO14443-3A anticollision/select command.

## § PHPAL_I14443P3A_CASCADE_LEVEL_2

#define PHPAL_I14443P3A_CASCADE_LEVEL_2 0x95

Cascade Level 2 code for ISO14443-3A anticollision/select command.

## § PHPAL_I14443P3A_CASCADE_LEVEL_3

#define PHPAL_I14443P3A_CASCADE_LEVEL_3 0x97

Cascade Level 3 code for ISO14443-3A anticollision/select command.

## § PHPAL_I14443P3A_TIMEOUT_DEFAULT_MS

#define PHPAL_I14443P3A_TIMEOUT_DEFAULT_MS 10

Timeout after card selection in milliseconds.

## § PHPAL_I14443P3A_CONFIG_OPE_MODE

#define PHPAL_I14443P3A_CONFIG_OPE_MODE 0x001U

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_I14443P3A_CONFIG_POLL_CMD

#define PHPAL_I14443P3A_CONFIG_POLL_CMD 0x002U

Configure which command to be used for Type A Polling.

Possible values are
PHPAL_I14443P3A_USE_REQA,
PHPAL_I14443P3A_USE_WUPA,
Default value is PHPAL_I14443P3A_USE_REQA.

## § PHPAL_I14443P3A_CONFIG_TIMEOUT_VALUE_US

#define PHPAL_I14443P3A_CONFIG_TIMEOUT_VALUE_US 0x003U

Configure timeout in microseconds.

This shall be used by AL layers to set timeout for commands.

## Function Documentation

## § phpalI14443p3a_SetConfig()

phStatus_t phpalI14443p3a_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 layers parameter structure.
  [in] | wConfig | Configuration Identifier.
  [in] | wValue | Configuration Value.

## § phpalI14443p3a_GetConfig()

phStatus_t phpalI14443p3a_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 layers parameter structure.
  [in] | wConfig | Configuration Identifier.
  [out] | pValue | Configuration Value.

## § phpalI14443p3a_RequestA()

phStatus_t phpalI14443p3a_RequestA | ( | void * | pDataParams,
|  | uint8_t * | pAtqa
| ) |  |

Perform a ISO14443-3A Request command.

Note: The "Request Guard Time" (see 6.2.2, 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.

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 layer's parameter structure.
  [out] | pAtqa | AtqA; uint8_t[2].

## § phpalI14443p3a_WakeUpA()

phStatus_t phpalI14443p3a_WakeUpA | ( | void * | pDataParams,
|  | uint8_t * | pAtqa
| ) |  |

Perform a ISO14443-3A Wakeup command.

Note: The "Request Guard Time" (see 6.2.2, 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.

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 layer's parameter structure.
  [out] | pAtqa | AtqA; uint8_t[2].

## § phpalI14443p3a_HaltA()

phStatus_t phpalI14443p3a_HaltA | ( | void * | pDataParams | ) |

Perform a ISO14443-3A 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 layer's parameter structure.

## § phpalI14443p3a_Anticollision()

phStatus_t phpalI14443p3a_Anticollision | ( | void * | pDataParams,
|  | uint8_t | bCascadeLevel,
|  | uint8_t * | pUidIn,
|  | uint8_t | bNvbUidIn,
|  | uint8_t * | pUidOut,
|  | uint8_t * | pNvbUidOut
| ) |  |

Perform a ISO14443-3A Anticollision or Select command.

bNvbUidIn != 0x40: Perform Anticollision command.
bNvbUidIn = 0x40: Perform Select command.

Returns
  Status code

Return values

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

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | bCascadeLevel | cascade level code.
  [in] | pUidIn | known Uid, can be NULL; uint8_t[0-4].
  [in] | bNvbUidIn | number of valid bits of UidIn. MSB codes the valid bytes, LSB codes the valid bits.
  [out] | pUidOut | complete Uid; uint8_t[4].
  [out] | pNvbUidOut | number of valid bits of UidOut. MSB codes the valid bytes, LSB codes the valid bits.

## § phpalI14443p3a_Select()

phStatus_t phpalI14443p3a_Select | ( | void * | pDataParams,
|  | uint8_t | bCascadeLevel,
|  | uint8_t * | pUidIn,
|  | uint8_t * | pSak
| ) |  |

Perform a ISO14443-3A Select 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 layer's parameter structure.
  [in] | bCascadeLevel | cascade level code.
  [in] | pUidIn | Uid; uint8_t[4].
  [out] | pSak | Select Acknowledge; uint8_t.

## § phpalI14443p3a_ActivateCard()

phStatus_t phpalI14443p3a_ActivateCard | ( | void * | pDataParams,
|  | uint8_t * | pUidIn,
|  | uint8_t | bLenUidIn,
|  | uint8_t * | pUidOut,
|  | uint8_t * | pLenUidOut,
|  | uint8_t * | pSak,
|  | uint8_t * | pMoreCardsAvailable
| ) |  |

Perform ISO14443-3A ReqA or WupA and Anticollision/Select commands for all cascade levels.

If bLenUidIn is '0' –> CardUid not given, a ReqA is performed. If CardUid is given, a WupA is performed.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_PROTOCOL_ERROR | Invalid response received.
  PH_ERR_FRAMING_ERROR | Bcc invalid.
  PH_ERR_LENGTH_ERROR | Given `pUidIn` is not complete.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | pUidIn | known Uid, can be NULL if bLenUidIn is 0; uint8_t[4/7/10].
  [in] | bLenUidIn | Length of known Uid; 0/4/7/10.
  [out] | pUidOut | complete Uid; uint8_t[10].
  [out] | pLenUidOut | Length of Uid; 4/7/10.
  [out] | pSak | Select Acknowledge; uint8_t.
  [out] | pMoreCardsAvailable | Whether there are more cards in the field or not; uint8_t.

## § phpalI14443p3a_Exchange()

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

Perform ISO14443-3A 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 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.

## § phpalI14443p3a_GetSerialNo()

phStatus_t phpalI14443p3a_GetSerialNo | ( | void * | pDataParams,
|  | uint8_t * | pUidOut,
|  | uint8_t * | pLenUidOut
| ) |  |

Retrieve the serial number.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_USE_CONDITION | No Serial number available at the moment.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [out] | pUidOut | Last Uid; uint8_t[10].
  [out] | pLenUidOut | Length of Uid; 4/7/10.