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