User manual

NXP Semiconductors
UM10663
NXP Reader Library User Manual
Please be aware that important notices concerning this document and the product(s)
described herein, h
ave been included in the section 'Legal information'.
© NXP B.V. 2013. All rights reserved.
For more information, please visit: http://www.nxp.com
For sales office addresses, please send an email to:
salesaddresses@nxp.com
Date of release:
24 July 2013
257412
Document identifier:
UM10663
8. Contents
1. Introduction ......................................................... 3
1.1 NXP libraries comparison ................................... 3
1.1.1 Layer Structure of the NXP Reader Library ........ 4
1.1.1.1 Application Layer ................................................ 5
1.1.1.2 Protocol Abstraction Layer ................................. 6
1.1.1.3 Hardware abstraction layer ................................ 7
1.1.1.4 Bus Abstraction Layer ........................................ 8
1.1.1.5 Common Layer ................................................... 8
1.1.1.6 Data structures of the layers .............................. 8
2. Exemplary explanation of the
library functions ............................................... 10
2.1 HAL: CLRC663 commands .............................. 10
2.1.1 General ............................................................ 10
2.1.2 Idle command ................................................... 10
2.1.3 LPCD Low Power Card Detection
-
phhalHw_Rc663_Cmd_Lpcd()
................................. 10
2.1.4 LoadKey
- phStatus_t
phhalHw_Rc663_Cmd_LoadKey()
............................ 11
2.1.5 LoadKeyE2
- phhalHw_Rc663_Cmd_LoadKeyE2()
.. 11
2.1.6 MFAuthent
-
phhalHw_Rc663_MfcAuthenticate_Int()
............... 12
2.1.7 Receive
- phhalHw_Rc663_Cmd_Receive()
........... 13
2.1.8 Transmit -
phhalHw_Rc663_Cmd_Transmit()
.......... 14
2.1.9 WriteE2
- phhalHw_Rc663_Cmd_WriteE2
.............. 14
2.1.10 WriteE2 Page
-
phhalHw_Rc663_Cmd_WriteE2Page
....................... 15
2.1.11 ReadE2
- phhalHw_Rc663_Cmd_ReadE2()
............ 15
2.1.12 LoadReg command
-
phhalHw_Rc663_Cmd_LoadReg()
............................ 16
2.1.13 LoadProtocol
-
phhalHw_Rc663_ApplyProtocolSettings()
............ 17
2.1.14 StoreKeyE2
- phKeyStore_SetKey()
.................. 18
2.1.15 SoftReset
- phhalHw_Rc663_Cmd_SoftReset()
.... 19
2.2 HAL: Additional description of HAL layer ......... 19
2.2.1 CLRC663 HAL layer data parameter structure . 19
2.2.2 Initialization HAL
- phhalHw_Rc663_Init()
........ 20
2.2.3 SetConfig
- phhalHw_SetConfig()
..................... 21
2.2.4 GetConfig
- phhalHw_GetConfig()
..................... 21
2.2.5 ReadRegister
- phhalHw_ReadRegister()
.......... 21
2.2.6 WriteRegister
- phhalHw_WriteRegister()
........ 22
2.2.7 FieldOn
- phhalHw_FieldOn()
........................... 22
2.2.8 FieldOff
- phhalHw_FieldOff()
.......................... 22
2.2.9 FieldReset
- phhalHw_FieldReset()
.................. 23
2.2.10 Wait
- phhalHw_Wait()
...................................... 23
2.3 PAL: ISO/IEC14443-3A .................................... 24
2.3.1 ISO14443A part 3 ............................................. 24
2.3.2 Init ISO14443-3A
- phpalI14443p3a_Sw_Init()
. 24
2.3.3 Request A
- phStatus_t
phpalI14443p3a_RequestA()
................................ 24
2.3.4 Activate Card
- phpalI14443p3a_ActivateCard()
. 25
2.3.5 Anticollision
- phpalI14443p3a_Anticollision()
26
2.3.6 Selection
- phpalI14443p3a_Select()
................ 27
2.3.7 Exchange
- phpalI14443p3a_Exchange()
........... 28
2.3.8 Halt A
- phStatus_t phpalI14443p3a_HaltA()
.... 28
2.3.9 Wake up A
- phStatus_t
phpalI14443p3a_WakeUpA()
.................................. 29
2.4 AL: MIFARE Classic commands ...................... 29
2.4.1 Init MIFARE Classic
- phalMfc_Sw_Init()
........ 29
2.4.2 MF Authentication
- phalMfc_Authenticate()
... 30
2.4.3 ReadValue
- phalMfc_ReadValue()
................... 31
2.4.4 WriteValue
- phalMfc_WriteValue()
.................. 32
2.4.5 Increment
- phalMfc_Increment()
..................... 32
2.4.6 Decrement
- phalMfc_Decrement()
................... 32
2.4.7 Restore
- phalMfc_Restore()
............................ 33
2.4.8 Transfer
- phalMfc_Transfer()
......................... 33
2.4.9 IncrementTransfer
-
phalMfc_IncrementTransfer()
............................. 33
2.4.10 DecrementTransfer
-
phalMfc_DecrementTransfer()
............................. 34
2.4.11 RestoreTransfer
- phalMfc_RestoreTransfer()
. 34
2.4.12 PersonalizeUID
- phalMfc_PersonalizeUid()
.... 35
2.5 AL: MIFARE Ultralight commands .................... 35
2.5.1 Init MIFARE Ultralight
- phalMfu_Sw_Init()
...... 35
2.5.2 Read -
phalMful_Read
........................................ 36
2.5.3 Write -
phalMful_Write()
................................... 36
2.5.4 CompatibilityWrite -
phalMful_CompatibilityWrite()
......................... 36
3. Sample code ...................................................... 38
4. Appendix ............................................................ 43
4.1 Error codes ....................................................... 43
5. Abbreviations ..................................................... 43
6. References ......................................................... 44
7. Legal information .............................................. 46
7.1 Definitions ......................................................... 46
7.2 Disclaimers ....................................................... 46
7.3 Licenses ........................................................... 46
7.4 Trademarks ...................................................... 46
8. Contents ............................................................. 47