資源簡介
a portable FAT decoder class which is hardware independent.All hardware specific operations are abstracted with the class HALayer. The FATLib class operates with only the buffer which it passes to the class HALayer!!!

代碼片段和文件信息
/**
?* FATLib.c: implementation?of?the?FATLib?class.
?* class?FATLib: a?portable?FAT?decoder?class?which?is?hardware?independent.
?* All?hardware?specific?operations?are?abstracted?with?the
?* class?HAlayer.??The?FATLib?class?operates?with?only?the?buffer
?* which?it?passes?to?the?class?HAlayer
?*
?* Author: Ivan?Sham
?* Date:?July?1?2004
?* Version:?2.0
?* Note:?Developed?for?William?Hue?and?Pete?Rizun
?*
?*****************************************************************
?*??Change?Log
?*----------------------------------------------------------------
?*??Date????|???Author??????????|?Reason?for?change
?*----------------------------------------------------------------
?*?Aug31/04?????William?Hue???????Changed?char?types?to
?*????????????????????????????????unsigned?char.
?*
?*?Jul18/04?????Alex?Jiang????????Made?local?variables?and?functions
?*????????????????????????????????static?and?moved?to?fatlib.c.
?*????????????????????????????????Prefixed?public?functions?with
?*????????????????????????????????“fat_“.
?*
?*?Jan02/05?????William?Hue???????Various?bugfixes?and?clean-up?for
?*????????????????????????????????Circuit?Cellar?article.
?**/
#include?“FATLib.h“
//------------------
//?private?member?variables:
//------------------
/**
?* defines?the?structure?of?a?opened?file
?**/
typedef?struct
{
unsigned?long?currentCluster;
unsigned?int?byteCount;
unsigned?long?firstCluster;????
????unsigned?long?fileSize;
????unsigned?long?dirLocation;????
????unsigned?char?sectorCount;????
signed?char?fileHandle;
????unsigned?char?updateDir;
}?file;
/**
?* array?of?size?BUFFER_SIZE?of?pointers?to?nodes?of
?* struct?file?opened?for?reading
?**/
static?file?openedRead[BUFFER_SIZE];
/**
?* array?of?size?BUFFER_SIZE?of?pointers?to?nodes?of
?* struct?file?opened?for?writing
?**/
static?file?openedWrite[BUFFER_SIZE];
/**
?* sectors?offset?from?absolute?sector?0?in?the?MMC/SD.
?*??All?operations?with?the?MMC/SD?card?are?offseted?with
?* this?variable?in?a?microcontroller?application
?* ****this?equals?zero?in?Windows?application
?**/
unsigned?long?sectorZero;
/**
?* the?sector?in?the?MMC/SD?card?where?data?starts.
?* This?is?right?after?the?root?directory?sectors?in?FAT16
?**/
static?unsigned?long?dataStarts;
/**
?* the?first?sector?where?entries?in?the?root?directory?is
?* stored?in?FAT16.
?**/
static?unsigned?long?rootDirectory;
/**
?* the?number?of?sectors?per?File?Allocation?Table?(FAT)
?**/
static?unsigned?long?sectorsPerFAT;
/**
?* the?number?of?sectors?per?cluster?for?the?MMC/SD?card
?**/
static?unsigned?int?sectorsPerCluster;
/**
?* the?number?of?reserved?sectors?in?the?MMC/SD?card
?**/
static?unsigned?int?reservedSectors;
/**
?* the?number?of?File?Allocation?Table?(FAT)?on?the?MMC/SD.
?* this?is?usually?2
?**/
static?unsigned?int?numOfFATs;
/**
?* the?number?of?sectors?in?the?section?for?root?directory
?* entries.
?**/
st
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????61602??2008-06-07?18:48??MSP430_FAT16源碼\Debug\Exe\fat16.d43
?????文件????????321??2008-11-15?19:08??MSP430_FAT16源碼\Debug\Obj\fat16.pbd
?????文件?????149069??2008-06-06?23:42??MSP430_FAT16源碼\Debug\Obj\fatLib.r43
?????文件??????55874??2008-06-06?23:42??MSP430_FAT16源碼\Debug\Obj\HAla
?????文件??????15630??2008-06-06?23:42??MSP430_FAT16源碼\Debug\Obj\lcd_ch.r43
?????文件??????39563??2008-06-07?18:48??MSP430_FAT16源碼\Debug\Obj\main.r43
?????文件???????6230??2008-06-06?23:42??MSP430_FAT16源碼\Debug\Obj\USART.r43
?????文件???????5201??2008-11-15?19:25??MSP430_FAT16源碼\fat16.dep
?????文件??????11915??2008-05-29?00:47??MSP430_FAT16源碼\fat16.ewd
?????文件??????44377??2008-06-06?23:42??MSP430_FAT16源碼\fat16.ewp
?????文件????????159??2008-06-25?12:46??MSP430_FAT16源碼\fat16.eww
?????文件??????37565??2008-06-06?23:31??MSP430_FAT16源碼\fatLib.c
?????文件???????5182??2005-01-02?20:54??MSP430_FAT16源碼\fatlib.h
?????文件??????14853??2008-05-29?20:52??MSP430_FAT16源碼\HAla
?????文件???????9107??2008-05-29?20:06??MSP430_FAT16源碼\HAla
?????文件????????618??2008-04-12?15:42??MSP430_FAT16源碼\LCD.h
?????文件???????3208??2008-05-30?22:53??MSP430_FAT16源碼\LCD_source\lcd_ch.c
?????文件????????867??2008-04-13?15:09??MSP430_FAT16源碼\LCD_source\lcd_ch.h
?????文件????????618??2008-04-12?15:42??MSP430_FAT16源碼\LCD_source\main_include\LCD.h
?????文件???????6076??2008-06-07?18:48??MSP430_FAT16源碼\main.c
?????文件???????6459??2008-11-15?19:25??MSP430_FAT16源碼\settings\fat16.dbgdt
?????文件????????901??2008-11-15?19:25??MSP430_FAT16源碼\settings\fat16.dni
?????文件???????3543??2008-06-25?12:46??MSP430_FAT16源碼\settings\fat16.wsdt
?????文件???????1300??2004-08-06?11:07??MSP430_FAT16源碼\typedefs.h
?????文件????????295??2008-04-27?21:16??MSP430_FAT16源碼\USART.h
?????文件????????295??2008-04-27?21:16??MSP430_FAT16源碼\USART_source\main_include\USART.h
?????文件???????2418??2008-06-03?00:46??MSP430_FAT16源碼\USART_source\USART.c
?????文件???????1242??2008-05-24?00:55??MSP430_FAT16源碼\USART_source\USART_ch.h
?????目錄??????????0??2009-03-11?23:43??MSP430_FAT16源碼\Debug\Exe
?????目錄??????????0??2009-03-11?23:43??MSP430_FAT16源碼\Debug\List
............此處省略11個文件信息
- 上一篇:beckhoff ADS
- 下一篇:GPS開發資料
評論
共有 條評論