欢迎来到天天文库
浏览记录
ID:9315409
大小:167.00 KB
页数:38页
时间:2018-04-27
《sd卡 fat16文件系统源代码》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、/***FATLib.h:interfacefortheFATLib.*classFATLib:aportableFATdecoderclasswhichishardwareindependent.*Allhardwarespecificoperationsareabstractedwiththe*classHALayer.TheFATLibclassoperateswithonlythebuffer*whichitpassestotheclassHALayer**Author:IvanSham*Date:JUly1,2004*Version:2.0*Note:DevelopedforWil
2、liamHueandPeteRizun*******************************************************************ChangeLog*----------------------------------------------------------------*Date
3、Author
4、Reasonforchange*----------------------------------------------------------------*Aug31/04WilliamHueChangedchartypesto*unsigned
5、char.*Putmoreparenthesesinabs()*macro.**Jul18/04AlexJiangPortedtoFABbeltclip.Made*localvariablesandfunctions*staticandmovedtofatlib.c.*Prefixedpublicfuntioswith*"fat_".**Jan02/05WilliamHueVariousbugfixesandclean-upfor*CircuitCellararticle.**/#ifndef_FATLIB_#define_FATLIB_#include"HALayer.h"#defineU
6、NKNOWN0#defineFAT161#defineDIRECTORYTRUE#defineFILEFALSE#defineREADTRUE#defineWRITEFALSE#defineBUFFER_SIZE2#defineabs(x)(((x)>0)?(x):(-(x)))//------------------//memberfunctions://------------------/***initializethesystem**@return0UNKNOWNfilesystem*@return1FAT16filesystem*@return3couldnotsetblockle
7、ngth*@return4couldnotinitializememorycard**/unsignedcharfat_initialize(void);/***closesthefileindicatedbytheinput**@paramfileHandlehandleoffiletobeclosed**@return0filesucessfullyclosed*@return-1invalidfilehandle*@return-2invalidfilesystem**/signedcharfat_close(signedcharfileHandle);/***opensthefile
8、indicatedbytheinputpathname.Ifthepathname*pointstoavalidfile,thefileisaddedtothelistofcurrently*openedfilesforreadingandtheuniquefilehandleisreturned.**@parampathnameapointertothelocationofthefiletobeopened*@parambufthebuffertobeusedtoaccesstheMMC/SDcard**@return-1invalidpathname*@return-2filedoesn
9、otexist*@return-3filealreadyopenedforwriting*@return-4filealreadyopenedforreading*@return-10nohandlesavailable*@return-20memorycarderror*@return-128othererror*@return...filehandleofsucessfullyopenedfile**/s
此文档下载收益归作者所有