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

📄 filesystem.h

📁 TELECHIPS MP3解决方案UMS实现源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
///////////.///////////////////////////////////////////////////////
//
//   ============================================================
//
//   Author	:       Telechips Inc./Multi Media Team/TCC730 Project
//
//				 	- Choi, Ji Woong(ddag@telechips.com)
//               
//   Phone	:      +82-2-3443-6792
//
//   DATE   :      2002/03/13
//
//   FILE NAME	:  filesystem.h
//
//   DESCRIPTION:  SMC file system header file which includes  
//				   Functions, Macros, variables.
//
///////////////////////////////////////////////////////////////////
#ifdef	FILE_SET
#define	FILE_EXT
#else
#define	FILE_EXT extern
#endif

////////////////////////////////////////////////////////////////////////////
//																		  //
// 								Definitions								  //
//																		  //
////////////////////////////////////////////////////////////////////////////

#define MAX_FILE_NUM		512//256         //TCC730 15*2
#define MAX_FILE_LEN		8	
#define FM_PAGE_SIZE		512			/* 512B */

#define MAX_FLASH_DRIVE 	6
#define FM_4MB_BLOCK_NUM	500		//497			//512  * 8KB
#define FM_8MB_BLOCK_NUM	1000	//997			//1024 * 8KB
#define FM_16MB_BLOCK_NUM	1000	//998			//1024 * 16KB
#define FM_32MB_BLOCK_NUM	2000	//1998		//2048  ..
#define FM_64MB_BLOCK_NUM	4000	//3997		//4096  ..
#define FM_128MB_BLOCK_NUM	8000	//7996		//8192  ..

// File Type 
#define FM_EMPTY		0

// Value Definitions
#define	SECTOR_SIZE			512
#define BLOCK_SIZE		  16384

// value of udXXFlag
#define	NOT_INITIALIZED		0
#define	INITIALIZED			1

// Error Message Code
#define	SM_OK						0
#define	ERR_FLASH_STATUS			1
#define	ERR_CARD_NOT_DETECTED		2
#define	ERR_CARD_CHANGED			3
#define	ERR_NOT_ERASED				4
#define	ERR_NOT_FORMATTED			5
#define	ERR_INVALID_MBR				6
#define	ERR_INVALID_PBR				7
#define	ERR_INVALID_FAT				8
#define	ERR_INVALID_NAME			9
#define	ERR_INVALID_HANDLE			10	// 0x0A
#define	ERR_INVALID_PARAM			11  // 0x0B
#define	ERR_NO_EMPTY_BLOCK			12  // 0x0C
#define	ERR_INVALID_BLOCK			13  // 0x0D
#define	ERR_ECC						14  // 0x0E
#define	ERR_FILE_OPENED				15  // 0x0F
#define	ERR_FILE_EXIST				16  // 0x10
#define	ERR_TOTAL_FILE_NUM			17  // 0x11
#define	ERR_EOF						18  // 0x12
#define	ERR_FILE_NOT_OPENED			19  // 0x13
#define	ERR_FILE_NOT_EXIST			20  // 0x14
#define	ERR_NOT_FOUND				21  // 0x15
#define	ERR_ROOT_DIR				22  // 0x16
#define	ERR_LOCKED					23  // 0x17
#define	ERR_NOT_PERMITTED			24  // 0x18
#define	ERR_OUT_OF_MEMORY			25  // 0x19
#define	ERR_SYSTEM_PARAMETER		26  // 0x1A
#define	ERR_INTERNAL				27  // 0x1B
#define	ERR_MMC						28  // 0x1C
// 2002.03.06
#define ERR_CANNOT_FORMATTING	    29  // 0x1D
#define ERR_ENCODER_FILE_SYSTEM     30  // 0x1E
#define ERR_GET_USED_BLOCK		    31  // 0x1F
#define ERR_USB_SEND                32  // 0x20
#define ERR_USB_RECEIVE             33  // 0x21
#define ERR_OVER_MAX_DRIVE			34  // 0x22
#define ERR_INVALID_ADDRESS			35  // 0x23
#define ERR_DEVICE_ID 				36  // 0x24
#define ERR_REOPEN_FILE				37  // 0x25
#define ERR_NOT_IMPLEMENTED			38	// 0x26
#define ERR_NO_EMPTY_ENTRY			39	// 0x27
#define ERR_FONT_BLOCK_CHAIN		40	// 0x28
//#define ERR_RETURN_NULL				0xFFFF


///////////////////////////////////////////////////////////////////
//																 //
//		      				smdosfile.h    						 //
//																 //
///////////////////////////////////////////////////////////////////
// Macro Definitions
//////////////////////////////////////////////////
#define	MAX_DRIVE		3		// number of SmartMedia drive that is installed

// Value Definitions
//////////////////////////////////////////////////
#define	P_ZONE_MAX			1024
#define	L_ZONE_MAX			1000

#define	L_SECTOR_SIZE		512
#define	P_SECTOR_SIZE		528

//sDEV_ID.manufacture
//#define	M_SAMSUNG			0
//#define	M_TOSHIBA			1

// sDEV_ID.device
//#define	D_1M				0
//#define	D_2M				1
#define	D_4M				0
#define	D_8M				1
#define	D_16M				2
#define	D_32M				3
#define	D_64M				4
#define	D_128M				5
#define	D_256M				6
#define	D_512M				7
#define	D_96M				8
#define	D_196M				9
#define	D_NOT_DEFINED		0xff

// pLBlock, pPBlock value
#define	INVALID_PBLOCK		0xffee
#define	UNUSED_PBLOCK		0xffff

// value of sSmInfo.pbr.file_sys_type
#define	FS_UNKNOWN			0
#define	FS_FAT12			1
#define	FS_FAT16			2

// FAT table contents
#define	UNUSED_CLUSTER		0

// DIR/FAT update mode
#define	FILE_ADD			0
#define	FILE_DELETE			1
#define	FILE_RENAME			2
#define	DIR_ADD				3
#define	DIR_DELETE			4
#define	FILE_REPLACE		5
#define	DIR_RENAME			6

// etc
//#define	ROOT_DIR_ENTRY		256
#define	FAT_SIZE			512	//158	//32*2	
#define Init_LBlocks        20 //145 //2001.11.13
// format mode
#define PHYSICAL_FORMAT 2
#define LOWLEVEL_FORMAT 1
#define FAST_FORMAT 0

#ifndef SET
	#define SET 1
	#define CLR	0
#endif

#ifndef READ_SPARE
#define READ_PAGE	0
#define WRITE_PAGE	1
#define READ_SPARE	2
#define ERASE_BLOCK	3
#endif

#ifndef INTERNAL
#define INTERNAL 1
#endif

#ifndef EXTERNAL
#define EXTERNAL 2
#endif

#ifndef CODE
#define CODE		code
#define CODE_UBYTE (CODE unsigned char*)// Up to Code Memory
#define CODE_BYTE  (CODE char*)// Up to Code Memory
#define CODE_UWORD (CODE uword*)// Up to Code Memory
#endif

#ifndef OLD_BOARD
#define OLD_BOARD 0
#define NEW_BOARD 1
#define CE0	 0xF2	// GPIO6.0
#define CE2	 0x03	// GPIO6.1
#define CE1	 0xF1	// GPIO4.0
// Chip Disable
#define _CE	 0xF3
#define _CE2 0x04
#endif

// For WMA
#ifndef CODEC_INVOKE
#define CODEC_INVOKE	1
#define CODEC_DONE		0
#endif
// Drive Mode
#ifndef SMC_MODE
#define NO_MODE 0
#define SMC_MODE 1
#endif

#ifdef SECURITY_INCLUDE
#define SECURITY_OFF 0
#define SECURITY_ON	 1
#endif

#ifndef LPT_BLOCK_SIZE
#define LPT_BLOCK_SIZE 2
#endif

#ifndef BUFFER_ADDRESS
#define BUFFER_ADDRESS (void*)0x200000
#define SECOND_BUFFER  (void*)0x205000	
#endif


#define NO_MUSICE		0
#define MP3_FILE		1
#define MP2_FILE		2
#define WMA_FILE		3
#define ADPCM_FILE		4
#define TVF_FILE		5

#ifdef 	OLD_MICOM
#define MP3_FILE_EXT	"MP3"
#define WMA_FILE_EXT	"WMA"
#define ASF_FILE_EXT	"ASF" // the same as WMA
#endif

#ifndef FS_PLAY_MODE 
#define FS_REW_MODE 	0
#define FS_FF_MODE  	1
#define FS_NO_MODE 		2
#define FS_PLAY_MODE 	3
#define FS_PAUSE_MODE	4
#endif
 	
#ifndef FILE_START
#define FILE_START      0
#define	FILE_END		1
#endif

#ifndef LPT_PLAYBLOCK
#define	BLOCK_STATUS_FLAG 	 517
#define BAD_BLOCK			0x00
#define PLAY_BLOCK			0x01
#define PARAMETER_BLOCK 	0x02
#define REC_BLOCK			0x03
#define FONTADDR_BLOCK		0x04
#define FONTDATA_BLOCK		0x05
#define UNUSED_BLOCK		0xFF
#define LPT_DRV				INTERNAL
#endif

#ifdef WP_INCLUDE
#define WP_CHECK() 			(SMC_CTRL&0x20)
#endif

// SMC, MMC Port Check
//////////////////////////////////////////
#define SMC_IO_CHECK() 		(PORTE&0x08)
//#define MMC_IO_CHECK() 		(PORTC&0x08)

//#ifdef UNICODE_INCLUDE
#define MAX_LFN_SIZE 	512
#define FONT_DRV		INTERNAL
//#else
//#define MAX_LFN_SIZE 	32
//#define FONT_DRV		INTERNAL
//#endif

#define ID_MPEG25	0x00
#define NO_MPEG 0x01
#define ID_MPEG2	0x02

⌨️ 快捷键说明

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