Gert van der Knokke
/
C1541III
C1541-III mbed edition
fat.h@1:0cbbb66a6100, 2011-08-22 (annotated)
- Committer:
- gertk
- Date:
- Mon Aug 22 21:11:59 2011 +0000
- Revision:
- 1:0cbbb66a6100
- Parent:
- 0:28557a4d2215
updated the nRESET pin to an interrupt capable pin (p29)
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 |