Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of FATFileSystem by
FATFileSystem.h
00001 /* mbed Microcontroller Library - FATFileSystem 00002 * Copyright (c) 2008, sford 00003 */ 00004 00005 /* Library: FATFileSystem.h 00006 * A library of stuff to make a fat filesystem on top of a block device 00007 */ 00008 00009 #ifndef MBED_FATFILESYSTEM_H 00010 #define MBED_FATFILESYSTEM_H 00011 00012 #ifndef FFSDEBUG_ENABLED 00013 #define FFSDEBUG_ENABLED 0 00014 #endif 00015 00016 #if FFSDEBUG_ENABLED 00017 #define FFSDEBUG(FMT, ...) printf(FMT, ##__VA_ARGS__) 00018 #else 00019 #define FFSDEBUG(FMT, ...) 00020 #endif 00021 00022 #include "FileSystemLike.h" 00023 #include "FileHandle.h" 00024 #include "ff.h" 00025 #include "diskio.h" 00026 00027 namespace mbed { 00028 /** FATFileSystem 00029 * The class itself 00030 */ 00031 class FATFileSystem : public FileSystemLike { 00032 public: 00033 00034 FATFileSystem(const char* n); 00035 virtual ~FATFileSystem(); 00036 00037 /** open 00038 * open a file on the filesystem. never called directly 00039 */ 00040 virtual FileHandle *open(const char* name, int flags); 00041 virtual int remove(const char *filename); 00042 virtual int format(); 00043 virtual DirHandle *opendir(const char *name); 00044 virtual int mkdir(const char *name, mode_t mode); 00045 00046 FATFS _fs; // Work area (file system object) for logical drive 00047 static FATFileSystem *_ffs[_DRIVES]; // FATFileSystem objects, as parallel to FatFs drives array 00048 int _fsid; 00049 00050 virtual int disk_initialize() { return 0; } 00051 virtual int disk_status() { return 0; } 00052 virtual int disk_read(char *buffer, int sector) = 0; 00053 virtual int disk_write(const char *buffer, int sector) = 0; 00054 virtual int disk_sync() { return 0; } 00055 virtual int disk_sectors() = 0; 00056 00057 }; 00058 00059 } 00060 00061 #endif
Generated on Sat Aug 6 2022 07:26:16 by
