⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 paypass_tcl.h

📁 读RF卡的源代码
💻 H
字号:
//=============================================================================
//                  Copyright (C) INSIDE Technologies 1998-2005
//
// INSIDE Contactless reserves the right to make changes, without notice,
// to any product (including application note) herein to improve
// reliability, functionality, or design. INSIDE Contactless advises its
// customers to obtain the latest version of device data sheets to verify,
// before placing orders, that the information being relied upon by the
// customer is current.
//
// INSIDE Contactless makes no warranty that the use will not infringe any
// third party patent, copyright or trademark.
//
// Information furnished by INSIDE Contactless is believed to be accurate
// and reliable. However, INSIDE Contactless does not assume any liability
// resulting from the application or use of any product described within.
//
// All rights are reserved. Reproduction in whole or in part is prohibited
// without the written consent of the copyright owner.
//
//      Bat 11a,
//      Parc Club du Golf,
//      Z.A.C. du Pichaury                      Tel :   +33 (0)4.42.39.33.00
//      13856 Aix-en-Provence Cedex 3           Fax :   +33 (0)4.42.39.63.19
//      FRANCE                                  Email : info@insidefr.com
//
//-----------------------------------------------------------------------------
// Project Code : PICOREAD RF ISO14443A READER
// Project Name : APPLICATION NOTE
// Module Name  : PRD_TCL.h
// Platform dev : Keil 礦ision 3 (IDE ) + Keil ARM Compiler
// Target       : LPC2129 (ARM7TDMI Core)
// Language     : C ANSI
// Revision     : 1.0
// Description  : Application Note Main
//=============================================================================

#ifndef __PAYPASS_TCL_H__
#define __PAYPASS_TCL_H__

// RF Protocol speed
#define  CST_tclbr106kbps			0x00
#define  CST_tclbr212kbps			0x01
#define  CST_tclbr424kbps			0x02
#define  CST_tclbr847kbps			0x03
#define  CST_tclbrPCD_PICC			0x04

//Connection protocols
#define  CST_tclctISO_14443_A_B_4	0x00
#define	 CST_tclctISO_14443_A_4		0x01
#define  CST_tclctISO_14443_B_4		0x02

// ISO 7816-4 command set format
#define	 CMD_CLA					0
#define	 CMD_INS					1
#define	 CMD_P1						2
#define	 CMD_P2						3
#define	 CMD_P3						4

// T=CL dependant declarations 
#define  TCL_RETRY_COUNT			3 	 // Set the retry count for T=CL command execution

#define  CST_pcbtINoChaining		0x00
#define  CST_pcbtIWithChaining		0x01
#define  CST_pcbtRACK				0x02
#define  CST_pcbtRNACK				0x03
#define  CST_pcbtSWTX				0x04
#define  CST_pcbtDESELECT			0x05
#define  CST_pcbtError				0x06
#define  CST_pcbPROTOCOL_ERROR		0x08


#define  CST_tcltsCommand			0x09
#define  CST_tcltsRACK				0x0A
#define  CST_tcltsRNACK				0x0B
#define  CST_tcltsSWTX				0x0C
#define  CST_tcltsChaining			0x0D
#define  CST_tcltsDESELECT			0x0E
#define  CST_tcltsError				0x0F
#define  CST_tcltsEnd				0x10

#define	 PCB_I					 	0x02
#define	 PCB_R					 	0xA2
#define	 PCB_S					 	0xC2

#define	 PCB_I_WITH_CHAINING	 	0x10

#define	 PCB_R_WITH_ACK			 	0x00
#define	 PCB_R_WITH_NACK		 	0x10

#define	 PCB_S_WITH_DESELECT	 	0x00
#define	 PCB_S_WITH_WTX			 	0x30

#define	 ISO_14443_A_RATS 		 	0xE0
#define	 ISO_14443_B_ATTRIB		 	0x1D

#ifdef MODE_DEBUG_TCL
#include <stdio.h>
#endif

// T=CL parameters structure declaration
typedef struct 
{
	unsigned char	f_iBlockNumber;       // block number of I-block or R-block   
    unsigned short	f_eCardType;		  // Card type in T=CL protocol
	unsigned char	f_ePCDBitRate; 
	unsigned char	f_ePICCBitRate;

    unsigned short	f_iPICCMaximumInputFrameSize;
 	unsigned short	f_iPCDMaximumInputFrameSize;
   
	unsigned long	f_dPICCMaximumFrameWaitingTime;			   	// timeout
	unsigned long	f_dPCDWaitingTimeBeforeSendingAnotherFrame;   //DEBUG FP Long and not char
} TTCLConfiguration;

extern TTCLConfiguration    g_TCLCard;

extern void 				v_fnTCLFrameBuild			(unsigned char	p_ePCBType,unsigned char *p_pabCommand, unsigned char *p_pabDataIn,unsigned char	p_iDataInLength,unsigned char *p_pabTCLFrameIn,unsigned short *p_piTCLFrameInLength, unsigned short *p_piTCLFrameOutLength);
extern unsigned char 		b_fnTCLFrameExtract			(unsigned short *p_piTCLFrameLength,unsigned char *p_pabTCLFrame,unsigned char *p_pabData,unsigned short *p_pwStatus);
extern unsigned char 		b_fnCardConnect				(unsigned char p_pchoice, unsigned short p_iPCDMaximumInputFrameSize);
extern unsigned char 		b_fnCardDisconnect			(StructReader* p_pStructReader);
extern unsigned short 		b_fnCardTransmit_PayPass	(unsigned short *p_piDataOutLength,unsigned short p_iDataInLength,unsigned char *p_pabCommand,unsigned char *p_pabDataIn,unsigned char *p_pabDataOut,StructReader* p_pStructReader);


#endif	//__TCL_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -