Implementation of a LocalFileSystem using S25FL216K serial flash memory. Currently only 256kB available!
Dependencies: S25FL216K USBFileSystem
Dependents: S25FL216K_HelloWorld
Flash_USBFileSystem.h@0:9056eb697726, 2013-07-31 (annotated)
- Committer:
- Sissors
- Date:
- Wed Jul 31 19:18:22 2013 +0000
- Revision:
- 0:9056eb697726
v0.1, only 256kB accessible!
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Sissors | 0:9056eb697726 | 1 | #ifndef S25FL216K_USB |
Sissors | 0:9056eb697726 | 2 | #define S25FL216K_USB |
Sissors | 0:9056eb697726 | 3 | |
Sissors | 0:9056eb697726 | 4 | #include "mbed.h" |
Sissors | 0:9056eb697726 | 5 | #include "USBFileSystem.h" |
Sissors | 0:9056eb697726 | 6 | #include "S25FL216K.h" |
Sissors | 0:9056eb697726 | 7 | |
Sissors | 0:9056eb697726 | 8 | /** Local filesystem made with S25FL216K serial flash memory + USBFileSystem library |
Sissors | 0:9056eb697726 | 9 | */ |
Sissors | 0:9056eb697726 | 10 | class FlashUSB : public USBFileSystem { |
Sissors | 0:9056eb697726 | 11 | public: |
Sissors | 0:9056eb697726 | 12 | |
Sissors | 0:9056eb697726 | 13 | FlashUSB(PinName mosi, PinName miso, PinName sclk, PinName cs); |
Sissors | 0:9056eb697726 | 14 | virtual int disk_initialize(); |
Sissors | 0:9056eb697726 | 15 | virtual int _disk_write(const uint8_t * data, uint64_t block); |
Sissors | 0:9056eb697726 | 16 | virtual int disk_read(uint8_t * data, uint64_t block); |
Sissors | 0:9056eb697726 | 17 | virtual int _disk_status(); |
Sissors | 0:9056eb697726 | 18 | virtual int disk_sync(); |
Sissors | 0:9056eb697726 | 19 | virtual uint64_t disk_sectors(); |
Sissors | 0:9056eb697726 | 20 | |
Sissors | 0:9056eb697726 | 21 | protected: |
Sissors | 0:9056eb697726 | 22 | int _status; |
Sissors | 0:9056eb697726 | 23 | S25FL216K flash; |
Sissors | 0:9056eb697726 | 24 | |
Sissors | 0:9056eb697726 | 25 | |
Sissors | 0:9056eb697726 | 26 | }; |
Sissors | 0:9056eb697726 | 27 | |
Sissors | 0:9056eb697726 | 28 | #endif |