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

📄 xllp_usim_atr.h

📁 优龙pxa270平台试验程序
💻 H
字号:
/******************************************************************************
**
**  COPYRIGHT (C) 2001, 2002 Intel Corporation.
**
**  This software as well as the software described in it is furnished under
**  license and may only be used or copied in accordance with the terms of the
**  license. The information in this file is furnished for informational use
**  only, is subject to change without notice, and should not be construed as
**  a commitment by Intel Corporation. Intel Corporation assumes no
**  responsibility or liability for any errors or inaccuracies that may appear
**  in this document or any software that may be provided in association with
**  this document. 
**  Except as permitted by such license, no part of this document may be 
**  reproduced, stored in a retrieval system, or transmitted in any form or by
**  any means without the express written consent of Intel Corporation. 
**
**  FILENAME:       xllp_usim_ATR.h
**
**  PURPOSE: contains USIM definition related to the ATR response
**                  
******************************************************************************/

#ifndef __USIM_ATR_H__
#define __USIM_ATR_H__

#include "xllp_defs.h"

#define ATR_Max_Interface_Bytes		30
#define ATR_Max_Historical_Bytes	15
#define ATR_Max_TA_Bytes			15
#define ATR_Max_TB_Bytes			15
#define ATR_Max_TC_Bytes			15
#define ATR_Max_TD_Bytes			15
#define ATR_Max_Bytes	            33


typedef struct AtrS
{
	XLLP_INT8_T TS;											// Initial Character
	XLLP_INT8_T TO;											// Format character
	XLLP_INT8_T TA[ATR_Max_TA_Bytes];						// Interface Bytes: TA
	XLLP_INT8_T TB[ATR_Max_TB_Bytes];						// Interface Bytes: TB
	XLLP_INT8_T TC[ATR_Max_TC_Bytes];						// Interface Bytes: TC
	XLLP_INT8_T TD[ATR_Max_TD_Bytes];						// Interface Bytes: TD
	XLLP_INT8_T HistoricalBytes[ATR_Max_Historical_Bytes];	// minimum = 0 , maximum = 15
	XLLP_INT8_T TCK;										// Check character

	XLLP_INT8_T LengthOfAtr;				// Maximum = 33
	XLLP_INT8_T LengthOfInterfaceBytes;		// Maximum = 30
	XLLP_INT8_T LengthOfHistoricalBytes;	// Maximum = 15
	XLLP_INT8_T LengthOfTA;					// Maximum = 15
	XLLP_INT8_T LengthOfTB;					// Maximum = 15
	XLLP_INT8_T LengthOfTC;					// Maximum = 15
	XLLP_INT8_T LengthOfTD;					// Maximum = 15
	XLLP_INT8_T TCKPresent;	
} XLLP_USIM_ATR_T;


// TS: Initial Character:
#define XLLP_USIM_ATR_TS_DirectConvention	0x3B
#define XLLP_USIM_ATR_TS_InverseConvention	0x3F


// TO: Format Character
#define XLLP_USIM_ATR_HistoricalByte		0x0F
#define XLLP_USIM_ATR_TO_BitMap_Mask		0xF0
#define TA_bit_Mask							0x10
#define TB_bit_Mask							0x20
#define TC_bit_Mask							0x40
#define TD_bit_Mask							0x80


// TA: Serial Transmission baud rate character
#define XLLP_USIM_ATR_TA_Fi					0xF0
#define XLLP_USIM_ATR_TA_Di					0x0F

// TB: Voltage and Current Character
#define XLLP_USIM_ATR_TB_Pi					0x1F
#define XLLP_USIM_ATR_TB_Ii					0x60

// TC: Extra Guard Time character
#define XLLP_USIM_ATR_TC_GuardTime			0xFF

// TD: 
#define XLLP_USIM_ATR_TD_BitMap_Mask		0xF0
#define XLLP_USIM_ATR_TD_Protocol_Type		0x0F



/**
BAUD RATE CONVERSION TABLES
**/

//#define XLLP_USIM_BAUD_RATE_TABLE_SIZE	16

//const XLLP_INT32_T Xllp_Usim_BaudRate_Fi2F_Conversion[XLLP_USIM_BAUD_RATE_TABLE_SIZE] =
//{0, 372, 558, 744, 1116, 1488, 1860, 0, 0, 512, 768, 1024, 1536, 2048, 0, 0};

//CAREFUL: Had to multiply by 64 to avoid declaring the array as 'float'
//const XLLP_INT32_T Xllp_Usim_BaudRate_Di2D_Conversion_MultipliedBy64[XLLP_USIM_BAUD_RATE_TABLE_SIZE] =
//{0, 64, 128, 256, 512, 1024, 0, 0, 0, 0, 32, 16, 8, 4, 2, 1};

//#define INTERNAL_CLOCK 0
//const XLLP_INT32_T Xllp_Usim_MaximumCardSamplingFrequency[XLLP_USIM_BAUD_RATE_TABLE_SIZE] =
//{INTERNAL_CLOCK, 5, 6, 8, 12, 16, 20, 0, 0, 5, 7.5, 10, 15, 20, 0 ,0};	// the 7.5 entry will be stored as 7 which is still ok!



// Prototypes:
XLLP_USIM_STATUS_T XllpUsimGetAtrBytes(void *, XLLP_USIM_ATR_T *);
XLLP_USIM_STATUS_T XllpUsimVerifyAtrCorrectness(XLLP_USIM_ATR_T *, XLLP_INT8_T *);
void XllpUsimInitializeAtrStructure(XLLP_USIM_ATR_T *);


#endif //__USIM_ATR_H__



/* ATR:
See the following:
\\an1sfls001\hcd_proj\Doc\Bulverde\USIM\USIM_CharsReceivedOnATR.gif
\\an1sfls001\hcd_proj\Doc\Bulverde\USIM\USIM_BitPositionOfCharsReceivedOnATR.gif
*/

⌨️ 快捷键说明

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