SMC卡读卡器原理图和源程序
Define Definition
***************************************************************************/
#define K_BYTE 1024 /* Kilo Byte */
#define SECTSIZE 512 /* Sector buffer size */
#define REDTSIZE 16 /* Redundant buffer size */
/***************************************************************************/
#define DUMMY_DATA 0xFF /* No Assign Sector Read Data */
/***************************************************************************
Max Zone/Block/Sectors Data Definition
***************************************************************************/
#define MAX_ZONENUM 0x08 /* Max Zone Numbers in a SmartMedia */
#define MAX_BLOCKNUM 0x0400 /* Max Block Numbers in a Zone */
#define MAX_SECTNUM 0x20 /* Max Sector Numbers in a Block */
#define MAX_LOGBLOCK 1000 /* Max Logical Block Numbers in a Zone */
/***************************************************************************/
#define CIS_SEARCH_SECT 0x08 /* Max CIS Search Sector Number */
/***************************************************************************
Logical to Physical Block Table Data Definition
***************************************************************************/
#define NO_ASSIGN 0xFFFF /* No Assign Logical Block Address */
/*Global Parameter define */
short int info_flash[10];
/* [0]: device_maker 0xec:samsung, 0x98:toshiba
[1]: device_type 1:1M, 2:2M, 4:4M, 8:8M, 16:16M, 32:32M ...bytes
[2]: blocks_disk value: blocks in a disk
[3]: pages_block value: pages in a block
[4]: page_size value: page_size in bytes
[5]: data_size value: data_size in bytes
[6]: spare_size value: spare_size in bytes
[7]: sector count value: sectors per block
[8]: Max Address value: ADD3 Value
[9]: Max Address for 64MB,128MB value: ADD4 Value */
unsigned char hwcontrol_status;
struct ADDRESS
{
unsigned char Zone; /* Zone Number */
unsigned char Sector; /* Sector(512byte) Number on Block */
unsigned short PhyBlock; /* Physical Block Number on Zone */
unsigned short LogBlock; /* Logical Block Number of Zone */
};
struct CIS_AREA
{
unsigned char Sector; /* Sector(512byte) Number on Block */
unsigned short PhyBlock; /* Physical Block Number on Zone 0 */
};
非常好我支持^.^
(0) 0%
不好我反对
(0) 0%