Description: C1541-III mbed edition
fat.h
00001 #ifndef _FAT_H_INCLUDED 00002 #define _FAT_H_INCLUDED 00003 00004 struct file2TYPE 00005 { 00006 unsigned char name[12]; /*name of file*/ 00007 unsigned char name_lfn[27]; /*name of file according the long-file-name information*/ 00008 unsigned short entry; /*file-entry index in directory table*/ 00009 unsigned short sec; /*sector index in file*/ 00010 unsigned short len; /*total number of sectors in file, 0 if not a file*/ 00011 unsigned long size; /*filesize in bytes*/ 00012 unsigned short cluster; /*current cluster*/ 00013 }; 00014 00015 /*functions*/ 00016 unsigned char FindDrive(void); 00017 unsigned char FileSearch(struct file2TYPE *file, unsigned char mode); /*attention: screws up secbuf!!*/ 00018 unsigned char OpenSubDirectory(struct file2TYPE *file); 00019 unsigned char FileSectorScan(struct file2TYPE *file); 00020 unsigned char FileNextSector(struct file2TYPE *file); /*attention: screws up databuffer!!*/ 00021 unsigned char FileReadSector(struct file2TYPE *file); /*attention: secbuf is valid after this command*/ 00022 unsigned char FileReadSector_X(struct file2TYPE *file, unsigned long block); 00023 unsigned char FileRead_X_Bytes(struct file2TYPE *file, unsigned long startaddress, unsigned int NmbrOfBytes); 00024 unsigned char FileWriteSector_X(struct file2TYPE *file, unsigned long block); 00025 00026 #define ERROR_FAT_READBOOTSECTOR 30 00027 #define ERROR_FAT_JUMPOPCODE 31 00028 #define ERROR_FAT_BLOCKSIZE 32 00029 #define ERROR_FAT_MEDIUM 33 00030 00031 #endif
