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

📄 fat16.h

📁 Build ourself a MP3 Player
💻 H
字号:
// BPB info
typedef unsigned int16 uint16;
typedef unsigned int32 uint32;

uint16 BPB_StartSector;
uint16 BPB_ReservedSectorCount;
uint16 BPB_FATstart;               // sector the FAT starts in
byte  BPB_NumFATs;                // number of FATs (should be two)
uint16 BPB_BytesPerSector;         // # bytes per sector (should be 512)
byte  BPB_SectorsPerCluster;      // should be like 4 or something
uint16 BPB_FATSize;                   // size of fat
uint16 FAT_StartSector;
uint16 BPB_RootDirEntryCount;
uint16 FAT_FirstDataSector;        // where data starts
uint16 FAT_RootDirStartSector;     // first sector of root directory
uint16 FAT_RootDirNumSectors;      // number of sectors allocated to root directory

// Current Directory state
char  CWD_Name[9];
uint32 CWD_StartSector;
uint32 CWD_CurrSector;
byte  CWD_NumEntries;

// Current File state
char  File_Name[12];
char  File_Attr;
uint16 File_StartCluster;
uint16 File_CurrCluster;
uint32 File_Size;
uint32 File_CurrSector;
byte  File_CurrSectorNumInCluster;
uint32 File_CurrByte;
uint32 File_DirSectorNum;
uint16 File_DirEntryNum;           // this file is # in the current directory


#define FAT_IS_DIR 0x10
#define FAT_END_OF_DIR 0x2
#define FAT_FILE_DELETED 0xe5
#define FAT_LONG_FILENAME 0x3

uint32 FAT_ConvertClusterToSector(uint16 cluster);
void FAT_PrintCurrFileInfo();
uint16 FAT_GetNextCluster(uint16 cluster);
byte FAT_LoadFileInCWD(int16 filenumber);

int16 FAT_findUnusedCluster();
int16 FAT_findNextUnusedCluster(int16 oldcluster);
boolean FAT_loadFileWithName(char *filename);

⌨️ 快捷键说明

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