Committer:
apm_litoral
Date:
Tue Apr 10 03:33:17 2012 +0000
Revision:
0:fdc81fb10bd5

        

Who changed what in which revision?

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