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
39 of 47
Initialize data parameter structure for the HAL layer. The
phhalHw_Rc663_DataParams_t
structure is related to the card reader CLRC663 and stores some software configuration
parameters which MCU controls the reader through. This function initiates PCD card
reader. The third passed parameter is address of existing BAL data parameter structure.
Initiate bus connection type separately (line 164 or 169), because
phhalHw_Rc663_Init()
function (see section 2.2.2) sets RS232 interface by default, although real hardware bus
selection has been done in line 142.
153
status = phhalHw_Rc663_Init(
154
&halReader,
155
sizeof(phhalHw_Rc663_DataParams_t),
156
&balReader,
157
0,
158
bHalBufferReader,
159
sizeof(bHalBufferReader),
160
bHalBufferReader,
161
sizeof(bHalBufferReader));
162
#ifdef I2C_USED
163
/* Set the parameter to use the I2C interface */
164
halReader.bBalConnectionType = PHHAL_HW_BAL_CONNECTION_I2C;
165
#endif
166
167
#ifdef SPI_USED
168
/* Set the parameter to use the SPI interface */
169
halReader.bBalConnectionType = PHHAL_HW_BAL_CONNECTION_SPI;
170
#endif
Pointer to the HAL layer data parameter structure will be needed by following initiations
of upper layer data parameter structures.
173
pHal = &halReader;
Initialize the 14443-3A PAL (Protocol Abstraction Layer) component (see section 2.3.2).
181
PH_CHECK_SUCCESS_FCT(status, phpalI14443p3a_Sw_Init(&I14443p3a,
182
sizeof(phpalI14443p3a_Sw_DataParams_t), pHal));
This initialization is redundant, since MIFARE Classic is incompliant with the
ISO/IEC14443-4.
185
PH_CHECK_SUCCESS_FCT(status, phpalI14443p4_Sw_Init(&I14443p4,
186
sizeof(phpalI14443p4_Sw_DataParams_t), pHal, &I14443p4));
Initialize the MIFARE PAL component, due to it is implemented by
phalMfc_Authenticate()
function and PAL ISO14443-3A.
189
PH_CHECK_SUCCESS_FCT(status, phpalMifare_Sw_Init(&palMifare,
190
sizeof(phpalMifare_Sw_DataParams_t), pHal, &I14443p4));