📄 simhw.h
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
//------------------------------------------------------------------------------
//
// Copyright (C) 2004, Motorola Inc. All Rights Reserved
//
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//
// Header: simhw.h
//
//------------------------------------------------------------------------------
#ifndef __SIM_HW_H__
#define __SIM_HW_H__
#if __cplusplus
extern "C" {
#endif
//------------------------------------------------------------------------------
// Defines
#define RFU 0 // Reserve for future use
#define MHz 1000000
#define FI_DEFAULT 0x7
#define COLDRESET_CWT 0x2574
#define COLDRESET_DELAY1 0x200
#define COLDRESET_DELAY2 0x9c40
#define RETRYS 100
#define CLK_SEL_DISABLE 0
#define CLK_SEL_CARD 1
#define CLK_SEL_RECEIVER 2
#define CLK_SEL_TRANSMIT 3
//------------------------------------------------------------------------------
// Types
//port select
typedef enum _PORT_SELECT {
PORT0 = 0,
PORT1
} PORT_SELECT;
//Clock rate factor structure
typedef struct {
UINT8 FI; //Bit form in ATR
INT16 Fi; //Clock rate conversion factor
INT16 f; //maximum frequency for the factor
}ClockRateFactor;
//Baud rate factor structure
typedef struct {
UINT8 DI; //Bit form in ATR
UINT8 Di; //Baud rate adjustment factor
}BaudRateFactor;
//------------------------------------------------------------------------------
// Functions
PVOID SIM_InternalMapRegisterAddresses(DWORD iobase);
void SIM_Init(PCSP_SIM_REG pSIMReg);
void SIM_Open(PCSP_SIM_REG pSIMReg);
void SIM_Close(PCSP_SIM_REG pSIMReg);
NTSTATUS SIM_ColdReset(PCSP_SIM_REG pSIMReg, UCHAR* Buffer, ULONG* BufferLength);
NTSTATUS SIM_WarmReset(PCSP_SIM_REG pSIMReg);
NTSTATUS SIM_Deactivate(PCSP_SIM_REG pSIMReg);
NTSTATUS SIM_WriteData(PCSP_SIM_REG pSIMReg, UCHAR *Buffer, ULONG Length);
NTSTATUS SIM_ReadData(PCSP_SIM_REG pSIMReg, UCHAR *Buffer, ULONG Length);
BOOL SIM_ConfigCLK(PCSP_SIM_REG pSIMReg, UINT8 Fi, UINT8 Di);
BOOL SIM_ConfigTime(PCSP_SIM_REG pSIMReg, UINT8 N, UINT8 WI);
BOOL SIM_CheckCard(PCSP_SIM_REG pSIMReg);
void SIM_FlushFIFO(PCSP_SIM_REG pSIMReg);
void SIM_SelectPort(DWORD Port_select);
#ifdef __cplusplus
}
#endif
#endif //__SIM_HW_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -