📄 paypass_anticollision.lst
字号:
ARM COMPILER V2.40e, PayPass_Anticollision 12/12/07 14:35:10 PAGE 1
ARM COMPILER V2.40e, COMPILATION OF MODULE PayPass_Anticollision
OBJECT MODULE PLACED IN .\PayPass_Anticollision.obj
COMPILER INVOKED BY: C:\DEV\Tools\Keil\ARM\BIN\CA.exe ..\..\..\..\LIB\PayPass\sources\PayPass_Anticollision.c THUMB DEBU
-G PRINT(.\LISTING\PAYPASS_ANTICOLLISION.LST) TABS(4) PREPRINT(.\LISTING\PAYPASS_ANTICOLLISION.I) OBJECT(.\PayPass_Antico
-llision.obj)
stmt level source
1 //=============================================================================
2 // Copyright (C) INSIDE Contactless 1998-2005
3 //
4 // INSIDE Contactless reserves the right to make changes, without notice,
5 // to any product (including application note) herein to improve
6 // reliability, functionality, or design. INSIDE Contactless advises its
7 // customers to obtain the latest version of device data sheets to verify,
8 // before placing orders, that the information being relied upon by the
9 // customer is current.
10 //
11 // INSIDE Contactless makes no warranty that the use will not infringe any
12 // third party patent, copyright or trademark.
13 //
14 // Information furnished by INSIDE Contactless is believed to be accurate
15 // and reliable. However, INSIDE Contactless does not assume any liability
16 // resulting from the application or use of any product described within.
17 //
18 // All rights are reserved. Reproduction in whole or in part is prohibited
19 // without the written consent of the copyright owner.
20 //
21 // Bat 11a,
22 // Parc Club du Golf,
23 // Z.A.C. du Pichaury Tel : +33 (0)4.42.39.33.00
24 // 13856 Aix-en-Provence Cedex 3 Fax : +33 (0)4.42.39.63.19
25 // FRANCE Email : info@insidefr.com
26 //
27 //-----------------------------------------------------------------------------
28 // Project Code : PAYPASS LIBRARY
29 // Project Name : PAYPASS LIBRARY
30 // Module Name : PayPass_Anticollision.c
31 // Platform dev : Keil 礦ision 3 (IDE ) + Keil ARM Compiler
32 // Target : LPC2103 (ARM7TDMI Core)
33 // Language : C ANSI
34 // Revision : 1.0
35 // Description : PayPass Anticollision functions
36 //=============================================================================
37 // When Who Ver What
38 // 06-04-24 MCY 1.1 restructuration
39 // 06-05-12 FPK 1.2 corrections
40 //=============================================================================
41
42 // C ANSI Defines
43 #include <stdio.h>
44 #include <string.h>
45
46 // Defines for PicoRead
47 #include "PRD_PicoReadRF_Pages_Parameters.h" // Definition of PicoRead chip registers
*** ERROR C318 IN LINE 47 OF ..\..\..\..\LIB\PayPass\sources\PayPass_Anticollision.c: can't open file 'PRD_PicoReadRF_Pa
-ges_Parameters.h'
48 #include "PRD_Protocols_Defines.h" // READER configuration parameters
*** ERROR C318 IN LINE 48 OF ..\..\..\..\LIB\PayPass\sources\PayPass_Anticollision.c: can't open file 'PRD_Protocols_Def
-ines.h'
49 #include "PRD_Config.h" // Reader Configuration functions
*** ERROR C318 IN LINE 49 OF ..\..\..\..\LIB\PayPass\sources\PayPass_Anticollision.c: can't open file 'PRD_Config.h'
50 #include "PRD_RF_Comm.h"
*** ERROR C318 IN LINE 50 OF ..\..\..\..\LIB\PayPass\sources\PayPass_Anticollision.c: can't open file 'PRD_RF_Comm.h'
51 #include "PRD_BufferExchange.h"
ARM COMPILER V2.40e, PayPass_Anticollision 12/12/07 14:35:10 PAGE 2
*** ERROR C318 IN LINE 51 OF ..\..\..\..\LIB\PayPass\sources\PayPass_Anticollision.c: can't open file 'PRD_BufferExchang
-e.h'
52
53
54 // Defines for LPC2129
55 #include "Target.H" // Definition of processor registers & Low level functions to be modified according
- to the target, and the user needs
*** ERROR C318 IN LINE 55 OF ..\..\..\..\LIB\PayPass\sources\PayPass_Anticollision.c: can't open file 'Target.H'
56
57 // ISO A Commands
58 #include "PRD_ISO14443A_Commands.h"
*** ERROR C318 IN LINE 58 OF ..\..\..\..\LIB\PayPass\sources\PayPass_Anticollision.c: can't open file 'PRD_ISO14443A_Com
-mands.h'
59
60 // ISO B Commands
61 #include "PRD_ISO14443B_Commands.h"
*** ERROR C318 IN LINE 61 OF ..\..\..\..\LIB\PayPass\sources\PayPass_Anticollision.c: can't open file 'PRD_ISO14443B_Com
-mands.h'
62
63 // Defines TCL Functions
64 #include "PayPass_TCL.h"
*** ERROR C318 IN LINE 64 OF ..\..\..\..\LIB\PayPass\sources\PayPass_Anticollision.c: can't open file 'PayPass_TCL.h'
65 // Externals + Definitions
66 #include "PayPass_Anticollision_Log.h" // Option for Host mode
*** ERROR C318 IN LINE 66 OF ..\..\..\..\LIB\PayPass\sources\PayPass_Anticollision.c: can't open file 'PayPass_Anticolli
-sion_Log.h'
67 //#include "PayPass_Init.h"
68 // Defines the PayPass Anticollision functions
69 #include "PayPass_Anticollision.h"
*** ERROR C318 IN LINE 69 OF ..\..\..\..\LIB\PayPass\sources\PayPass_Anticollision.c: can't open file 'PayPass_Anticolli
-sion.h'
70
71
72 // Defines for common C writting
73 #include "Defines_C.h" // TRUE, FALSE, etc
*** ERROR C318 IN LINE 73 OF ..\..\..\..\LIB\PayPass\sources\PayPass_Anticollision.c: can't open file 'Defines_C.h'
74
75
76 unsigned char g_abP6Config14443A_PayPass[8];
77 unsigned char g_abP6Config14443B_PayPass[8];
78 unsigned short g_bATQBLength;
79 unsigned char g_abATQAResponse[2];
80 unsigned short g_bATQALength;
81 unsigned char g_abATQBResponse[16];
82 unsigned char g_abATQResponse[16];
83 unsigned char g_abUID[16];
84 unsigned long g_FWT_SFGT;
85 unsigned char g_abRATS_ATTRIB[30];
86 unsigned char g_abAPDU_Data[300];
87 unsigned short g_bATQLength;
88 unsigned short g_bAPDULength;
89 unsigned char g_bUIDLength;
90 unsigned char g_Anticollision_choice;
91 unsigned long g_bPayPassTimeoutValue;
92 unsigned char g_bLastBitSentValue;
93 unsigned short g_iFDT_A_PICC_Shift=0;
94
95
96
97 #if ((defined PAYPASS) || (defined FULL))
//-----------------------------------------------------------------------------
// Function name : v_fnProtocolChange(unsigned char p_pProtocolChoice, unsigned char* p_pP6Config, unsig
-ned char p_pRFReceiveEOF, StructReader* p_pStructReader)
//-----------------------------------------------------------------------------
// Description : Change the protocol used and put the correpondant default values
ARM COMPILER V2.40e, PayPass_Anticollision 12/12/07 14:35:10 PAGE 3
// for the structure
//
// IN : p_pProtocolChoice : choice of the protocol: ISOA_PROTOCOL or ISOB_PROTOCOL
// p_pP6Config : load the good config in page 6
// p_pRFReceiveEOF : 0 for ISO-A, 1 for ISO-B
// p_pStructReader : Pointer to the used StructReader structure.
//
// OUT : p_pStructReader : Pointer to the used StructReader structure.
//
// RETURN : - none -
//
// Notes : - none -
//-----------------------------------------------------------------------------
void v_fnProtocolChange(unsigned char p_pProtocolChoice, unsigned char* p_pP6Config, unsigned char p_pRFR
-eceiveEOF, StructReader* p_pStructReader)
{
// DEFAULT CONFIG ISO14443A or ISO14443B USING DEFAULT ANTICOLLISION OPTIONS (see defines above, ISO150_
-DEFAULT... )
v_fnConfigReader(CONFIG_ANALOG,&p_pP6Config[0],&p_pRFReceiveEOF,p_pStructReader);
v_fnConfigReader(CONFIG_DEFAULT,&p_pProtocolChoice,&p_pRFReceiveEOF,p_pStructReader);
if (p_pProtocolChoice == ISOA_PROTOCOL) // ISO14443-A
{
// DEFAULT VALUES
// TIMEOUT OF 90 祍 for REQA, WUPA, SELECT & ANTICOLLISION CMD + OFFSET PICOREAD IN A
p_pStructReader->s_bRTimeoutUsed = (_FDT_A_PICC_MIN + _PICOREAD_TIMEOUT_OFFSET_A);
p_pStructReader->s_bRFrameSizeUsed = p_pStructReader->s_bRFrameSizeMax & 0xFE;
p_pStructReader->s_bCommunicationSupportedSpeed = (P0_S106K | P0_R106K);
v_fnConfigBitRate(p_pStructReader->s_bCommunicationSupportedSpeed,&p_pRFReceiveEOF,p_pStructReader);
p_pStructReader->s_bCommunicationSupportedSpeed = p_pStructReader->s_bReaderSupportedSpeed;
}
else // ISO14443-B
{
// DEFAULT VALUES
// TIMEOUT OF 566 祍 for REQB & WUPB CMD + OFFSET PICOREAD IN B
p_pStructReader->s_bRTimeoutUsed = (_FWT_ATQB + _PICOREAD_TIMEOUT_OFFSET_B);
p_pStructReader->s_bRFrameSizeUsed = p_pStructReader->s_bRFrameSizeMax & 0xFE;
v_fnConfigBitRate((P0_S106K | P0_R106K),&p_pRFReceiveEOF,p_pStructReader);
p_pStructReader->s_bCommunicationSupportedSpeed = P0_S106K | P0_R106K;
}
// FOR TESTING RECEPTION OF BUFFER FOR FAST RESPONSE IN ISOA
g_bPayPassTimeoutValue = p_pStructReader->s_bRTimeoutUsed;
}
//-----------------------------------------------------------------------------
// Function name : v_fnResetWait()
//-----------------------------------------------------------------------------
// Description : Reset the field and wait tP = 9,44ms
//
// IN : - none -
//
// OUT : - none -
//
// RETURN : - none -
//
// Notes : - none -
//-----------------------------------------------------------------------------
void v_fnResetWait()
{
unsigned char l_bDelay;
// CARRIER OFF
v_fnCS_reset();
v_fnSPI_SendByte(P0_REG_NO_RST | P0_PAGE_SELECT_1);
ARM COMPILER V2.40e, PayPass_Anticollision 12/12/07 14:35:10 PAGE 4
// WAIT tP = 9,44ms (20 x 472 = 9440祍)
for(l_bDelay=20;l_bDelay>0;l_bDelay--)
{
delay_us(472);
}
// CARRIER ON
v_fnCS_reset();
v_fnSPI_SendByte(P0_REG_NO_RST | P0_PAGE_SELECT_1 | P0_RFON);
}
//-----------------------------------------------------------------------------
// Function name : v_fnResetField()
//-----------------------------------------------------------------------------
// Description : Reset the field and wait tP = 9,44ms
//
// IN : - none -
//
// OUT : - none -
//
// RETURN : - none -
//
// Notes : - none -
//-----------------------------------------------------------------------------
void v_fnResetField(short p_dMicroSec)
{
unsigned char l_bDelay;
// CARRIER OFF
v_fnCS_reset();
v_fnSPI_SendByte(P0_REG_NO_RST | P0_PAGE_SELECT_1);
// WAIT tP = 9,44ms (20 x 472 = 9440祍)
for(l_bDelay=20;l_bDelay>0;l_bDelay--)
{
delay_us(p_dMicroSec);
}
// CARRIER ON
v_fnCS_reset();
v_fnSPI_SendByte(P0_REG_NO_RST | P0_PAGE_SELECT_1 | P0_RFON);
}
//-----------------------------------------------------------------------------
// Function name : b_fnFWT_SFGTCalculate(unsigned char p_pchoice,unsigned char p_pabBuffer)
//-----------------------------------------------------------------------------
// Description : Calculate the FWT(ISO-B) or the SFGT(ISO-A) thanks to the FWI or SFGI
//
// IN : p_pchoice : Pointer to choose to calculate FWT or SFGT
// p_pabBuffer : Byte where there is FWI
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -