ye tian / Mbed 2 deprecated missile_command

Dependencies:   4DGL-uLCD-SE mbed wave_player

Fork of missile_command by ECE 2035 TA

Committer:
arvahsu
Date:
Wed Nov 12 02:06:48 2014 +0000
Revision:
2:5e7876719560
Copy the SDFileSystem library due to the original author stop sharing the library.

Who changed what in which revision?

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