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

📄 rbccmd.h

📁 use dsp to make FAT16 format disk.interface with FLASH Ic.
💻 H
字号:
#define MAX_par 							10
#define RBC_CMD_READ10						0x28
#define RBC_CMD_READCAPACITY				0x25
#define RBC_CMD_WRITE10						0x2A
// RBC commands
#define SPC_CMD_INQUIRY						0x12
#define SPC_CMD_PRVENTALLOWMEDIUMREMOVAL	0x1E
#define SPC_CMD_REQUESTSENSE				0x03
#define SPC_CMD_TESTUNITREADY				0x00
#define MaxLFNum 							10

////////////////////////////////////////////////////////////////////////////////////
// Command Descriptor Block
//      _RBC : Reduced Block Command
//      _SPC : SPC-2 SCSI primary Command - 2
////////////////////////////////////////////////////////////////////////////////////
typedef struct _SYS_INFO_BLOCK{
  Uint32	StartSector;
  Uint32	TotalSector;
  
  Uint16	BPB_BytesPerSec;
  Uint16	BPB_SecPerClus;
  
  Uint16	BPB_NumFATs;
  Uint16	BPB_RootEntCnt;
  Uint16	BPB_TotSec16;
  Uint16	BPB_FATSz16;
  Uint16	BPB_SecPerTrk;
  Uint16	BPB_NumHeads;
  Uint32	BPB_HiddSec;
  Uint32	BPB_TotSec32;
   ///////////////////////////////
  Uint32	FatStartSector;
  Uint32	RootStartSector;
  Uint32	FirstDataSector;
/////////////////////FAT32///////////////////////////////
  Uint32 	BPB_FATSz32;
  Uint32	RootStartCluster;
  Uint32	TotCluster;
  Uint16	FAT;
  Uint16	par_FAT[MAX_par];
//////////////////////////////////////////////////////////	
  Uint16	DriveNum;
} SYS_INFO_BLOCK;

typedef struct _FILE_INFO{
  Uint16	bFileOpen;
  Uint16	StartCluster;//unsigned int StartCluster;
  Uint32	LengthInByte;
  Uint16	ClusterPointer;//unsigned int ClusterPointer;
  Uint32	SectorPointer;
  Uint16	OffsetofSector;
  Uint16	SectorofCluster;
  Uint32	pointer;
  Uint16	FatSectorPointer;//unsigned int	FatSectorPointer;
} FILE_INFO;

typedef struct _DIR_INFO{
	Uint16	name[8];
	Uint16 	extension[3];
	Uint16 	attribute;
	Uint16 	Reserved[10];
	Uint16 	lastUpdateDate;
	Uint16 	lastUpdateTime;
	Uint16 	startCluster;
	Uint32 	length;
} DIR_INFO;

typedef union __FLAGS
{
	struct _FLAGS
	{
		unsigned char   SLAVE_IS_ATTACHED	;
		unsigned char   SLAVE_REMOVED		;
		unsigned char  	SLAVE_FOUND			;	// Slave USB device found
		unsigned char  	SLAVE_ENUMERATED	;	// slave USB device enumeration done
		unsigned char   SLAVE_ONLINE		;
		unsigned char 	TIMEOUT_ERR			;	// timeout error during data endpoint transfer
		unsigned char	DATA_STOP			;	// device unplugged during data transfer
		unsigned char 	bData1				;
		unsigned char 	bUartInDone			;		
		unsigned char 	bMassDevice			;
		
	} bits;
	
} FLAGS;

/////////////////hpi32.h////////////////////////////////

typedef struct ShowFileName_D{
  unsigned char LongName[128];	//long file name,end by 00 00
  unsigned char item[32];		//short file name & dir
} ShowFileName_Def;

//=========================================================

⌨️ 快捷键说明

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