First working version of a FATFileSystem compatible Chan FAT v0.8 implementation. This is intended to use with long file names and RTOS support. For now long file names work but RTOS support is still untested.
Dependents: USB_MSC USB_CDC_MSD_Hello TFTPServerTest DMXStation ... more
FATFileHandle.h@0:8ea634413549, 2011-02-01 (annotated)
- Committer:
- NeoBelerophon
- Date:
- Tue Feb 01 21:47:45 2011 +0000
- Revision:
- 0:8ea634413549
Inital version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
NeoBelerophon | 0:8ea634413549 | 1 | /* mbed Microcontroller Library - FATFileHandle |
NeoBelerophon | 0:8ea634413549 | 2 | * Copyright (c) 2008, sford |
NeoBelerophon | 0:8ea634413549 | 3 | */ |
NeoBelerophon | 0:8ea634413549 | 4 | |
NeoBelerophon | 0:8ea634413549 | 5 | #ifndef MBED_FATFILEHANDLE_H |
NeoBelerophon | 0:8ea634413549 | 6 | #define MBED_FATFILEHANDLE_H |
NeoBelerophon | 0:8ea634413549 | 7 | |
NeoBelerophon | 0:8ea634413549 | 8 | #include "FileHandle.h" |
NeoBelerophon | 0:8ea634413549 | 9 | #include "ff.h" |
NeoBelerophon | 0:8ea634413549 | 10 | |
NeoBelerophon | 0:8ea634413549 | 11 | namespace mbed { |
NeoBelerophon | 0:8ea634413549 | 12 | |
NeoBelerophon | 0:8ea634413549 | 13 | class FATFileHandle : public FileHandle { |
NeoBelerophon | 0:8ea634413549 | 14 | public: |
NeoBelerophon | 0:8ea634413549 | 15 | |
NeoBelerophon | 0:8ea634413549 | 16 | FATFileHandle(FIL_t fh); |
NeoBelerophon | 0:8ea634413549 | 17 | virtual int close(); |
NeoBelerophon | 0:8ea634413549 | 18 | virtual ssize_t write(const void* buffer, size_t length); |
NeoBelerophon | 0:8ea634413549 | 19 | virtual ssize_t read(void* buffer, size_t length); |
NeoBelerophon | 0:8ea634413549 | 20 | virtual int isatty(); |
NeoBelerophon | 0:8ea634413549 | 21 | virtual off_t lseek(off_t position, int whence); |
NeoBelerophon | 0:8ea634413549 | 22 | virtual int fsync(); |
NeoBelerophon | 0:8ea634413549 | 23 | virtual off_t flen(); |
NeoBelerophon | 0:8ea634413549 | 24 | |
NeoBelerophon | 0:8ea634413549 | 25 | protected: |
NeoBelerophon | 0:8ea634413549 | 26 | |
NeoBelerophon | 0:8ea634413549 | 27 | FIL_t _fh; |
NeoBelerophon | 0:8ea634413549 | 28 | |
NeoBelerophon | 0:8ea634413549 | 29 | }; |
NeoBelerophon | 0:8ea634413549 | 30 | |
NeoBelerophon | 0:8ea634413549 | 31 | } |
NeoBelerophon | 0:8ea634413549 | 32 | |
NeoBelerophon | 0:8ea634413549 | 33 | #endif |