old repo - SD card read example
Fork of FATFileSystem by
Diff: FATFileSystem.h
- Revision:
- 4:3ff2606d5713
- Parent:
- 3:e960e2b81a3c
- Child:
- 5:b3b3370574cf
diff -r e960e2b81a3c -r 3ff2606d5713 FATFileSystem.h --- a/FATFileSystem.h Mon Mar 17 14:09:00 2014 +0000 +++ b/FATFileSystem.h Thu Aug 28 13:15:31 2014 +0100 @@ -30,8 +30,8 @@ using namespace mbed; /** - * FATFileSystem based on ChaN's Fat Filesystem library v0.8 - */ + * FATFileSystem based on ChaN's Fat Filesystem library v0.8 + */ class FATFileSystem : public FileSystemLike { public: @@ -41,36 +41,51 @@ static FATFileSystem * _ffs[_VOLUMES]; // FATFileSystem objects, as parallel to FatFs drives array FATFS _fs; // Work area (file system object) for logical drive int _fsid; - + /** - * Opens a file on the filesystem - */ + * Opens a file on the filesystem + */ virtual FileHandle *open(const char* name, int flags); /** * Removes a file path */ virtual int remove(const char *filename); - + + /** + * Renames a file + */ + virtual int rename(const char *oldname, const char *newname); + /** * Formats a logical drive, FDISK artitioning rule, 512 bytes per cluster */ virtual int format(); - + /** - * Opens a directory on the filesystem - */ + * Opens a directory on the filesystem + */ virtual DirHandle *opendir(const char *name); /** * Creates a directory path */ virtual int mkdir(const char *name, mode_t mode); + + /** + * Mounts the filesystem + */ + virtual int mount(); + + /** + * Unmounts the filesystem + */ + virtual int unmount(); virtual int disk_initialize() { return 0; } virtual int disk_status() { return 0; } - virtual int disk_read(uint8_t * buffer, uint64_t sector) = 0; - virtual int disk_write(const uint8_t * buffer, uint64_t sector) = 0; + virtual int disk_read(uint8_t * buffer, uint64_t sector, uint8_t count) = 0; + virtual int disk_write(const uint8_t * buffer, uint64_t sector, uint8_t count) = 0; virtual int disk_sync() { return 0; } virtual uint64_t disk_sectors() = 0;