mbed Dev board test program

Dependencies:   EthernetNetIf mbed HTTPServer SerialLCD

Committer:
pangsk
Date:
Mon Jul 11 15:02:04 2011 +0000
Revision:
0:0f36b9fac4c5

        

Who changed what in which revision?

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