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

📄 fatlite.h

📁 cpc-1631的BSP包for VxWorks操作系统
💻 H
📖 第 1 页 / 共 3 页
字号:
/*----------------------------------------------------------------------*/
/*		      f l R e n a m e F i l e				*/
/*									*/
/* Renames a file to another name.					*/
/*									*/
/* Parameters:                                                          */
/*	irHandle	: Drive number (0, 1, ...)			*/
/*	irPath		: path of existing file				*/
/*      irData		: path of new name.				*/
/*                                                                      */
/* Returns:                                                             */
/*	FLStatus	: 0 on success, otherwise failed                */
/*----------------------------------------------------------------------*/

#define flRenameFile(ioreq)	flCall(FL_RENAME_FILE,ioreq)

#endif /* RENAME_FILE */


#ifdef SUB_DIRECTORY

/*----------------------------------------------------------------------*/
/*		      f l M a k e D i r					*/
/*									*/
/* Creates a new directory.						*/
/*                                                                      */
/* Parameters:                                                          */
/*	irHandle	: Drive number (0, 1, ...)			*/
/*	irPath		: path of new directory.			*/
/*                                                                      */
/* Returns:                                                             */
/*	FLStatus	: 0 on success, otherwise failed                */
/*----------------------------------------------------------------------*/

#define flMakeDir(ioreq)	flCall(FL_MAKE_DIR,ioreq)


/*----------------------------------------------------------------------*/
/*		      f l R e m o v e D i r				*/
/*									*/
/* Removes an empty directory.						*/
/*                                                                      */
/* Parameters:                                                          */
/*	irHandle	: Drive number (0, 1, ...)			*/
/*	irPath		: path of directory to remove.			*/
/*                                                                      */
/* Returns:                                                             */
/*	FLStatus	: 0 on success, otherwise failed                */
/*----------------------------------------------------------------------*/

#define flRemoveDir(ioreq)	flCall(FL_REMOVE_DIR,ioreq)

#endif /* SUB_DIRECTORY */

#endif /* FILES > 0 */

#ifdef PARSE_PATH

/*----------------------------------------------------------------------*/
/*		      f l P a r s e P a t h				*/
/*									*/
/* Converts a DOS-like path string to a simple-path array.		*/
/*                                                                      */
/* Parameters:                                                          */
/*	irHandle	: Drive number (0, 1, ...)			*/
/*	irData		: address of path string to convert		*/
/*	irPath		: address of array to receive parsed-path	*/
/*                                                                      */
/* Returns:                                                             */
/*	FLStatus	: 0 on success, otherwise failed                */
/*----------------------------------------------------------------------*/

extern FLStatus flParsePath(IOreq FAR2 *ioreq);

#endif /* PARSE_PATH */


#ifdef ABS_READ_WRITE

/*----------------------------------------------------------------------*/
/*		           f l A b s R e a d 				*/
/*									*/
/* Reads absolute sectors by sector no.					*/
/*									*/
/* Parameters:                                                          */
/*	irHandle	: Drive number (0, 1, ...)			*/
/*      irData		: Address of user buffer to read into		*/
/*	irSectorNo	: First sector no. to read (sector 0 is the	*/
/*			  DOS boot sector).				*/
/*	irSectorCount	: Number of consectutive sectors to read	*/
/*                                                                      */
/* Returns:                                                             */
/*	FLStatus	: 0 on success, otherwise failed                */
/*	irSectorCount	: Number of sectors actually read		*/
/*----------------------------------------------------------------------*/

#define flAbsRead(ioreq)	flCall(FL_ABS_READ,ioreq)


/*----------------------------------------------------------------------*/
/*		         f l A b s W r i t e 				*/
/*									*/
/* Writes absolute sectors by sector no.				*/
/*									*/
/* Parameters:                                                          */
/*	irHandle	: Drive number (0, 1, ...)			*/
/*      irData		: Address of user buffer to write from		*/
/*	irSectorNo	: First sector no. to write (sector 0 is the	*/
/*			  DOS boot sector).				*/
/*	irSectorCount	: Number of consectutive sectors to write	*/
/*                                                                      */
/* Returns:                                                             */
/*	FLStatus		: 0 on success, otherwise failed                */
/*	irSectorCount	: Number of sectors actually written		*/
/*----------------------------------------------------------------------*/

#define flAbsWrite(ioreq)	flCall(FL_ABS_WRITE,ioreq)


/*----------------------------------------------------------------------*/
/*		         f l A b s D e l e t e 				*/
/*									*/
/* Marks absolute sectors by sector no. as deleted.			*/
/*									*/
/* Parameters:                                                          */
/*	irHandle	: Drive number (0, 1, ...)			*/
/*	irSectorNo	: First sector no. to write (sector 0 is the	*/
/*			  DOS boot sector).				*/
/*	irSectorCount	: Number of consectutive sectors to delete	*/
/*                                                                      */
/* Returns:                                                             */
/*	FLStatus	: 0 on success, otherwise failed                */
/*	irSectorCount	: Number of sectors actually deleted		*/
/*----------------------------------------------------------------------*/

#define flAbsDelete(ioreq)	flCall(FL_ABS_DELETE,ioreq)


/*----------------------------------------------------------------------*/
/*		           f l G e t B P B 				*/
/*									*/
/* Reads the BIOS Parameter Block from the boot sector			*/
/*									*/
/* Parameters:                                                          */
/*	irHandle	: Drive number (0, 1, ...)			*/
/*      irData		: Address of user buffer to read BPB into	*/
/*                                                                      */
/* Returns:                                                             */
/*	FLStatus		: 0 on success, otherwise failed                */
/*----------------------------------------------------------------------*/

#define flGetBPB(ioreq)		flCall(FL_GET_BPB,ioreq)

#endif /* ABS_READ_WRITE */

#ifdef LOW_LEVEL

/*----------------------------------------------------------------------*/
/*			  P h y s i c a l I n f o			*/
/*									*/
/* A structure that holds physical information about the media. The 	*/
/* information includes JEDEC ID, unit size and media size. Pointer	*/
/* to this structure is passed to the function flGetPhysicalInfo where  */
/* it receives the relevant data.					*/
/*									*/
/*----------------------------------------------------------------------*/

typedef struct {
  unsigned short	type;			/* Flash device type (JEDEC id) */
  long int		unitSize;		/* Smallest physically erasable size
						   (with interleaving taken in account) */
  long int		mediaSize;		/* media size */
} PhysicalInfo;

/*----------------------------------------------------------------------*/
/*		         f l G e t P h y s i c a l I n f o 		*/
/*									*/
/* Get physical information of the media. The information includes	*/
/* JEDEC ID, unit size and media size.					*/
/*									*/
/* Parameters:								*/
/*	irHandle	: Drive number (0,1,..)				*/
/*      irData		: Address of user buffer to read physical	*/
/*			  information into.				*/
/*                                                                      */
/* Returns:                                                             */
/*	FLStatus	: 0 on success, otherwise failed                */
/*----------------------------------------------------------------------*/

#define flGetPhysicalInfo(ioreq)	flCall(FL_GET_PHYSICAL_INFO, ioreq)

/*----------------------------------------------------------------------*/
/*		             f l P h y s i c a l R e a d	 	*/
/*									*/
/* Read from a physical address.					*/
/*									*/
/* Parameters:								*/
/*	irHandle	: Drive number (0,1,..)				*/
/*	irAddress	: Physical address to read from.		*/
/*	irByteCount	: Number of bytes to read.			*/
/*      irData		: Address of user buffer to read into.		*/
/*                                                                      */
/* Returns:                                                             */
/*	FLStatus	: 0 on success, otherwise failed                */
/*----------------------------------------------------------------------*/

#define flPhysicalRead(ioreq)		flCall(FL_PHYSICAL_READ,ioreq)

/*----------------------------------------------------------------------*/
/*		             f l P h y s i c a l W r i t e	 	*/
/*									*/
/* Write to a physical address.						*/
/*									*/
/* Parameters:								*/
/*	irHandle	: Drive Number (0,1,..)				*/
/*	irAddress	: Physical address to write to.			*/
/*	irByteCount	: Number of bytes to write.			*/
/*      irData		: Address of user buffer to write from.		*/
/*                                                                      */
/* Returns:                                                             */
/*	FLStatus	: 0 on success, otherwise failed                */
/*----------------------------------------------------------------------*/

#define flPhysicalWrite(ioreq)		flCall(FL_PHYSICAL_WRITE,ioreq)

/*----------------------------------------------------------------------*/
/*		             f l P h y s i c a l E r a s e	 	*/
/*									*/
/* Erase physical units.						*/
/*									*/
/* Parameters:								*/
/* 	irHandle	: Drive number (0,1,..)				*/
/*	irUnitNo	: First unit to erase.				*/
/*	irUnitCount	: Number of units to erase.			*/
/*                                                                      */
/* Returns:                                                             */
/*	FLStatus	: 0 on success, otherwise failed                */
/*----------------------------------------------------------------------*/

#define flPhysicalErase(ioreq)		flCall(FL_PHYSICAL_ERASE,ioreq)

#endif /* LOW_LEVEL */

/*----------------------------------------------------------------------*/
/*                 f l D o n t W a t c h F A T                          */
/*                                                                      */
/* Turns off FAT monitoring.                                            */
/*                                                                      */
/* Parameters:                                                          */
/*      irHandle        : Drive number (0, 1, ...)                      */
/*                                                                      */
/* Returns:                                                             */
/*      FLStatus        : 0 on success, otherwise failed                */
/*----------------------------------------------------------------------*/

#define flDontMonitorFAT(ioreq)    flCall(FL_DONT_MONITOR_FAT,ioreq)


/*----------------------------------------------------------------------*/
/*		            f l I n i t					*/
/*									*/
/* Initializes the FLite system, sockets and timers.			*/
/*									*/
/* Calling this function is optional. If it is not called,		*/
/* initialization will be done automatically on the first FLite call.	*/
/* This function is provided for those applications who want to		*/
/* explicitly initialize the system and get an initialization status.	*/
/*									*/
/* Calling flInit after initialization was done has no effect.		*/
/*									*/
/* Parameters:                                                          */
/*	None								*/
/*                                                                      */
/* Returns:                                                             */
/*	FLStatus	: 0 on success, otherwise failed                */
/*----------------------------------------------------------------------*/

extern FLStatus flInit(void);


#ifdef EXIT

/*----------------------------------------------------------------------*/
/*		            f l E x i t					*/
/*									*/
/* If the application ever exits, flExit should be called before exit.  */
/* flExit flushes all buffers, closes all open files, powers down the   */
/* sockets and removes the interval timer.				*/
/*                                                                      */
/* Parameters:                                                          */
/*	None								*/
/*                                                                      */
/* Returns:                                                             */
/*	Nothing								*/
/*----------------------------------------------------------------------*/

extern void flExit(void);

#endif /* EXIT */

#ifdef __cplusplus
}
#endif

#endif

⌨️ 快捷键说明

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