This simple program will test the functionality of the m3pi\'s usb port by reading a file on a usb flash drive (called YourText.txt) and printing it to the m3pi\'s inbuilt LCD display.
FATFileHandle.h
00001 /* mbed Microcontroller Library - FATFileHandle 00002 * Copyright (c) 2008, sford 00003 */ 00004 00005 #ifndef MBED_FATFILEHANDLE_H 00006 #define MBED_FATFILEHANDLE_H 00007 00008 #include "FileHandle.h" 00009 #include "ff.h" 00010 00011 namespace mbed { 00012 00013 class FATFileHandle : public FileHandle { 00014 public: 00015 00016 FATFileHandle(FIL fh); 00017 virtual int close(); 00018 virtual ssize_t write(const void* buffer, size_t length); 00019 virtual ssize_t read(void* buffer, size_t length); 00020 virtual int isatty(); 00021 virtual off_t lseek(off_t position, int whence); 00022 virtual int fsync(); 00023 virtual off_t flen(); 00024 00025 protected: 00026 00027 FIL _fh; 00028 00029 }; 00030 00031 } 00032 00033 #endif
Generated on Wed Jul 13 2022 17:14:52 by 1.7.2