ROBOSTEP_3rd_SHARE / Mbed 2 deprecated PS3conOut2

Dependencies:   mbed

Fork of PS3conOut by ROBOSTEP_3rd_SHARE

Committer:
ideguti
Date:
Sat Apr 18 06:27:36 2015 +0000
Revision:
0:0805c5a1b328
koueki you no program

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ideguti 0:0805c5a1b328 1 /* mbed Microcontroller Library - FATFileSystem
ideguti 0:0805c5a1b328 2 * Copyright (c) 2008, sford
ideguti 0:0805c5a1b328 3 */
ideguti 0:0805c5a1b328 4
ideguti 0:0805c5a1b328 5 /* Library: FATFileSystem.h
ideguti 0:0805c5a1b328 6 * A library of stuff to make a fat filesystem on top of a block device
ideguti 0:0805c5a1b328 7 */
ideguti 0:0805c5a1b328 8
ideguti 0:0805c5a1b328 9 #ifndef MBED_FATFILESYSTEM_H
ideguti 0:0805c5a1b328 10 #define MBED_FATFILESYSTEM_H
ideguti 0:0805c5a1b328 11
ideguti 0:0805c5a1b328 12 #ifndef FFSDEBUG_ENABLED
ideguti 0:0805c5a1b328 13 #define FFSDEBUG_ENABLED 0
ideguti 0:0805c5a1b328 14 #endif
ideguti 0:0805c5a1b328 15
ideguti 0:0805c5a1b328 16 #if FFSDEBUG_ENABLED
ideguti 0:0805c5a1b328 17 #define FFSDEBUG(FMT, ...) printf(FMT, ##__VA_ARGS__)
ideguti 0:0805c5a1b328 18 #else
ideguti 0:0805c5a1b328 19 #define FFSDEBUG(FMT, ...)
ideguti 0:0805c5a1b328 20 #endif
ideguti 0:0805c5a1b328 21
ideguti 0:0805c5a1b328 22 #include "FileSystemLike.h"
ideguti 0:0805c5a1b328 23 #include "FileHandle.h"
ideguti 0:0805c5a1b328 24 #include "ff.h"
ideguti 0:0805c5a1b328 25 #include "diskio.h"
ideguti 0:0805c5a1b328 26
ideguti 0:0805c5a1b328 27 namespace mbed {
ideguti 0:0805c5a1b328 28 /* Class: FATFileSystem
ideguti 0:0805c5a1b328 29 * The class itself
ideguti 0:0805c5a1b328 30 */
ideguti 0:0805c5a1b328 31 class FATFileSystem : public FileSystemLike {
ideguti 0:0805c5a1b328 32 public:
ideguti 0:0805c5a1b328 33
ideguti 0:0805c5a1b328 34 FATFileSystem(const char* n);
ideguti 0:0805c5a1b328 35 virtual ~FATFileSystem();
ideguti 0:0805c5a1b328 36
ideguti 0:0805c5a1b328 37 /* Function: open
ideguti 0:0805c5a1b328 38 * open a file on the filesystem. never called directly
ideguti 0:0805c5a1b328 39 */
ideguti 0:0805c5a1b328 40 virtual FileHandle *open(const char* name, int flags);
ideguti 0:0805c5a1b328 41 virtual int remove(const char *filename);
ideguti 0:0805c5a1b328 42 virtual int format();
ideguti 0:0805c5a1b328 43 virtual DirHandle *opendir(const char *name);
ideguti 0:0805c5a1b328 44 virtual int mkdir(const char *name, mode_t mode);
ideguti 0:0805c5a1b328 45
ideguti 0:0805c5a1b328 46 FATFS _fs; // Work area (file system object) for logical drive
ideguti 0:0805c5a1b328 47 static FATFileSystem *_ffs[_DRIVES]; // FATFileSystem objects, as parallel to FatFs drives array
ideguti 0:0805c5a1b328 48 int _fsid;
ideguti 0:0805c5a1b328 49
ideguti 0:0805c5a1b328 50 virtual int disk_initialize() { return 0; }
ideguti 0:0805c5a1b328 51 virtual int disk_status() { return 0; }
ideguti 0:0805c5a1b328 52 virtual int disk_read(char *buffer, int sector) = 0;
ideguti 0:0805c5a1b328 53 virtual int disk_write(const char *buffer, int sector) = 0;
ideguti 0:0805c5a1b328 54 virtual int disk_sync() { return 0; }
ideguti 0:0805c5a1b328 55 virtual int disk_sectors() = 0;
ideguti 0:0805c5a1b328 56
ideguti 0:0805c5a1b328 57 };
ideguti 0:0805c5a1b328 58
ideguti 0:0805c5a1b328 59 }
ideguti 0:0805c5a1b328 60
ideguti 0:0805c5a1b328 61 #endif