Code for autonomous ground vehicle, Data Bus, 3rd place winner in 2012 Sparkfun AVC.

Dependencies:   Watchdog mbed Schedule SimpleFilter LSM303DLM PinDetect DebounceIn Servo

Committer:
shimniok
Date:
Wed Jun 20 14:57:48 2012 +0000
Revision:
0:826c6171fc1b
Updated documentation

Who changed what in which revision?

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