User manual

NXP Semiconductors
UM10663
NXP Reader Library User Manual
UM10663
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2013. All rights reserved.
User Manual
COMPANY PUBLIC
Rev. 1.224 July 2013
257412
10 of 47
2. Exemplary explanation of the library functions
A project defining a CLRC663 Blueboard communication with a MIFARE classic is
herewith explained.
2.1 HAL: CLRC663 commands
2.1.1 General
The reader chip is not able to execute compiled C code, but executes commands of
command set. For that reason the PCD reader is controlled by host device able to
execute the library code (PC or MCU) and sends particular commands to the PCD via
communication bus. In this chapter are described command related functions. Together
with command itself, described functions mostly call many other support routines to
ensure flawless command run. So the described functions are not PCD’s native
commands literally, but larger functions ensuring particular command execution. This
attitude intends to focus developer on most important issues without redundant
knowledge about underlaying functions.
2.1.2 Idle command
This command indicates that the PCD is in idle mode. This command is used to
terminate actually executed command. It also indicates. Unlike other commands this
command does not have its own function. Only way, how to perform the Idle command is
phhalHw_WriteRegister(pDataParams, PHHAL_HW_RC663_REG_COMMAND,
PHHAL_HW_RC663_CMD_IDLE));
2.1.3 LPCD Low Power Card Detection
- phhalHw_Rc663_Cmd_Lpcd()
This function performs the low-power card detection and an automatic trimming of the
LPO. The values of the sampled I and Q channel are stored in the register map. The
value is compared with the min/max values in the register. If it exceeds the limits, an
LPCD IRQ will be raised. After the command the standby is activated if selected.
phStatus_t phhalHw_Rc663_Cmd_Lpcd(
phhalHw_Rc663_DataParams_t *pDataParams, [In]
uint8_t bMode, [In]
uint8_t bI, [In]
uint8_t bQ, [In]
uint16_t wPowerDownTimeMs, [In]
uint16_t wDetectionTimeUs ); [In]
*pDataParams: pointer to the HAL layer data parameter structure.
bMode: there are three different modes that LPCD can run. Each is matched with one of
three following defines:
PHHAL_HW_RC663_CMD_LPCD_MODE_DEFAULT:
Try LPCD until timeout is reached. T4timer runs
on 64 kHz frequency. Function ignores last two input arguments, but uses
PHHAL_HW_RC663_LPCD_T3_RELOAD_MIN
and
PHHAL_HW_RC663_LPCD_T4_RELOAD_MIN
from
phhalHw_Rc663_Config.h file to set power-down and detection time amounts.
PHHAL_HW_RC663_CMD_LPCD_MODE_POWERDOWN:
Powers down the PCD for a certain amount of
time and performs LPC after wakeup. If no card is found the PCD is powered down again
and the procedure is restarted. If a card is found the function returns and the PCD
remains powered up.