Library for SD card
Dependents: SDFileSystem_HelloWorld Sharp_ce140f_emul
FATFileSystem/FATFileHandle.h@2:02f003d025a7, 2022-07-19 (annotated)
- Committer:
- ffxx68
- Date:
- Tue Jul 19 13:49:28 2022 +0000
- Revision:
- 2:02f003d025a7
- Parent:
- 0:3bdfc1556537
SD Card handling added
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AlexVC97 | 0:3bdfc1556537 | 1 | /* mbed Microcontroller Library |
AlexVC97 | 0:3bdfc1556537 | 2 | * Copyright (c) 2006-2012 ARM Limited |
AlexVC97 | 0:3bdfc1556537 | 3 | * |
AlexVC97 | 0:3bdfc1556537 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
AlexVC97 | 0:3bdfc1556537 | 5 | * of this software and associated documentation files (the "Software"), to deal |
AlexVC97 | 0:3bdfc1556537 | 6 | * in the Software without restriction, including without limitation the rights |
AlexVC97 | 0:3bdfc1556537 | 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
AlexVC97 | 0:3bdfc1556537 | 8 | * copies of the Software, and to permit persons to whom the Software is |
AlexVC97 | 0:3bdfc1556537 | 9 | * furnished to do so, subject to the following conditions: |
AlexVC97 | 0:3bdfc1556537 | 10 | * |
AlexVC97 | 0:3bdfc1556537 | 11 | * The above copyright notice and this permission notice shall be included in |
AlexVC97 | 0:3bdfc1556537 | 12 | * all copies or substantial portions of the Software. |
AlexVC97 | 0:3bdfc1556537 | 13 | * |
AlexVC97 | 0:3bdfc1556537 | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
AlexVC97 | 0:3bdfc1556537 | 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
AlexVC97 | 0:3bdfc1556537 | 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
AlexVC97 | 0:3bdfc1556537 | 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
AlexVC97 | 0:3bdfc1556537 | 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
AlexVC97 | 0:3bdfc1556537 | 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
AlexVC97 | 0:3bdfc1556537 | 20 | * SOFTWARE. |
AlexVC97 | 0:3bdfc1556537 | 21 | */ |
AlexVC97 | 0:3bdfc1556537 | 22 | #ifndef MBED_FATFILEHANDLE_H |
AlexVC97 | 0:3bdfc1556537 | 23 | #define MBED_FATFILEHANDLE_H |
AlexVC97 | 0:3bdfc1556537 | 24 | |
AlexVC97 | 0:3bdfc1556537 | 25 | #include "FileHandle.h" |
AlexVC97 | 0:3bdfc1556537 | 26 | |
AlexVC97 | 0:3bdfc1556537 | 27 | using namespace mbed; |
AlexVC97 | 0:3bdfc1556537 | 28 | |
AlexVC97 | 0:3bdfc1556537 | 29 | class FATFileHandle : public FileHandle { |
AlexVC97 | 0:3bdfc1556537 | 30 | public: |
AlexVC97 | 0:3bdfc1556537 | 31 | |
AlexVC97 | 0:3bdfc1556537 | 32 | FATFileHandle(FIL fh); |
AlexVC97 | 0:3bdfc1556537 | 33 | virtual int close(); |
AlexVC97 | 0:3bdfc1556537 | 34 | virtual ssize_t write(const void* buffer, size_t length); |
AlexVC97 | 0:3bdfc1556537 | 35 | virtual ssize_t read(void* buffer, size_t length); |
AlexVC97 | 0:3bdfc1556537 | 36 | virtual int isatty(); |
AlexVC97 | 0:3bdfc1556537 | 37 | virtual off_t lseek(off_t position, int whence); |
AlexVC97 | 0:3bdfc1556537 | 38 | virtual int fsync(); |
AlexVC97 | 0:3bdfc1556537 | 39 | virtual off_t flen(); |
AlexVC97 | 0:3bdfc1556537 | 40 | |
AlexVC97 | 0:3bdfc1556537 | 41 | protected: |
AlexVC97 | 0:3bdfc1556537 | 42 | |
AlexVC97 | 0:3bdfc1556537 | 43 | FIL _fh; |
AlexVC97 | 0:3bdfc1556537 | 44 | |
AlexVC97 | 0:3bdfc1556537 | 45 | }; |
AlexVC97 | 0:3bdfc1556537 | 46 | |
AlexVC97 | 0:3bdfc1556537 | 47 | #endif |