Dependencies: PinDetect TextLCD mbed mRotaryEncoder
FATFileSystem/Interface/FATFileSystem.h@0:afb2650fb49a, 2012-02-13 (annotated)
- Committer:
- cicklaus
- Date:
- Mon Feb 13 02:11:20 2012 +0000
- Revision:
- 0:afb2650fb49a
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
cicklaus | 0:afb2650fb49a | 1 | /* mbed Microcontroller Library - FATFileSystem |
cicklaus | 0:afb2650fb49a | 2 | Copyright (c) 2008, sford */ |
cicklaus | 0:afb2650fb49a | 3 | |
cicklaus | 0:afb2650fb49a | 4 | //Modified by Thomas Hamilton, Copyright 2010 |
cicklaus | 0:afb2650fb49a | 5 | |
cicklaus | 0:afb2650fb49a | 6 | #ifndef MBED_FATFILESYSTEM_H |
cicklaus | 0:afb2650fb49a | 7 | #define MBED_FATFILESYSTEM_H |
cicklaus | 0:afb2650fb49a | 8 | |
cicklaus | 0:afb2650fb49a | 9 | #include "stdint.h" |
cicklaus | 0:afb2650fb49a | 10 | #include "ff.h" |
cicklaus | 0:afb2650fb49a | 11 | #include "mbed.h" |
cicklaus | 0:afb2650fb49a | 12 | #include "FileSystemLike.h" |
cicklaus | 0:afb2650fb49a | 13 | #include "FATFileHandle.h" |
cicklaus | 0:afb2650fb49a | 14 | #include "FATDirHandle.h" |
cicklaus | 0:afb2650fb49a | 15 | #include <stdio.h> |
cicklaus | 0:afb2650fb49a | 16 | |
cicklaus | 0:afb2650fb49a | 17 | class FATFileSystem : public FileSystemLike |
cicklaus | 0:afb2650fb49a | 18 | { |
cicklaus | 0:afb2650fb49a | 19 | private: |
cicklaus | 0:afb2650fb49a | 20 | FATFS FileSystemObject; |
cicklaus | 0:afb2650fb49a | 21 | unsigned char Drive; |
cicklaus | 0:afb2650fb49a | 22 | |
cicklaus | 0:afb2650fb49a | 23 | public: |
cicklaus | 0:afb2650fb49a | 24 | static FATFileSystem* DriveArray[_DRIVES]; |
cicklaus | 0:afb2650fb49a | 25 | |
cicklaus | 0:afb2650fb49a | 26 | FATFileSystem(const char* SystemName); |
cicklaus | 0:afb2650fb49a | 27 | virtual ~FATFileSystem(); |
cicklaus | 0:afb2650fb49a | 28 | |
cicklaus | 0:afb2650fb49a | 29 | int format(unsigned int allocationunit); |
cicklaus | 0:afb2650fb49a | 30 | |
cicklaus | 0:afb2650fb49a | 31 | virtual FileHandle* open(const char* filename, int flags); |
cicklaus | 0:afb2650fb49a | 32 | virtual int remove(const char* filename); |
cicklaus | 0:afb2650fb49a | 33 | virtual int rename(const char* oldname, const char* newname); |
cicklaus | 0:afb2650fb49a | 34 | virtual DirHandle* opendir(const char* name); |
cicklaus | 0:afb2650fb49a | 35 | virtual int mkdir(const char* name, mode_t mode); |
cicklaus | 0:afb2650fb49a | 36 | |
cicklaus | 0:afb2650fb49a | 37 | virtual unsigned char disk_initialize() { return 0x00; } |
cicklaus | 0:afb2650fb49a | 38 | virtual unsigned char disk_status() { return 0x00; } |
cicklaus | 0:afb2650fb49a | 39 | virtual unsigned char disk_read(unsigned char* buff, |
cicklaus | 0:afb2650fb49a | 40 | unsigned long sector, unsigned char count) = 0; |
cicklaus | 0:afb2650fb49a | 41 | virtual unsigned char disk_write(const unsigned char* buff, |
cicklaus | 0:afb2650fb49a | 42 | unsigned long sector, unsigned char count) = 0; |
cicklaus | 0:afb2650fb49a | 43 | virtual unsigned char disk_sync() { return 0x00; } |
cicklaus | 0:afb2650fb49a | 44 | virtual unsigned long disk_sector_count() = 0; |
cicklaus | 0:afb2650fb49a | 45 | virtual unsigned short disk_sector_size() { return 512; } |
cicklaus | 0:afb2650fb49a | 46 | virtual unsigned long disk_block_size() { return 1; } |
cicklaus | 0:afb2650fb49a | 47 | }; |
cicklaus | 0:afb2650fb49a | 48 | |
cicklaus | 0:afb2650fb49a | 49 | #endif |