VLSI Solution Oy / MegaLib Documentation

fat.h

Go to the documentation of this file.
00001 
00004 #ifndef _FATINFO_H_
00005 #define _FATINFO_H_
00006 
00007 #define FATINFO_IN_Y       /* put the fatInfo to Y(defined) or X (undef) */
00008 #define MAX_FRAGMENTS 35
00009 /* long filename support can be disabled by undeffing FAT_LFN_SIZE--65 words */
00010 #define FAT_LFN_SIZE (2*13 *2) /*52-byte filename*/
00011 
00012 #ifdef ASM
00013 
00014 #define ISFAT32  0
00015 #define FATSTART 1
00016 #define ROOTSTART 3
00017 #define DATASTART 5
00018 #define CURRENTSECTOR 7
00019 #define FILESIZE 9
00020 #define FATSECTORSPERCLUSTER 11
00021 #define BPBROOTENTCNT 12
00022 #define FILSYSTYPE 13
00023 #define TOTSIZE 14
00024 #define FILENAME 16
00025 #define GFILENUM 22
00026 #define FILEPOS 24
00027 #define PARENTDIR 26
00028 #define SUPPORTEDSUFFIXES 28
00029 
00030 #define _IS_FAT_32                _fatInfo+ISFAT32
00031 #define _fatStart                 _fatInfo+FATSTART
00032 #define _rootStart                _fatInfo+ROOTSTART
00033 #define _dataStart                _fatInfo+DATASTART
00034 #define _currentSector            _fatInfo+CURRENTSECTOR
00035 #define _fileSize                 _fatInfo+FILESIZE
00036 #define _fatSectorsPerCluster     _fatInfo+FATSECTORSPERCLUSTER
00037 #define _BPB_RootEntCnt           _fatInfo+BPBROOTENTCNT
00038 
00039 #else
00040 
00041 #define FAT_MKID(a,b,c) ((a)|((b)<<8)|((u_int32)(c)<<16))
00042 //const u_int32 fatDefSupported[] = {FAT_MKID('O','G','G'), FAT_MKID('R','U','N'), 0};
00043 
00044 struct FATINFO { /* do not change sizes or order of fields! */
00045     u_int16 IS_FAT_32;                // _fatInfo+0
00046     u_int32 fatStart;              // _fatInfo+1
00047     u_int32 rootStart;                 // _fatInfo+3
00048     u_int32 dataStart;         // _fatInfo+5
00049     u_int32 currentSector;         // _fatInfo+7
00050     u_int32 fileSize;                    // _fatInfo+9
00051     u_int16 fatSectorsPerCluster;     // _fatInfo+11
00052     u_int16 BPB_RootEntCnt;           // _fatInfo+12
00053     u_int16 FilSysType;  // _fatInfo+13 to detect FAT12
00054     s_int32 totSize;        // _fatInfo+14
00055     u_int16 fileName[6]; // _fatInfo+16
00056     u_int16 gFileNum[2]; // _fatInfo+22
00057     s_int32 filePos;     // _fatInfo+24
00058     s_int32 parentDir;    // _fatInfo+26
00059     const u_int32 *supportedSuffixes;  //_fatInfo+28
00060 #ifdef FAT_LFN_SIZE
00061     u_int16 longFileName[FAT_LFN_SIZE/2];  // _fatInfo+29
00062 #endif
00063 };
00064 
00065 
00066 #define LAST_FRAGMENT 0x80000000UL
00067 struct FRAGMENT {
00068     u_int32 start; 
00069     u_int16 size;  
00070 };
00071 extern __y struct FRAGMENT minifatFragments[MAX_FRAGMENTS];
00072 #ifdef FATINFO_IN_Y
00073 extern __y struct FATINFO minifatInfo;
00074 #else
00075 extern struct FATINFO minifatInfo;
00076 #endif
00077 extern u_int16 minifatBuffer[256]; 
00080 #endif/*ASM*/
00081 
00082 #endif/*_FATINFO_H_*/

All software copyright 2005-2006 VLSI Solution OY. Redistribution of this software is strictly forbidden.