This is a lib to use ChaNFS lib with USB mass storages like USB Sticks .. Long file names work

Dependencies:  

Dependents:   WeatherStation

Committer:
NeoBelerophon
Date:
Tue Feb 01 22:14:30 2011 +0000
Revision:
0:f0133ccac168
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
NeoBelerophon 0:f0133ccac168 1 /* USB Mass Storage device file system
NeoBelerophon 0:f0133ccac168 2 * Copyrigh (c) 2010, Igor Skochinsky
NeoBelerophon 0:f0133ccac168 3 * based on SDFileStorage
NeoBelerophon 0:f0133ccac168 4 * Copyright (c) 2008-2009, sford
NeoBelerophon 0:f0133ccac168 5 */
NeoBelerophon 0:f0133ccac168 6
NeoBelerophon 0:f0133ccac168 7 #ifndef MSCFILESYSTEM_H
NeoBelerophon 0:f0133ccac168 8 #define MSCFILESYSTEM_H
NeoBelerophon 0:f0133ccac168 9
NeoBelerophon 0:f0133ccac168 10 #include "mbed.h"
NeoBelerophon 0:f0133ccac168 11 #include "FATFileSystem.h"
NeoBelerophon 0:f0133ccac168 12
NeoBelerophon 0:f0133ccac168 13 /* Class: MSCFileSystem
NeoBelerophon 0:f0133ccac168 14 * Access the filesystem on an attached USB mass storage device (e.g. a memory stick)
NeoBelerophon 0:f0133ccac168 15 *
NeoBelerophon 0:f0133ccac168 16 * Example:
NeoBelerophon 0:f0133ccac168 17 * > MSCFileSystem msc("msc");
NeoBelerophon 0:f0133ccac168 18 * >
NeoBelerophon 0:f0133ccac168 19 * > int main() {
NeoBelerophon 0:f0133ccac168 20 * > FILE *fp = fopen("/msc/myfile.txt", "w");
NeoBelerophon 0:f0133ccac168 21 * > fprintf(fp, "Hello World!\n");
NeoBelerophon 0:f0133ccac168 22 * > fclose(fp);
NeoBelerophon 0:f0133ccac168 23 * > }
NeoBelerophon 0:f0133ccac168 24 */
NeoBelerophon 0:f0133ccac168 25 class MSCFileSystem : public FATFileSystem {
NeoBelerophon 0:f0133ccac168 26 public:
NeoBelerophon 0:f0133ccac168 27
NeoBelerophon 0:f0133ccac168 28 /* Constructor: MSCFileSystem
NeoBelerophon 0:f0133ccac168 29 * Create the File System for accessing a USB mass storage device
NeoBelerophon 0:f0133ccac168 30 *
NeoBelerophon 0:f0133ccac168 31 * Parameters:
NeoBelerophon 0:f0133ccac168 32 * name - The name used to access the filesystem
NeoBelerophon 0:f0133ccac168 33 */
NeoBelerophon 0:f0133ccac168 34 MSCFileSystem(const char* name);
NeoBelerophon 0:f0133ccac168 35 virtual int disk_initialize();
NeoBelerophon 0:f0133ccac168 36 virtual int disk_write(const char *buffer, int block_number);
NeoBelerophon 0:f0133ccac168 37 virtual int disk_read(char *buffer, int block_number);
NeoBelerophon 0:f0133ccac168 38 virtual int disk_status();
NeoBelerophon 0:f0133ccac168 39 virtual int disk_sync();
NeoBelerophon 0:f0133ccac168 40 virtual int disk_sectors();
NeoBelerophon 0:f0133ccac168 41
NeoBelerophon 0:f0133ccac168 42 protected:
NeoBelerophon 0:f0133ccac168 43
NeoBelerophon 0:f0133ccac168 44 int initialise_msc();
NeoBelerophon 0:f0133ccac168 45 uint32_t _numBlks;
NeoBelerophon 0:f0133ccac168 46 uint32_t _blkSize;
NeoBelerophon 0:f0133ccac168 47 };
NeoBelerophon 0:f0133ccac168 48
NeoBelerophon 0:f0133ccac168 49 #endif