Record audio data to a .wav file, complete with header, using the TLV320 CODEC and I2S port

Dependencies:   mbed

Committer:
d_worrall
Date:
Fri Aug 05 15:00:51 2011 +0000
Revision:
0:e7efc8468066
version 2.0

Who changed what in which revision?

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