RAMDisk example for the USBFileSystem
Dependencies: mbed USBFileSystem
Fork of USBFileSystem_RAMDISK_HelloWorld by
RAM_DISK/USBMSD_Ram.h@5:9261d5bd633b, 2015-01-18 (annotated)
- Committer:
- Sissors
- Date:
- Sun Jan 18 21:43:26 2015 +0000
- Revision:
- 5:9261d5bd633b
- Parent:
- 4:69b7cece8e72
Actually use count argument
;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Sissors | 1:e1b0157ce547 | 1 | /* mbed USBMSD_Ram Library, for providing file access to SD cards |
Sissors | 1:e1b0157ce547 | 2 | * Copyright (c) 2008-2010, sford |
Sissors | 1:e1b0157ce547 | 3 | * |
Sissors | 1:e1b0157ce547 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
Sissors | 1:e1b0157ce547 | 5 | * of this software and associated documentation files (the "Software"), to deal |
Sissors | 1:e1b0157ce547 | 6 | * in the Software without restriction, including without limitation the rights |
Sissors | 1:e1b0157ce547 | 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
Sissors | 1:e1b0157ce547 | 8 | * copies of the Software, and to permit persons to whom the Software is |
Sissors | 1:e1b0157ce547 | 9 | * furnished to do so, subject to the following conditions: |
Sissors | 1:e1b0157ce547 | 10 | * |
Sissors | 1:e1b0157ce547 | 11 | * The above copyright notice and this permission notice shall be included in |
Sissors | 1:e1b0157ce547 | 12 | * all copies or substantial portions of the Software. |
Sissors | 1:e1b0157ce547 | 13 | * |
Sissors | 1:e1b0157ce547 | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
Sissors | 1:e1b0157ce547 | 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
Sissors | 1:e1b0157ce547 | 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
Sissors | 1:e1b0157ce547 | 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
Sissors | 1:e1b0157ce547 | 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
Sissors | 1:e1b0157ce547 | 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
Sissors | 1:e1b0157ce547 | 20 | * THE SOFTWARE. |
Sissors | 1:e1b0157ce547 | 21 | */ |
Sissors | 1:e1b0157ce547 | 22 | |
Sissors | 1:e1b0157ce547 | 23 | #ifndef USBMSD_RAM_H |
Sissors | 1:e1b0157ce547 | 24 | #define USBMSD_RAM_H |
Sissors | 1:e1b0157ce547 | 25 | |
Sissors | 1:e1b0157ce547 | 26 | #include "mbed.h" |
Sissors | 2:1c8a3c4ba703 | 27 | #include "USBFileSystem.h" |
Sissors | 1:e1b0157ce547 | 28 | |
Sissors | 2:1c8a3c4ba703 | 29 | class USBMSD_Ram : public USBFileSystem { |
Sissors | 1:e1b0157ce547 | 30 | public: |
Sissors | 1:e1b0157ce547 | 31 | |
Sissors | 1:e1b0157ce547 | 32 | |
Sissors | 1:e1b0157ce547 | 33 | USBMSD_Ram(); |
Sissors | 1:e1b0157ce547 | 34 | virtual int disk_initialize(); |
Sissors | 4:69b7cece8e72 | 35 | virtual int _disk_write(const uint8_t * data, uint64_t block, uint8_t count); |
Sissors | 4:69b7cece8e72 | 36 | virtual int disk_read(uint8_t * data, uint64_t block, uint8_t count); |
Sissors | 2:1c8a3c4ba703 | 37 | virtual int _disk_status(); |
Sissors | 1:e1b0157ce547 | 38 | virtual int disk_sync(); |
Sissors | 1:e1b0157ce547 | 39 | virtual uint64_t disk_sectors(); |
Sissors | 1:e1b0157ce547 | 40 | |
Sissors | 1:e1b0157ce547 | 41 | protected: |
Sissors | 1:e1b0157ce547 | 42 | int _status; |
Sissors | 2:1c8a3c4ba703 | 43 | char disk_image[512*16]; |
Sissors | 1:e1b0157ce547 | 44 | |
Sissors | 1:e1b0157ce547 | 45 | }; |
Sissors | 1:e1b0157ce547 | 46 | |
Sissors | 1:e1b0157ce547 | 47 | #endif |