![](/media/cache/profiles/f93486bfff38ca69d76d85c089569a09.50x50_q85.jpg)
C1541-III mbed edition
fat.h@0:28557a4d2215, 2011-08-22 (annotated)
- Committer:
- gertk
- Date:
- Mon Aug 22 05:48:51 2011 +0000
- Revision:
- 0:28557a4d2215
very early test version, works only with FAT16 formatted sd cards
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gertk | 0:28557a4d2215 | 1 | #ifndef _FAT_H_INCLUDED |
gertk | 0:28557a4d2215 | 2 | #define _FAT_H_INCLUDED |
gertk | 0:28557a4d2215 | 3 | |
gertk | 0:28557a4d2215 | 4 | struct file2TYPE |
gertk | 0:28557a4d2215 | 5 | { |
gertk | 0:28557a4d2215 | 6 | unsigned char name[12]; /*name of file*/ |
gertk | 0:28557a4d2215 | 7 | unsigned char name_lfn[27]; /*name of file according the long-file-name information*/ |
gertk | 0:28557a4d2215 | 8 | unsigned short entry; /*file-entry index in directory table*/ |
gertk | 0:28557a4d2215 | 9 | unsigned short sec; /*sector index in file*/ |
gertk | 0:28557a4d2215 | 10 | unsigned short len; /*total number of sectors in file, 0 if not a file*/ |
gertk | 0:28557a4d2215 | 11 | unsigned long size; /*filesize in bytes*/ |
gertk | 0:28557a4d2215 | 12 | unsigned short cluster; /*current cluster*/ |
gertk | 0:28557a4d2215 | 13 | }; |
gertk | 0:28557a4d2215 | 14 | |
gertk | 0:28557a4d2215 | 15 | /*functions*/ |
gertk | 0:28557a4d2215 | 16 | unsigned char FindDrive(void); |
gertk | 0:28557a4d2215 | 17 | unsigned char FileSearch(struct file2TYPE *file, unsigned char mode); /*attention: screws up secbuf!!*/ |
gertk | 0:28557a4d2215 | 18 | unsigned char OpenSubDirectory(struct file2TYPE *file); |
gertk | 0:28557a4d2215 | 19 | unsigned char FileSectorScan(struct file2TYPE *file); |
gertk | 0:28557a4d2215 | 20 | unsigned char FileNextSector(struct file2TYPE *file); /*attention: screws up databuffer!!*/ |
gertk | 0:28557a4d2215 | 21 | unsigned char FileReadSector(struct file2TYPE *file); /*attention: secbuf is valid after this command*/ |
gertk | 0:28557a4d2215 | 22 | unsigned char FileReadSector_X(struct file2TYPE *file, unsigned long block); |
gertk | 0:28557a4d2215 | 23 | unsigned char FileRead_X_Bytes(struct file2TYPE *file, unsigned long startaddress, unsigned int NmbrOfBytes); |
gertk | 0:28557a4d2215 | 24 | unsigned char FileWriteSector_X(struct file2TYPE *file, unsigned long block); |
gertk | 0:28557a4d2215 | 25 | |
gertk | 0:28557a4d2215 | 26 | #define ERROR_FAT_READBOOTSECTOR 30 |
gertk | 0:28557a4d2215 | 27 | #define ERROR_FAT_JUMPOPCODE 31 |
gertk | 0:28557a4d2215 | 28 | #define ERROR_FAT_BLOCKSIZE 32 |
gertk | 0:28557a4d2215 | 29 | #define ERROR_FAT_MEDIUM 33 |
gertk | 0:28557a4d2215 | 30 | |
gertk | 0:28557a4d2215 | 31 | #endif |