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

📄 smil.h

📁 ertfs文件系统里面既有完整ucos程序
💻 H
字号:
//< smil.h>
/***************************************************************************
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 0x01 /* 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 */
/***************************************************************************
'SectCopyMode' Data
***************************************************************************/
#define COMPLETED 0 /* Sector Copy Completed */
#define REQ_ERASE 1 /* Request Read Block Erase */
#define REQ_FAIL 2 /* Request Read Block Failed */
/***************************************************************************
Retry Counter Definition
***************************************************************************/
#define RDERR_REASSIGN 1 /* Reassign with Read Error */
#define L2P_ERR_ERASE 1 /* BlockErase for Contradicted L2P Table */
/***************************************************************************
Hardware ECC Definition
***************************************************************************/
// #define HW_ECC_SUPPORTED 1 /* Hardware ECC Supported */
/* No difinition for Software ECC */
/***************************************************************************
SmartMedia Command & Status Definition
***************************************************************************/
/* SmartMedia Command */
#define WRDATA 0x80
#define READ 0x00
#define READ_REDT 0x50
#define READ1 0x00
#define READ2 0x01
#define READ3 0x50
#define RST_CHIP 0xFF
#define WRITE 0x10
#define ERASE1 0x60
#define ERASE2 0xD0
#define RDSTATUS 0x70
#define READ_ID 0x90
/* SmartMedia Status */
#define WR_FAIL 0x01 /* 0:Pass, 1:Fail */
#define SUSPENDED 0x20 /* 0:Not Suspended, 1:Suspended */
#define READY 0x40 /* 0:Busy, 1:Ready */
#define WR_PRTCT 0x80 /* 0:Protect, 1:Not Protect */
/* SmartMedia Busy Time (1bit:0.1ms) */
#define BUSY_PROG 200 /* tPROG : 20ms ----- Program Time */
#define BUSY_ERASE 4000 /* tBERASE: 400ms ----- Block Erase Time */
#define BUSY_READ 1 /* tR : 100us ----- Data transfer Time */
#define BUSY_RESET 60 /* tRST : 6ms ----- Device Resetting Time */
/* Hardware Timer (1bit:0.1ms) */
#define TIME_PON 3000 /* 300ms ------ Power On Wait Time */
#define TIME_CDCHK 200 /* 20ms ------ Card Check Interval Timer */
#define TIME_WPCHK 50 /* 5ms ------ WP Check Interval Timer */
/***************************************************************************
Redundant Data
***************************************************************************/
#define REDT_DATA 0x04
#define REDT_BLOCK 0x05
#define REDT_ADDR1H 0x06
#define REDT_ADDR1L 0x07
#define REDT_ADDR2H 0x0B
#define REDT_ADDR2L 0x0C
#define REDT_ECC10 0x0D
#define REDT_ECC11 0x0E
#define REDT_ECC12 0x0F
#define REDT_ECC20 0x08
#define REDT_ECC21 0x09
#define REDT_ECC22 0x0A
/***************************************************************************
SmartMedia Model & Attribute
***************************************************************************/
/* SmartMedia Attribute */
#define NOWP 0x00 /* 0... .... No Write Protect */
#define WP 0x80 /* 1... .... Write Protected */
#define MASK 0x00 /* .00. .... NAND MASK ROM Model */
#define FLASH 0x20 /* .01. .... NAND Flash ROM Model */
#define AD3CYC 0x00 /* ...0 .... Address 3-cycle */
#define AD4CYC 0x10 /* ...1 .... Address 4-cycle */
#define BS16 0x00 /* .... 00.. 16page/block */
#define BS32 0x04 /* .... 01.. 32page/block */
#define PS256 0x00 /* .... ..00 256byte/page */
#define PS512 0x01 /* .... ..01 512byte/page */
#define MWP 0x80 /* WriteProtect mask */
#define MFLASH 0x60 /* Flash Rom mask */
#define MADC 0x10 /* Address Cycle */
#define MBS 0x0C /* BlockSize mask */
#define MPS 0x03 /* PageSize mask */
/* SmartMedia Model */
#define NOSSFDC 0x00 /* NO SmartMedia */
#define SSFDC1MB 0x01 /* 1MB SmartMedia */
#define SSFDC2MB 0x02 /* 2MB SmartMedia */
#define SSFDC4MB 0x03 /* 4MB SmartMedia */
#define SSFDC8MB 0x04 /* 8MB SmartMedia */
#define SSFDC16MB 0x05 /* 16MB SmartMedia */
#define SSFDC32MB 0x06 /* 32MB SmartMedia */
#define SSFDC64MB 0x07 /* 64MB SmartMedia */
#define SSFDC128MB 0x08 /*128MB SmartMedia */
/***************************************************************************
Struct Definition
***************************************************************************/
struct SSFDCTYPE {
unsigned char Model;
unsigned char Attribute;
unsigned char MaxZones;
unsigned char MaxSectors;
unsigned short MaxBlocks;
unsigned short MaxLogBlocks;
};
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 */
};

⌨️ 快捷键说明

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