NXP NFC Reader Library v4.040.05.011646

Functions
Commands
Hardware Abstraction Layer » component : Rc663

Supported ReaderIC commands. More...

Collaboration diagram for Commands:

## Functions
phStatus_t | phhalHw_Rc663_Cmd_Lpcd (phhalHw_Rc663_DataParams_t *pDataParams)
| Perform Low-Power-Card-Detection. More...
phStatus_t | phhalHw_Rc663_Cmd_Lpcd_GetConfig (phhalHw_Rc663_DataParams_t *pDataParams, uint8_t *pI, uint8_t *pQ)
| Perform Low-Power-Card-Detection Configuration Procedure. More...
phStatus_t | phhalHw_Rc663_Cmd_Lpcd_SetConfig (phhalHw_Rc663_DataParams_t *pDataParams, uint8_t bMode, uint8_t bI, uint8_t bQ, uint16_t wPowerDownTimeMs, uint16_t wDetectionTimeUs)
| Performs a SetConfig. More...
phStatus_t | phhalHw_Rc663_Cmd_LoadKey (phhalHw_Rc663_DataParams_t *pDataParams, uint8_t *pKey)
| Load a MIFARE key into the key-buffer. More...
phStatus_t | phhalHw_Rc663_Cmd_AckReq (phhalHw_Rc663_DataParams_t *pDataParams, uint8_t *pCmdBuffer, uint16_t wLen, uint8_t *pRxBuffer, uint16_t *wRxBufferLen)
| Performs a query, an Ack and a Req-Rn as per ISO 18000-3M3 protocol. More...
phStatus_t | phhalHw_Rc663_Cmd_WriteE2 (phhalHw_Rc663_DataParams_t *pDataParams, uint16_t wAddress, uint8_t bData)
| Write one byte of data to a given EEPROM address. More...
phStatus_t | phhalHw_Rc663_Cmd_WriteE2Page (phhalHw_Rc663_DataParams_t *pDataParams, uint16_t wAddress, uint8_t *pData, uint8_t bDataLen)
| Write a number of data bytes to a given EEPROM page. More...
phStatus_t | phhalHw_Rc663_Cmd_ReadE2 (phhalHw_Rc663_DataParams_t *pDataParams, uint16_t wAddress, uint16_t wNumBytes, uint8_t *pData)
| Read one byte from a given EEPROM address. More...
phStatus_t | phhalHw_Rc663_Cmd_LoadReg (phhalHw_Rc663_DataParams_t *pDataParams, uint16_t wEEAddress, uint8_t bRegAddress, uint8_t bNumBytes)
| Copies a defined number of bytes from the EEPROM into the register set, beginning at the given register address RegAdr. More...
phStatus_t | phhalHw_Rc663_Cmd_LoadProtocol (phhalHw_Rc663_DataParams_t *pDataParams, uint8_t bTxProtocol, uint8_t bRxProtocol)
| Initializes protected registers for a dedicated protocol. More...
phStatus_t | phhalHw_Rc663_Cmd_LoadKeyE2 (phhalHw_Rc663_DataParams_t *pDataParams, uint8_t bKeyNo)
| Load a MIFARE key from EEPROM into the key-buffer. More...
phStatus_t | phhalHw_Rc663_Cmd_StoreKeyE2 (phhalHw_Rc663_DataParams_t *pDataParams, uint8_t bKeyNo, uint8_t *pKeys, uint8_t bNumberOfKeys)
| Write one or more MIFARE key(s) into EEPROM. More...
phStatus_t | phhalHw_Rc663_Cmd_SoftReset (phhalHw_Rc663_DataParams_t *pDataParams)
| Performs a Soft reset. More...

## Low-Power-Card-Detection Modes
#define | PHHAL_HW_RC663_CMD_LPCD_MODE_DEFAULT 0x00U
| Default mode. More...
#define | PHHAL_HW_RC663_CMD_LPCD_MODE_POWERDOWN 0x01U
| Powers down the IC for a certain amount of time and performs LPC after wakeup. More...
#define | PHHAL_HW_RC663_CMD_LPCD_MODE_POWERDOWN_GUARDED 0x02U
| Same as PHHAL_HW_RC663_CMD_LPCD_MODE_POWERDOWN, but uses the timeout set with either PHHAL_HW_CONFIG_TIMING_US or PHHAL_HW_CONFIG_TIMING_MS as abort criteria. More...
#define | PHHAL_HW_RC663_CMD_LPCD_MODE_OPTION_TRIMM_LPO 0x80U
| Or this bit to the desired mode to perform LPO trimming together with the command.
#define | PHHAL_HW_RC663_CMD_LPCD_MODE_OPTION_IGNORE_IQ 0x40U
| Or this bit to the desired mode to prevent the function to set I and Q channel values.
#define | PHHAL_HW_RC663_CMD_LPCD_MODE_OPTION_MASK 0xF0U
| Mask for option bits within Mode byte.

## Detailed Description

Supported ReaderIC commands.

## Macro Definition Documentation

## § PHHAL_HW_RC663_CMD_LPCD_MODE_DEFAULT

#define PHHAL_HW_RC663_CMD_LPCD_MODE_DEFAULT 0x00U

Default mode.

Try LPCD until timeout is reached.

## § PHHAL_HW_RC663_CMD_LPCD_MODE_POWERDOWN

#define PHHAL_HW_RC663_CMD_LPCD_MODE_POWERDOWN 0x01U

Powers down the IC for a certain amount of time and performs LPC after wakeup.

If no card is found the IC is powered down again and the procedure is restarted. If a card is found the function returns and the IC remains powered up.

## § PHHAL_HW_RC663_CMD_LPCD_MODE_POWERDOWN_GUARDED

#define PHHAL_HW_RC663_CMD_LPCD_MODE_POWERDOWN_GUARDED 0x02U

Same as PHHAL_HW_RC663_CMD_LPCD_MODE_POWERDOWN, but uses the timeout set with either PHHAL_HW_CONFIG_TIMING_US or PHHAL_HW_CONFIG_TIMING_MS as abort criteria.

Be advised that the guard-timer in this case is only running during the power-up phases, so the timeout has to be adjusted properly.

## Function Documentation

## § phhalHw_Rc663_Cmd_Lpcd()

phStatus_t phhalHw_Rc663_Cmd_Lpcd | ( | phhalHw_Rc663_DataParams_t * | pDataParams | ) |

Perform Low-Power-Card-Detection.

In default-mode the `bPowerDownTimeMs` and `bDetectionTimeUs` parameters are not used.
The timeout set with PHHAL_HW_CONFIG_TIMEOUT_VALUE_US or PHHAL_HW_CONFIG_TIMEOUT_VALUE_MS is always used as stop-condition.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Card present.
  PH_ERR_IO_TIMEOUT | No card found.
  Other | Depending on implementation and underlying component.

Parameters

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

## § phhalHw_Rc663_Cmd_Lpcd_GetConfig()

phStatus_t phhalHw_Rc663_Cmd_Lpcd_GetConfig | ( | phhalHw_Rc663_DataParams_t * | pDataParams,
|  | uint8_t * | pI,
|  | uint8_t * | pQ
| ) |  |

Perform Low-Power-Card-Detection Configuration Procedure.

Returns the I and Q channel values for the current antenna status. This is inteded to be used to retrieve the I and Q channel values in case of no card on antenna. The values can directly be used as parameters for the phhalHw_Rc663_Cmd_Lpcd function.

Returns
  Status code

Return values

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

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [out] | pI | I-Channel value in case of no card on antenna.
  [out] | pQ | Q-Channel value in case of no card on antenna.

## § phhalHw_Rc663_Cmd_Lpcd_SetConfig()

phStatus_t phhalHw_Rc663_Cmd_Lpcd_SetConfig | ( | phhalHw_Rc663_DataParams_t * | pDataParams,
|  | uint8_t | bMode,
|  | uint8_t | bI,
|  | uint8_t | bQ,
|  | uint16_t | wPowerDownTimeMs,
|  | uint16_t | wDetectionTimeUs
| ) |  |

Performs a SetConfig.

Sets the bMode,I, Q, wPowerDownTimeMs, and wDetectionTimeUs channel values for the current antenna status. This is intended to be used to set the input parameters for LPCD.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | bMode | One of the above LPCD modes.
  [in] | bI | I-Channel value in case of no card on antenna.
  [in] | bQ | Q-Channel value in case of no card on antenna.
  [in] | wPowerDownTimeMs | Power-Down time in milliseconds if power-down mode is used.
  [in] | wDetectionTimeUs | Detection time in microseconds if power-down mode is used.

## § phhalHw_Rc663_Cmd_LoadKey()

phStatus_t phhalHw_Rc663_Cmd_LoadKey | ( | phhalHw_Rc663_DataParams_t * | pDataParams,
|  | uint8_t * | pKey
| ) |  |

Load a MIFARE key into the key-buffer.

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] | pKey | 6 byte MIFARE key.

## § phhalHw_Rc663_Cmd_AckReq()

phStatus_t phhalHw_Rc663_Cmd_AckReq | ( | phhalHw_Rc663_DataParams_t * | pDataParams,
|  | uint8_t * | pCmdBuffer,
|  | uint16_t | wLen,
|  | uint8_t * | pRxBuffer,
|  | uint16_t * | wRxBufferLen
| ) |  |

Performs a query, an Ack and a Req-Rn as per ISO 18000-3M3 protocol.

The complete query (BeginRound) shall be provided as an input in the pCmdBuffer. Refer ISO/IEC FDIS 18000-3:2010(E) section 6.3.3.4.11.2.1 for format of BeginRound command. phpalI18000p3m3_CreateBeginRoundCmd can also be used for creating the BeginRound command. The content of pCmdBuffer is not validated in this API.

All answers to the command are returned back in pRxBuffer.

This implements AckReq command of RC663. See phhalHw_I18000p3m3Inventory for an alternative API designed to facilitate detection of ISO 18000-3M3 tags with more flexibility.

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] | pCmdBuffer | Pointer to query command buffer.
  [in] | wLen | Length of the pCmdBuffer.
  [out] | pRxBuffer | Pointer to receive output of CmdAckReq.
  [out] | wRxBufferLen | Length of the Data read.

## § phhalHw_Rc663_Cmd_WriteE2()

phStatus_t phhalHw_Rc663_Cmd_WriteE2 | ( | phhalHw_Rc663_DataParams_t * | pDataParams,
|  | uint16_t | wAddress,
|  | uint8_t | bData
| ) |  |

Write one byte of data to a given EEPROM address.

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] | wAddress | 2 byte Address; Range is 0x0000 - 0x1FFF.
  [in] | bData | Data byte to write.

## § phhalHw_Rc663_Cmd_WriteE2Page()

phStatus_t phhalHw_Rc663_Cmd_WriteE2Page | ( | phhalHw_Rc663_DataParams_t * | pDataParams,
|  | uint16_t | wAddress,
|  | uint8_t * | pData,
|  | uint8_t | bDataLen
| ) |  |

Write a number of data bytes to a given EEPROM page.

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] | wAddress | 2 byte Address; Range is 0x0000 - 0x007F.
  [in] | pData | Pointer to data byte array.
  [in] | bDataLen | Number of data bytes to write; Range is 1 - 64.

## § phhalHw_Rc663_Cmd_ReadE2()

phStatus_t phhalHw_Rc663_Cmd_ReadE2 | ( | phhalHw_Rc663_DataParams_t * | pDataParams,
|  | uint16_t | wAddress,
|  | uint16_t | wNumBytes,
|  | uint8_t * | pData
| ) |  |

Read one byte from a given EEPROM address.

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] | wAddress | 2 byte Address; Range is 0x0000 - 0x1FFF.
  [in] | wNumBytes | Number of data bytes to read; Range is 0(256) - 256.
  [out] | pData | Requested data bytes.

## § phhalHw_Rc663_Cmd_LoadReg()

phStatus_t phhalHw_Rc663_Cmd_LoadReg | ( | phhalHw_Rc663_DataParams_t * | pDataParams,
|  | uint16_t | wEEAddress,
|  | uint8_t | bRegAddress,
|  | uint8_t | bNumBytes
| ) |  |

Copies a defined number of bytes from the EEPROM into the register set, beginning at the given register address RegAdr.

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] | wEEAddress | 2 byte EEPROM Address; Range is 0x00C0 - 0x17FF.
  [in] | bRegAddress | Register Address; Range is 0x00 - 0xFF.
  [in] | bNumBytes | Number of bytes to copy; Range is 1 - 255.

## § phhalHw_Rc663_Cmd_LoadProtocol()

phStatus_t phhalHw_Rc663_Cmd_LoadProtocol | ( | phhalHw_Rc663_DataParams_t * | pDataParams,
|  | uint8_t | bTxProtocol,
|  | uint8_t | bRxProtocol
| ) |  |

Initializes protected registers for a dedicated protocol.

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] | bTxProtocol | Tx-Protocol (see PHHAL_HW_RC663_RXTX_* defines).
  [in] | bRxProtocol | Rx-Protocol (see PHHAL_HW_RC663_RXTX_* defines).

## § phhalHw_Rc663_Cmd_LoadKeyE2()

phStatus_t phhalHw_Rc663_Cmd_LoadKeyE2 | ( | phhalHw_Rc663_DataParams_t * | pDataParams,
|  | uint8_t | bKeyNo
| ) |  |

Load a MIFARE key from EEPROM into the key-buffer.

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] | bKeyNo | Key number in EEPROM; Range is 0x00 - 0xFF.

## § phhalHw_Rc663_Cmd_StoreKeyE2()

phStatus_t phhalHw_Rc663_Cmd_StoreKeyE2 | ( | phhalHw_Rc663_DataParams_t * | pDataParams,
|  | uint8_t | bKeyNo,
|  | uint8_t * | pKeys,
|  | uint8_t | bNumberOfKeys
| ) |  |

Write one or more MIFARE key(s) into EEPROM.

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] | bKeyNo | Key number in EEPROM; Range is 0x00 - 0xFF.
  [in] | pKeys | Pointer to MIFARE key array.
  [in] | bNumberOfKeys | Number of keys to write.

## § phhalHw_Rc663_Cmd_SoftReset()

phStatus_t phhalHw_Rc663_Cmd_SoftReset | ( | phhalHw_Rc663_DataParams_t * | pDataParams | ) |

Performs a Soft reset.

Note: It is up to the caller to wait until the IC is powered-up and ready again.
In addition to that, the caller should call phhalHw_ApplyProtocolSettings again to re-configure the IC.

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.