HEPTA-Sat Hands-On
/
HeptaXbee_CountUp
Xbee CountUp
Fork of HeptaXbee_CountUp by
hepta_sat/SDFileSystem/FATFileSystem/FATFileSystem.h@1:715b80d2a02b, 2016-12-13 (annotated)
- Committer:
- tomoya123
- Date:
- Tue Dec 13 07:55:03 2016 +0000
- Revision:
- 1:715b80d2a02b
- Parent:
- 0:0a7fa0911e6c
Xbee CountUp
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tomoya123 | 0:0a7fa0911e6c | 1 | /* mbed Microcontroller Library |
tomoya123 | 0:0a7fa0911e6c | 2 | * Copyright (c) 2006-2012 ARM Limited |
tomoya123 | 0:0a7fa0911e6c | 3 | * |
tomoya123 | 0:0a7fa0911e6c | 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
tomoya123 | 0:0a7fa0911e6c | 5 | * of this software and associated documentation files (the "Software"), to deal |
tomoya123 | 0:0a7fa0911e6c | 6 | * in the Software without restriction, including without limitation the rights |
tomoya123 | 0:0a7fa0911e6c | 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
tomoya123 | 0:0a7fa0911e6c | 8 | * copies of the Software, and to permit persons to whom the Software is |
tomoya123 | 0:0a7fa0911e6c | 9 | * furnished to do so, subject to the following conditions: |
tomoya123 | 0:0a7fa0911e6c | 10 | * |
tomoya123 | 0:0a7fa0911e6c | 11 | * The above copyright notice and this permission notice shall be included in |
tomoya123 | 0:0a7fa0911e6c | 12 | * all copies or substantial portions of the Software. |
tomoya123 | 0:0a7fa0911e6c | 13 | * |
tomoya123 | 0:0a7fa0911e6c | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
tomoya123 | 0:0a7fa0911e6c | 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
tomoya123 | 0:0a7fa0911e6c | 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
tomoya123 | 0:0a7fa0911e6c | 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
tomoya123 | 0:0a7fa0911e6c | 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
tomoya123 | 0:0a7fa0911e6c | 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
tomoya123 | 0:0a7fa0911e6c | 20 | * SOFTWARE. |
tomoya123 | 0:0a7fa0911e6c | 21 | */ |
tomoya123 | 0:0a7fa0911e6c | 22 | #ifndef MBED_FATFILESYSTEM_H |
tomoya123 | 0:0a7fa0911e6c | 23 | #define MBED_FATFILESYSTEM_H |
tomoya123 | 0:0a7fa0911e6c | 24 | |
tomoya123 | 0:0a7fa0911e6c | 25 | #include "FileSystemLike.h" |
tomoya123 | 0:0a7fa0911e6c | 26 | #include "FileHandle.h" |
tomoya123 | 0:0a7fa0911e6c | 27 | #include "ff.h" |
tomoya123 | 0:0a7fa0911e6c | 28 | #include <stdint.h> |
tomoya123 | 0:0a7fa0911e6c | 29 | |
tomoya123 | 0:0a7fa0911e6c | 30 | using namespace mbed; |
tomoya123 | 0:0a7fa0911e6c | 31 | |
tomoya123 | 0:0a7fa0911e6c | 32 | class FATFileSystem : public FileSystemLike { |
tomoya123 | 0:0a7fa0911e6c | 33 | public: |
tomoya123 | 0:0a7fa0911e6c | 34 | |
tomoya123 | 0:0a7fa0911e6c | 35 | FATFileSystem(const char* n); |
tomoya123 | 0:0a7fa0911e6c | 36 | virtual ~FATFileSystem(); |
tomoya123 | 0:0a7fa0911e6c | 37 | |
tomoya123 | 0:0a7fa0911e6c | 38 | static FATFileSystem * _ffs[_VOLUMES]; // FATFileSystem objects, as parallel to FatFs drives array |
tomoya123 | 0:0a7fa0911e6c | 39 | FATFS _fs; // Work area (file system object) for logical drive |
tomoya123 | 0:0a7fa0911e6c | 40 | int _fsid; |
tomoya123 | 0:0a7fa0911e6c | 41 | |
tomoya123 | 0:0a7fa0911e6c | 42 | virtual FileHandle *open(const char* name, int flags); |
tomoya123 | 0:0a7fa0911e6c | 43 | virtual int remove(const char *filename); |
tomoya123 | 0:0a7fa0911e6c | 44 | virtual int format(); |
tomoya123 | 0:0a7fa0911e6c | 45 | virtual DirHandle *opendir(const char *name); |
tomoya123 | 0:0a7fa0911e6c | 46 | virtual int mkdir(const char *name, mode_t mode); |
tomoya123 | 0:0a7fa0911e6c | 47 | |
tomoya123 | 0:0a7fa0911e6c | 48 | virtual int disk_initialize() { return 0; } |
tomoya123 | 0:0a7fa0911e6c | 49 | virtual int disk_status() { return 0; } |
tomoya123 | 0:0a7fa0911e6c | 50 | virtual int disk_read(uint8_t * buffer, uint64_t sector) = 0; |
tomoya123 | 0:0a7fa0911e6c | 51 | virtual int disk_write(const uint8_t * buffer, uint64_t sector) = 0; |
tomoya123 | 0:0a7fa0911e6c | 52 | virtual int disk_sync() { return 0; } |
tomoya123 | 0:0a7fa0911e6c | 53 | virtual uint64_t disk_sectors() = 0; |
tomoya123 | 0:0a7fa0911e6c | 54 | |
tomoya123 | 0:0a7fa0911e6c | 55 | }; |
tomoya123 | 0:0a7fa0911e6c | 56 | |
tomoya123 | 0:0a7fa0911e6c | 57 | #endif |