SNAKE GAME

Dependencies:   mbed wave_player 4DGL-uLCD-SE MMA8452

Committer:
congvu
Date:
Wed Nov 25 04:25:25 2020 +0000
Revision:
0:24041b847eb5
ECE2035 SNAKE GAME;

Who changed what in which revision?

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