SD Card Interface class. Log raw data bytes to memory addresses of your choice, or format the card and use the FAT file system to write files.

Dependencies:   mbed

Committer:
Blaze513
Date:
Fri Aug 27 00:59:28 2010 +0000
Revision:
4:9a5878d316d5
Parent:
3:210eb67b260c
Child:
6:ddf09d859ed7

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Blaze513 4:9a5878d316d5 1 /* mbed Microcontroller Library - FATFileSystem
Blaze513 4:9a5878d316d5 2 Copyright (c) 2008, sford */
Blaze513 4:9a5878d316d5 3
Blaze513 4:9a5878d316d5 4 //Modified by Thomas Hamilton, Copyright 2010
Blaze513 4:9a5878d316d5 5
Blaze513 4:9a5878d316d5 6 #ifndef MBED_FATFILESYSTEM_H
Blaze513 4:9a5878d316d5 7 #define MBED_FATFILESYSTEM_H
Blaze513 4:9a5878d316d5 8
Blaze513 4:9a5878d316d5 9 #include "stdint.h"
Blaze513 4:9a5878d316d5 10 #include "ff.h"
Blaze513 4:9a5878d316d5 11 #include "mbed.h"
Blaze513 4:9a5878d316d5 12 #include "FileSystemLike.h"
Blaze513 4:9a5878d316d5 13 #include "FATFileHandle.h"
Blaze513 4:9a5878d316d5 14 #include "FATDirHandle.h"
Blaze513 4:9a5878d316d5 15 #include <stdio.h>
Blaze513 4:9a5878d316d5 16
Blaze513 4:9a5878d316d5 17 class FATFileSystem : public FileSystemLike
Blaze513 4:9a5878d316d5 18 {
Blaze513 4:9a5878d316d5 19 private:
Blaze513 4:9a5878d316d5 20 FATFS FileSystemObject;
Blaze513 4:9a5878d316d5 21 unsigned char Drive;
Blaze513 4:9a5878d316d5 22
Blaze513 4:9a5878d316d5 23 public:
Blaze513 4:9a5878d316d5 24 static FATFileSystem* DriveArray[_DRIVES];
Blaze513 4:9a5878d316d5 25
Blaze513 4:9a5878d316d5 26 FATFileSystem(const char* SystemName);
Blaze513 4:9a5878d316d5 27 virtual ~FATFileSystem();
Blaze513 4:9a5878d316d5 28
Blaze513 4:9a5878d316d5 29 virtual FileHandle* open(const char* filename, int flags);
Blaze513 4:9a5878d316d5 30 virtual int remove(const char* filename);
Blaze513 4:9a5878d316d5 31 virtual int rename(const char* oldname, const char* newname);
Blaze513 4:9a5878d316d5 32 virtual DirHandle* opendir(const char* name);
Blaze513 4:9a5878d316d5 33 virtual int mkdir(const char* name, mode_t mode);
Blaze513 4:9a5878d316d5 34
Blaze513 4:9a5878d316d5 35 virtual unsigned char disk_initialize() { return 0x00; }
Blaze513 4:9a5878d316d5 36 virtual unsigned char disk_status() { return 0x00; }
Blaze513 4:9a5878d316d5 37 virtual unsigned char disk_read(unsigned char* buff,
Blaze513 4:9a5878d316d5 38 unsigned long sector, unsigned char count) = 0;
Blaze513 4:9a5878d316d5 39 virtual unsigned char disk_write(const unsigned char* buff,
Blaze513 4:9a5878d316d5 40 unsigned long sector, unsigned char count) = 0;
Blaze513 4:9a5878d316d5 41 virtual unsigned char disk_sync() { return 0x00; }
Blaze513 4:9a5878d316d5 42 virtual unsigned long disk_sector_count() = 0;
Blaze513 4:9a5878d316d5 43 virtual unsigned short disk_sector_size() { return 512; }
Blaze513 4:9a5878d316d5 44 virtual unsigned long disk_block_size() { return 1; }
Blaze513 4:9a5878d316d5 45 };
Blaze513 4:9a5878d316d5 46
Blaze513 1:94c648931f84 47 #endif