From 3061ecca3d0fdfb87dabbf5f63c9e06c2a30f53a Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 23 Aug 2018 17:08:59 +0200 Subject: o Initial import. --- .../external/fatfs/doc/00index_e.html | 141 +++++++++ .../external/fatfs/doc/00index_j.html | 141 +++++++++ .../external/fatfs/doc/css_e.css | 67 +++++ .../external/fatfs/doc/css_j.css | 70 +++++ .../external/fatfs/doc/en/appnote.html | 282 ++++++++++++++++++ .../external/fatfs/doc/en/chdir.html | 81 ++++++ .../external/fatfs/doc/en/chdrive.html | 60 ++++ .../external/fatfs/doc/en/chmod.html | 89 ++++++ .../external/fatfs/doc/en/close.html | 65 +++++ .../external/fatfs/doc/en/closedir.html | 64 +++++ .../external/fatfs/doc/en/config.html | 204 +++++++++++++ .../external/fatfs/doc/en/dinit.html | 46 +++ .../external/fatfs/doc/en/dioctl.html | 100 +++++++ .../external/fatfs/doc/en/dread.html | 72 +++++ .../external/fatfs/doc/en/dstat.html | 48 ++++ .../external/fatfs/doc/en/dwrite.html | 76 +++++ .../external/fatfs/doc/en/eof.html | 62 ++++ .../external/fatfs/doc/en/error.html | 62 ++++ .../external/fatfs/doc/en/expand.html | 116 ++++++++ .../external/fatfs/doc/en/fattime.html | 57 ++++ .../external/fatfs/doc/en/fdisk.html | 92 ++++++ .../external/fatfs/doc/en/filename.html | 85 ++++++ .../external/fatfs/doc/en/findfirst.html | 110 +++++++ .../external/fatfs/doc/en/findnext.html | 69 +++++ .../external/fatfs/doc/en/forward.html | 138 +++++++++ .../external/fatfs/doc/en/getcwd.html | 71 +++++ .../external/fatfs/doc/en/getfree.html | 95 ++++++ .../external/fatfs/doc/en/getlabel.html | 82 ++++++ .../external/fatfs/doc/en/gets.html | 65 +++++ .../external/fatfs/doc/en/lseek.html | 130 +++++++++ .../external/fatfs/doc/en/mkdir.html | 80 ++++++ .../external/fatfs/doc/en/mkfs.html | 116 ++++++++ .../external/fatfs/doc/en/mount.html | 83 ++++++ .../external/fatfs/doc/en/open.html | 173 +++++++++++ .../external/fatfs/doc/en/opendir.html | 75 +++++ .../external/fatfs/doc/en/printf.html | 93 ++++++ .../external/fatfs/doc/en/putc.html | 56 ++++ .../external/fatfs/doc/en/puts.html | 56 ++++ .../external/fatfs/doc/en/rc.html | 116 ++++++++ .../external/fatfs/doc/en/read.html | 73 +++++ .../external/fatfs/doc/en/readdir.html | 129 +++++++++ .../external/fatfs/doc/en/rename.html | 88 ++++++ .../external/fatfs/doc/en/sdir.html | 38 +++ .../external/fatfs/doc/en/setlabel.html | 91 ++++++ .../external/fatfs/doc/en/sfatfs.html | 62 ++++ .../external/fatfs/doc/en/sfile.html | 43 +++ .../external/fatfs/doc/en/sfileinfo.html | 69 +++++ .../external/fatfs/doc/en/size.html | 62 ++++ .../external/fatfs/doc/en/stat.html | 110 +++++++ .../external/fatfs/doc/en/sync.html | 65 +++++ .../external/fatfs/doc/en/tell.html | 62 ++++ .../external/fatfs/doc/en/truncate.html | 66 +++++ .../external/fatfs/doc/en/unlink.html | 75 +++++ .../external/fatfs/doc/en/utime.html | 99 +++++++ .../external/fatfs/doc/en/write.html | 73 +++++ .../external/fatfs/doc/ja/appnote.html | 283 ++++++++++++++++++ .../external/fatfs/doc/ja/chdir.html | 81 ++++++ .../external/fatfs/doc/ja/chdrive.html | 61 ++++ .../external/fatfs/doc/ja/chmod.html | 83 ++++++ .../external/fatfs/doc/ja/close.html | 65 +++++ .../external/fatfs/doc/ja/closedir.html | 64 +++++ .../external/fatfs/doc/ja/config.html | 209 ++++++++++++++ .../external/fatfs/doc/ja/dinit.html | 46 +++ .../external/fatfs/doc/ja/dioctl.html | 98 +++++++ .../external/fatfs/doc/ja/dread.html | 72 +++++ .../external/fatfs/doc/ja/dstat.html | 48 ++++ .../external/fatfs/doc/ja/dwrite.html | 76 +++++ .../external/fatfs/doc/ja/eof.html | 62 ++++ .../external/fatfs/doc/ja/error.html | 62 ++++ .../external/fatfs/doc/ja/expand.html | 116 ++++++++ .../external/fatfs/doc/ja/fattime.html | 57 ++++ .../external/fatfs/doc/ja/fdisk.html | 92 ++++++ .../external/fatfs/doc/ja/filename.html | 83 ++++++ .../external/fatfs/doc/ja/findfirst.html | 110 +++++++ .../external/fatfs/doc/ja/findnext.html | 68 +++++ .../external/fatfs/doc/ja/forward.html | 139 +++++++++ .../external/fatfs/doc/ja/getcwd.html | 71 +++++ .../external/fatfs/doc/ja/getfree.html | 95 ++++++ .../external/fatfs/doc/ja/getlabel.html | 82 ++++++ .../external/fatfs/doc/ja/gets.html | 65 +++++ .../external/fatfs/doc/ja/lseek.html | 130 +++++++++ .../external/fatfs/doc/ja/mkdir.html | 80 ++++++ .../external/fatfs/doc/ja/mkfs.html | 114 ++++++++ .../external/fatfs/doc/ja/mount.html | 82 ++++++ .../external/fatfs/doc/ja/open.html | 172 +++++++++++ .../external/fatfs/doc/ja/opendir.html | 75 +++++ .../external/fatfs/doc/ja/printf.html | 93 ++++++ .../external/fatfs/doc/ja/putc.html | 62 ++++ .../external/fatfs/doc/ja/puts.html | 62 ++++ .../external/fatfs/doc/ja/rc.html | 95 ++++++ .../external/fatfs/doc/ja/read.html | 74 +++++ .../external/fatfs/doc/ja/readdir.html | 129 +++++++++ .../external/fatfs/doc/ja/rename.html | 85 ++++++ .../external/fatfs/doc/ja/sdir.html | 38 +++ .../external/fatfs/doc/ja/setlabel.html | 91 ++++++ .../external/fatfs/doc/ja/sfatfs.html | 63 ++++ .../external/fatfs/doc/ja/sfile.html | 45 +++ .../external/fatfs/doc/ja/sfileinfo.html | 69 +++++ .../external/fatfs/doc/ja/size.html | 62 ++++ .../external/fatfs/doc/ja/stat.html | 110 +++++++ .../external/fatfs/doc/ja/sync.html | 65 +++++ .../external/fatfs/doc/ja/tell.html | 62 ++++ .../external/fatfs/doc/ja/truncate.html | 66 +++++ .../external/fatfs/doc/ja/unlink.html | 73 +++++ .../external/fatfs/doc/ja/utime.html | 99 +++++++ .../external/fatfs/doc/ja/write.html | 74 +++++ .../external/fatfs/doc/res/app1.c | 44 +++ .../external/fatfs/doc/res/app2.c | 70 +++++ .../external/fatfs/doc/res/app3.c | 109 +++++++ .../external/fatfs/doc/res/app4.c | 317 +++++++++++++++++++++ .../external/fatfs/doc/res/f1.png | Bin 0 -> 1414 bytes .../external/fatfs/doc/res/f2.png | Bin 0 -> 1458 bytes .../external/fatfs/doc/res/f3.png | Bin 0 -> 1039 bytes .../external/fatfs/doc/res/f4.png | Bin 0 -> 2335 bytes .../external/fatfs/doc/res/f5.png | Bin 0 -> 2479 bytes .../external/fatfs/doc/res/f6.png | Bin 0 -> 1464 bytes .../external/fatfs/doc/res/f7.png | Bin 0 -> 30461 bytes .../external/fatfs/doc/res/fd.mp4 | Bin 0 -> 12670234 bytes .../external/fatfs/doc/res/funcs.png | Bin 0 -> 22722 bytes .../external/fatfs/doc/res/layers.png | Bin 0 -> 5521 bytes .../external/fatfs/doc/res/layers1.png | Bin 0 -> 3843 bytes .../external/fatfs/doc/res/layers2.png | Bin 0 -> 3741 bytes .../external/fatfs/doc/res/layers3.png | Bin 0 -> 2379 bytes .../external/fatfs/doc/res/mkfatimg.zip | Bin 0 -> 686662 bytes .../external/fatfs/doc/res/mkfs.xls | Bin 0 -> 3238912 bytes .../external/fatfs/doc/res/modules.png | Bin 0 -> 17469 bytes .../external/fatfs/doc/res/rwtest1.png | Bin 0 -> 69114 bytes .../external/fatfs/doc/res/rwtest2.png | Bin 0 -> 8153 bytes .../external/fatfs/doc/res/rwtest3.png | Bin 0 -> 3011 bytes .../external/fatfs/doc/updates.txt | 189 ++++++++++++ 130 files changed, 10080 insertions(+) create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/00index_e.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/00index_j.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/css_e.css create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/css_j.css create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/appnote.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/chdir.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/chdrive.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/chmod.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/close.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/closedir.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/config.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/dinit.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/dioctl.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/dread.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/dstat.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/dwrite.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/eof.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/error.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/expand.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/fattime.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/fdisk.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/filename.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/findfirst.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/findnext.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/forward.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/getcwd.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/getfree.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/getlabel.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/gets.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/lseek.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/mkdir.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/mkfs.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/mount.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/open.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/opendir.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/printf.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/putc.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/puts.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/rc.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/read.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/readdir.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/rename.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/sdir.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/setlabel.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/sfatfs.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/sfile.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/sfileinfo.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/size.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/stat.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/sync.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/tell.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/truncate.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/unlink.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/utime.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/write.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/appnote.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/chdir.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/chdrive.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/chmod.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/close.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/closedir.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/config.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/dinit.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/dioctl.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/dread.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/dstat.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/dwrite.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/eof.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/error.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/expand.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/fattime.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/fdisk.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/filename.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/findfirst.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/findnext.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/forward.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/getcwd.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/getfree.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/getlabel.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/gets.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/lseek.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/mkdir.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/mkfs.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/mount.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/open.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/opendir.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/printf.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/putc.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/puts.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/rc.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/read.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/readdir.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/rename.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/sdir.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/setlabel.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/sfatfs.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/sfile.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/sfileinfo.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/size.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/stat.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/sync.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/tell.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/truncate.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/unlink.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/utime.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/write.html create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/app1.c create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/app2.c create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/app3.c create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/app4.c create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f1.png create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f2.png create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f3.png create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f4.png create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f5.png create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f6.png create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f7.png create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/fd.mp4 create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/funcs.png create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/layers.png create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/layers1.png create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/layers2.png create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/layers3.png create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/mkfatimg.zip create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/mkfs.xls create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/modules.png create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/rwtest1.png create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/rwtest2.png create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/rwtest3.png create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/updates.txt (limited to 'thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc') diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/00index_e.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/00index_e.html new file mode 100644 index 0000000..d70f5e2 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/00index_e.html @@ -0,0 +1,141 @@ + + + + + + + + + + + + +FatFs - Generic FAT File System Module + + + +

FatFs - Generic FAT File System Module

+
+ +
+layer +

FatFs is a generic FAT/exFAT file system module for small embedded systems. The FatFs module is written in compliance with ANSI C (C89) and completely separated from the disk I/O layer. Therefore it is independent of the platform. It can be incorporated into small microcontrollers with limited resource, such as 8051, PIC, AVR, ARM, Z80, 78K and etc. Also Petit FatFs module for tiny microcontrollers is available here.

+ +

Features

+ +
+ + +
+

Application Interface

+layer + +
+ + +
+

Device Control Interface

+layer +

Since the FatFs module is a file system layer, it is completely separated from the physical devices, such as memory card, harddisk and any type of storage device. FatFs accesses the storage devices via a simple interface shown below. The low level device control module is not a part of FatFs module. It is provided by implementer. Also sample implementations for some platforms are available in the downloads.

+ +
+ + +
+

Resources

+

The FatFs module is a free software opened for education, research and development. You can use, modify and/or redistribute it for personal projects or commercial products without any restriction under your responsibility. For further information, refer to the application note.

+
+ + +
+

FatFs home page

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/00index_j.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/00index_j.html new file mode 100644 index 0000000..53fdbb6 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/00index_j.html @@ -0,0 +1,141 @@ + + + + + + + + + + + + +FatFs 汎用FATファイルシステム モジュール + + + +

FatFs 汎用FATファイルシステム モジュール

+
+ +
+layer +

FatFsは小規模な組み込みシステム向けの汎用FAT/exFATファイルシステム モジュールです。ANSI C(C89)準拠でハードウェア アーキテクチャには依存しないので、必要なワーク エリアが確保できれば、8051, PIC, AVR, SH, Z80, 68k, H8, ARMなど安価なマイコンでも使用可能です。このほか、FatFsを極小マイコン向けにシュリンクしたぷちFatFsもあります。

+

FatFsモジュールの特徴

+ +
+ + +
+

上位レイヤ インターフェース

+layer + +
+ + +
+

下位レイヤ インターフェース

+layer +

FatFsモジュールは、単なるファイルシステム レイヤなので、その下位のストレージ デバイス制御レイヤはそれに含まれません。それぞれのプラットフォームやストレージ デバイスに対応した制御レイヤは、インプリメンタによって提供される必要があります。FatFsモジュールは、下位レイヤに対し標準的には次のインターフェースを要求します。一部の拡張機能、たとえばOS関連機能を有効にしたときは、加えてプロセス/メモリ操作関数なども必要になります。サンプル プロジェクトに下位レイヤの実装例を示します。

+ +
+ + +
+

資料

+

FatFsモジュールはフリー ソフトウェアとして教育・研究・開発用に公開しています。どのような利用目的(個人利用から商用まで)でも使用・改変・配布について一切の制限はありませんが、全て利用者の責任の下での利用とします。詳しくはアプリケーション ノートを参照してください。

+ +
+ + +
+

FatFsホームページ

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/css_e.css b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/css_e.css new file mode 100644 index 0000000..17fd1b4 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/css_e.css @@ -0,0 +1,67 @@ +* {margin: 0; padding: 0; border-width: 0;} +body {margin: 8px; background-color: #e0ffff; font-color: black; font-family: serif; line-height: 133%; max-width: 1024px;} +a:link {color: blue;} +a:visited {color: darkmagenta;} +a:hover {background-color: #a0ffff;} +a:active {color: darkmagenta; overflow: hidden; outline:none; position: relative; top: 1px; left: 1px;} +abbr {border-width: 1px;} + +p {margin: 0 0 0.3em 1em;} +i {margin: 0 0.3em 0 0;} +b {margin: 0 0.1em;} +em {font-style: normal; font-weight: bold; margin: 0 0.1em;} +strong {} +pre {border: 1px dashed gray; margin: 0.5em 1em; padding: 0.5em; line-height: 1.2em; font-size: 85%; font-family: "Consolas", "Courier New", monospace; background-color: white;} +pre span.c {color: green;} +pre span.k {color: blue;} +pre span.arg {font-style: italic;} +tt {margin: 0 0.2em; font-size: 0.85em; font-family: "Consolas", "Courier New", monospace; } +tt.arg {font-style: italic;} +ol {margin: 0.5em 2.5em;} +ul {margin: 0.5em 2em;} +ul ul {margin: 0 2em 0.5em 1em;} +dl {margin: 0.5em 1em;} +dd {margin: 0 2em;} +dt {font-size: 0.85em; font-family: "Consolas", "Courier New", monospace;} +dl.par dt {margin: 0.5em 0 0 0 ; font-style: italic; } +dl.ret dt {margin: 0.5em 0 0 0 ; font-size: 0.85em; font-family: "Consolas", "Courier New", monospace;} +hr {border-width: 1px; margin: 1em;} +div.abst {font-family: sans-serif;} +div.para {clear: both; font-family: serif;} +div.ret a {font-size: 0.85em; font-family: "Consolas", "Courier New", monospace; } +.equ {text-indent: 0; margin: 1em 2em 1em;} +.indent {margin-left: 2em;} +.rset {float: right; margin: 0.3em 0 0.5em 0.5em;} +.lset {float: left; margin: 0.3em 0.5em 0.5em 0.5em;} +ul.flat li {list-style-type: none; margin: 0;} +a.imglnk img {border: 1px solid;} +.iequ {white-space: nowrap; font-weight: bold;} +.clr {clear: both;} +.it {font-style: italic;} +.mfd {font-size: 0.7em; padding: 0 1px; border: 1px solid; white-space : nowrap} +.ral {text-align: right; } +.lal {text-align: left; } +.cal {text-align: center; } + +h1 {line-height: 1em; font-size: 2em; font-family: sans-serif; padding: 0.3em 0 0.3em;} +h2 {font-size: 2em; font-family: sans-serif; background-color: #d8d8FF; padding: 0.5em 0.5em; margin: 0 0 0.5em;} +h3 {font-size: 1.5em; font-family: sans-serif; margin: 1.5em 0 0.5em;} +div.doc h3 {border-color: #b0d8d8; border-style: solid; border-width: 0px 0px 4px 12px; padding: 4px; margin-top: 3em;} +h4 {font-size: 1.2em; font-family: sans-serif; margin: 2em 0 0.2em;} +h5 {font-size: 1em; font-family: sans-serif; margin: 1em 0 0em;} +p.hdd {float: right; text-align: right; margin-top: 0.5em;} +hr.hds {clear: both; margin-bottom: 1em;} +kbd {letter-spacing: 0;} +small {font-size: 80%;} +.indent {margin-left: 2em;} + +/* Tables */ +table {margin: 0.5em 1em; border-collapse: collapse; border: 2px solid black; } +th {background-color: white; border-style: solid; border-width: 1px 1px 2px; border-color: black; padding: 0 3px; vertical-align: top; white-space: nowrap;} +td {background-color: white; border: 1px solid black; padding: 0 3px; vertical-align: top; line-height: 1.3em;} +table.lst td:first-child {font-size: 0.85em; font-family: "Consolas", "Courier New", monospace;} +table.lst2 td {font-size: 0.85em; font-family: "Consolas", "Courier New", monospace;} +table caption {font-family: sans-serif; font-weight: bold;} +tr.lst3 td { border-width: 2px 1px 1px; } + +p.foot {clear: both; text-indent: 0; margin: 1em 0.5em 1em;} diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/css_j.css b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/css_j.css new file mode 100644 index 0000000..aeff3c0 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/css_j.css @@ -0,0 +1,70 @@ +@charset "Shift_JIS"; +/* Common style sheet for Tech Notes */ + +* {margin: 0; padding: 0; border-width: 0;} +body {margin: 8px; background-color: #e0ffff; font-color: black; font-family:"lr o", serif; line-height: 150%; letter-spacing: 1px; max-width: 1024px;} +a:link {color: blue;} +a:visited {color: darkmagenta;} +a:hover {background-color: #a0ffff;} +a:active {color: darkmagenta; overflow: hidden; outline:none; position: relative; top: 1px; left: 1px;} +abbr {border-width: 1px;} + +p {text-indent: 0.8em; margin: 0 0 0.3em 0.5em;} +i {margin: 0 0.3em 0 0;} +b {margin: 0 0.1em;} +em {font-style: normal; font-weight: bold; margin: 0 0.1em;} +strong {} +pre {border: 1px dashed gray; margin: 0.5em 1em; padding: 0.5em; line-height: 1.2em; letter-spacing: 0; font-size: 0.85em; font-family: "Consolas", "Courier New", "lr SVbN", monospace; background-color: white;} +pre span.c {color: green;} +pre span.k {color: blue;} +pre span.arg {font-style: italic;} +tt {margin: 0 0.2em; letter-spacing: 0; font-size: 0.85em; font-family: "Consolas", "Courier New", "lr SVbN", monospace;} +tt.arg {font-style: italic;} +ol {margin: 0.5em 2.5em;} +ul {margin: 0.5em 2em;} +ul ul {margin: 0 2em 0.5em 1em;} +dl {margin: 0.5em 1em;} +dd {margin: 0em 2em;} +dt {font-size: 0.85em; font-family: "Consolas", "Courier New", "lr SVbN", monospace;} +dl.par dt {margin: 0.5em 0 0 0 ; font-style: italic; letter-spacing: 0;} +dl.ret dt {margin: 0.5em 0 0 0 ; font-size: 0.85em; font-family: "Consolas", "Courier New", "lr SVbN", monospace; letter-spacing: 0; } +hr {border-width: 1px; margin: 1em;} +div.abst {font-family: "lr oSVbN",sans-serif;} +div.para {clear: both; font-family: "lr o",serif;} +div.ret a {font-size: 0.85em; font-family: "Consolas", "Courier New", monospace; } +.equ {text-indent: 0; margin: 1em 2em 1em;} +.indent {margin-left: 2em;} +.rset {float: right; margin: 0.3em 0 0.5em 0.5em;} +.lset {float: left; margin: 0.3em 0.5em 0.5em 0.5em;} +ul.flat li {list-style-type: none; margin: 0;} +a.imglnk img {border: 1px solid;} +.iequ {white-space: nowrap; font-weight: bold;} +.clr {clear: both;} +.it {font-style: italic;} +.mfd {font-size: 0.7em; padding: 0 1px; border: 1px solid; white-space : nowrap} +.ral {text-align: right; } +.lal {text-align: left; } +.cal {text-align: center; } + +h1 {line-height: 1em; font-size: 2em; font-family: sans-serif; padding: 0.3em 0 0.3em;} +h2 {font-size: 2em; font-family: "lr oSVbN",sans-serif; background-color: #d8d8FF; padding: 0.5em 0.5em; margin: 0 0 0.5em;} +h3 {font-size: 1.5em; font-family: "lr oSVbN",sans-serif; margin: 1.5em 0 0.5em;} +div.doc h3 {border-color: #b0d8d8; border-style: solid; border-width: 0px 0px 4px 12px; padding: 4px; margin-top: 3em;} +h4 {font-size: 1.2em; font-family: "lr oSVbN",sans-serif; margin: 2em 0 0.2em;} +h5 {font-size: 1em; font-family: "lr oSVbN",sans-serif; margin: 1em 0 0em;} +p.hdd {float: right; text-align: right; margin-top: 0.5em;} +hr.hds {clear: both; margin-bottom: 1em;} +kbd {letter-spacing: 0;} +small {font-size: 80%;} +.indent {margin-left: 2em;} + +/* Tables */ +table {margin: 0.5em 1em; border-collapse: collapse; border: 2px solid black; letter-spacing: 0;} +th {background-color: white; border-style: solid; border-width: 1px 1px 2px; border-color: black; padding: 0 3px; vertical-align: top;} +td {background-color: white; border: 1px solid black; padding: 0 3px; vertical-align: top; line-height: 1.3em;} +table.lst td:first-child {font-size: 0.85em; font-family: "Consolas", "Courier New", monospace; white-space: nowrap;} +table.lst2 td {font-size: 0.85em; font-family: "Consolas", "Courier New", monospace; white-space: nowrap;} +table caption {font-family: sans-serif; font-weight: bold;} +tr.lst3 td {border-width: 2px 1px 1px; } + +p.foot {clear: both; text-indent: 0; margin: 1em 0.5em 1em;} diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/appnote.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/appnote.html new file mode 100644 index 0000000..906f2a1 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/appnote.html @@ -0,0 +1,282 @@ + + + + + + + + +FatFs Module Application Note + + + +

FatFs Module Application Note

+
    +
  1. How to Port
  2. +
  3. Limits
  4. +
  5. Memory Usage
  6. +
  7. Reducing Module Size
  8. +
  9. Long File Name
  10. +
  11. Unicode API
  12. +
  13. exFAT File System
  14. +
  15. Re-entrancy
  16. +
  17. Duplicated File Access
  18. +
  19. Performance Effective File Access
  20. +
  21. Considerations on Flash Memory Media
  22. +
  23. Critical Section
  24. +
  25. Extended Use of FatFs API
  26. +
  27. About FatFs License
  28. +
+ +
+

How to Port

+ +

Basic considerations

+

The FatFs module is assuming following conditions on portability.

+ + +

System organizations

+

The dependency diagram shown below is a typical but not specific configuration of the embedded system with FatFs module.

+

dependency diagram

+

(a) If a working disk module with FatFs disk interface is provided, nothing else will be needed. (b) To attach existing disk drivers with different interface, glue functions are needed to translate the interfaces between FatFs and the drivers.

+

functional diagram

+ +

The functions required

+

You need to provide only low level disk I/O functions required by FatFs module and nothing else. If a working disk module for the target system is already existing, you need to write only glue functions to attach it to the FatFs module. If not, you need to port any other disk module or write it from scratch. Most of defined functions are not that always required. For example, disk write function is not required at read-only configuration. Following table shows which function is required depends on the configuration options.

+ + + + + + + + + + +
FunctionRequired whenNote
disk_status
disk_initialize
disk_read
AlwaysDisk I/O functions.
Samples available in ffsample.zip.
There are many implementations on the web.
disk_write
get_fattime
disk_ioctl (CTRL_SYNC)
_FS_READONLY == 0
disk_ioctl (GET_SECTOR_COUNT)
disk_ioctl (GET_BLOCK_SIZE)
_USE_MKFS == 1
disk_ioctl (GET_SECTOR_SIZE)_MAX_SS != _MIN_SS
disk_ioctl (CTRL_TRIM)_USE_TRIM == 1
ff_convert
ff_wtoupper
_USE_LFN != 0Unicode support functions.
Just add option/unicode.c to the project.
ff_cre_syncobj
ff_del_syncobj
ff_req_grant
ff_rel_grant
_FS_REENTRANT == 1O/S dependent functions.
Samples available in option/syscall.c.
ff_mem_alloc
ff_mem_free
_USE_LFN == 3
+
+ +
+

Limits

+ +
+ +
+

Memory Usage

+

The memory usage varies depends on the configuration options.

+ + + + + + + + + + + +
ARM7
32bit
ARM7
Thumb
CM3
Thumb-2
AVRH8/300HPIC24RL78V850ESSH-2ARX600IA-32
CompilerGCCGCCGCCGCCCH38C30CC78K0RCA850SHCRXCMSC
text (Full, R/W)10.4k6.8k6.3k12.4k 9.8k11.1k12.8k8.6k8.9k6.4k8.5k
text (Min, R/W) 6.8k4.6k4.3k 8.2k 6.7k 7.6k 9.1k6.0k5.9k4.5k5.9k
text (Full, R/O) 4.8k3.1k2.8k 5.6k 4.6k 5.3k 6.3k4.0k3.9k3.0k3.9k
text (Min, R/O) 3.6k2.4k2.3k 4.4k 3.5k 4.0k 4.9k3.3k3.0k2.4k3.1k
bssV*4 + 2V*4 + 2V*4 + 2V*2 + 2V*4 + 2V*2 + 2V*2 + 2V*4 + 2V*4 + 2V*4 + 2V*4 + 2
Work area
(_FS_TINY == 0)
V*564
+ F*552
V*564
+ F*552
V*564
+ F*552
V*560
+ F*546
V*560
+ F*546
V*560
+ F*546
V*560
+ F*546
V*564
+ F*552
V*564
+ F*552
V*564
+ F*552
V*564
+ F*552
Work area
(_FS_TINY == 1)
V*564
+ F*40
V*564
+ F*40
V*564
+ F*40
V*560
+ F*34
V*560
+ F*34
V*560
+ F*34
V*560
+ F*34
V*564
+ F*40
V*564
+ F*40
V*564
+ F*40
V*564
+ F*40
+

These are the memory usage on some target systems with following condition. The memory sizes are in unit of byte, V denotes option _VOLUMES and F denotes number of open files. All samples here are optimezed in code size.

+
+FatFs R0.12b options:
+_FS_READONLY   0 (R/W) or 1 (R/O)
+_FS_MINIMIZE   0 (Full, with all basic functions) or 3 (Min, with fully minimized)
+_FS_TINY       0 (Default) or 1 (Tiny file object)
+And other options are left unchanged from original setting.
+
+
+ +
+

Reducing Modle Size

+

Follwing table shows which API function is removed by configuration options for the module size reduction. To use any API function, the row of the function must be clear.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Function_FS_
MINIMIZE
_FS_
READONLY
_USE_
STRFUNC
_FS_
RPATH
_USE_
FIND
_USE_
CHMOD
_USE_
EXPAND
_USE_
LABEL
_USE_
MKFS
_USE_
FORWARD
_MULTI_
PARTITION
0123010101201010101010101
f_mount
f_open
f_close
f_read
f_write x
f_sync x
f_lseek x
f_opendir xx
f_closedir xx
f_readdir xx
f_findfirst xx x
f_findnext xx x
f_stat xxx
f_getfree xxx x
f_truncate xxx x
f_unlink xxx x
f_mkdir xxx x
f_rename xxx x
f_chdir x
f_chdrive x
f_getcwd xx
f_chmod x x
f_utime x x
f_getlabel x
f_setlabel x x
f_expand x x
f_forward x
f_mkfs x x
f_fdisk x x x
f_putc xx
f_puts xx
f_printf xx
f_gets x
+
+ +
+

Long File Name

+

FatFs module supports long file name (LFN). The two different file names, short file name (SFN) and LFN, of a file is transparent on the API except for f_readdir function. The support for LFN is disabled by default. To enable the LFN, set _USE_LFN to 1, 2 or 3, and add option/unicode.c to the project. The LFN requiers a certain working buffer in addition. The buffer size can be configured by _MAX_LFN according to the available memory. The length of an LFN will be up to 255 characters, so that the _MAX_LFN should be set to 255 for all file names. If the size of working buffer is insufficient for the input file name, the file function fails with FR_INVALID_NAME. When use any re-entry to the API with LFN is enabled, _USE_LFN must be set to 2 or 3. In this case, the file function allocates the working buffer on the stack or heap. The working buffer occupies (_MAX_LFN + 1) * 2 bytes and additional 608 bytes when exFAT enabled.

+ + + + + + + + +
With LFN at CM3+gcc
_CODE_PAGECode size
SBCS+2.8K
932(Japanese)+62.6k
936(Simplified Chinese)+177k
949(Korean)+139k
950(Traditional Chinese)+111k
+

When the LFN is enabled, the module size will be increased depends on the configured code page. Right table shows how much code size increased when LFN is enabled with some code pages. Especially, in the CJK region, tens of thousands of characters are being used. Unfortunately, it requires a huge OEM-Unicode bidirectional conversion table and the module size will be drastically increased as shown in the table. As the result, the FatFs with LFN enebled with those code pages will not able to be ported on the most 8-bit MCU systems.

+

Note that the support for LFN on the FAT volume is a patent of Microsoft Corporation. This is not the case on FAT32 but most FAT32 drivers come with the support for LFN. FatFs can switch the LFN on/off by configuration option. When enable LFN on the commercial products, you will need to be licensed by Microsoft depends on the final destination of the products.

+
+ +
+

Unicode API

+

By default, FatFs uses ANSI/OEM code set on the API even at LFN configuration. FatFs can also switch the character encoding on the API to Unicode by configuration option _LFN_UNICODE. This means that FatFs supports the full featured LFN specification. The data type TCHAR specifies strings on the API is an alias of char(ANSI/OEM) or WCHAR(UTF-16). For more information, refer to the description in the file name.

+
+ +
+

exFAT File System

+

The exFAT (Microsoft's Extended File Allocation Table) file system is a replacement of the FAT file system which has been widely used in the embedded systems and consumer devices. It is adopted by SDA (SD Association) as a recommended file system for high capacity SD cards (>32GB) and they are being shipped with this format, so that the exFAT will soon become one of the standard file systems for removable media.

+

The exFAT file system allows the file size larger than 4 GiB limit what FAT file system allows upto and some file system overhead, especially file allocation delay, are reduced as well. This feature improves the write throughput to the file. However a problem on the current implementation of FatFs is that write throughput at writing to the growing edge of the fragmented file gets less than the throughput on the FAT volume. Pre-allocating a contiguous block with f_expand function may be a workaround of this problem.

+

Note that the exFAT is a patent of Microsoft Corporation. The exFAT function of FatFs is an implementation based on US. Pat. App. Pub. No. 2009/0164440 A1. FatFs module can swich the exFAT on/off by configuration option. When enable the exFAT on the commercial products, you will need to be licensed by Microsoft depends on the final destination of the products.

+

Remark: Enabling exFAT discards C89 compatibility because of need for 64-bit integer type.

+ +
+

Re-entrancy

+

The file operations to the different volume is always re-entrant regardless of configurations except when LFN enabled with static working buffer. It can work simultaneously without any mutual exclusion.

+

The file operations to the same volume is not re-entrant but it can also be configured thread-safe by option _FS_REENTRANT. It enables to control exclusive use of each file system object. In this case, also the OS dependent synchronization object control functions, ff_cre_syncobj/ff_del_syncobj/ff_req_grant/ff_rel_grant, needed to be added to the project. There are some examples in the option/syscall.c.

+

When a file function is called while the volume is being accessed by other task, the file function to the volume will be suspended until that task leaves the file function. If the wait time exceeded a period defined by _TIMEOUT, the file function will abort with FR_TIMEOUT. The timeout function might not be supported on the some RTOSs.

+

There is an exception on the re-entrancy for f_mount/f_mkfs/f_fdisk function. These volume management functions are not re-entrant to the same volume and corresponding physical drive. When use these functions, other tasks need to avoid to access the volume.

+

Note that this section describes on the re-entrancy of the FatFs module itself. The _FS_REENTRANT controls only exclusive use of each file system object and it does not that prevent to re-enter the low level disk functions. For example, only disk_status function can be re-entered at single volume system and any disk function can be re-entered at multiple volume system. Thus the low level disk I/O layer must be always thread-safe when any FatFs API is re-entered by two or more tasks.

+
+ +
+

Duplicated File Access

+

FatFs module does not support the read/write collision control of duplicated open to a file. The duplicated open is permitted only when each of open method to a file is read mode. The duplicated open with one or more write mode to a file is always prohibited, and also open file must not be renamed or deleted. A violation of these rules can cause data colluption.

+

The file lock control can be enabled by _FS_LOCK option. The value of option defines the number of open objects to manage simultaneously. In this case, if any open, rename or remove that violating the file shareing rule that described above is attempted, the file function will rejected with FR_LOCKED. If number of open objects, files and sub-directories, is equal to _FS_LOCK, an extra f_open/f_opendir function will fail with FR_TOO_MANY_OPEN_FILES.

+
+ +
+

Performance Effective File Access

+

For good read/write throughput on the small embedded systems with limited size of memory, application programmer should consider what process is done in the FatFs module. The file data on the volume is transferred in following sequence by f_read function.

+

Figure 1. Sector misaligned read (short)
+ +

+

Figure 2. Sector misaligned read (long)
+ +

+

Figure 3. Fully sector aligned read
+ +

+

The file I/O buffer is a sector buffer to read/write a part of data on the sector. The sector buffer is either file private sector buffer on each file object or shared sector buffer in the file system object. The buffer configuration option _FS_TINY determins which sector buffer is used for the file data transfer. When tiny buffer configuration (1) is selected, data memory consumption is reduced _MAX_SS bytes each file object. In this case, FatFs module uses only a sector buffer in the file system object for file data transfer and FAT/directory access. The disadvantage of the tiny buffer configuration is: the FAT data cached in the sector buffer will be lost by file data transfer and it must be reloaded at every cluster boundary. However it will be suitable for most application from view point of the decent performance and low memory comsumption.

+

Figure 1 shows that a partial sector, sector misaligned part of the file, is transferred via the file I/O buffer. At long data transfer shown in Figure 2, middle of transfer data that covers one or more sector is transferred to the application buffer directly. Figure 3 shows that the case of entier transfer data is aligned to the sector boundary. In this case, file I/O buffer is not used. On the direct transfer, the maximum extent of sectors are read with disk_read function at a time but the multiple sector transfer is divided at cluster boundary even if it is contiguous.

+

Therefore taking effort to sector aligned read/write accesss eliminates buffered data transfer and the read/write performance will be improved. Besides the effect, cached FAT data will not be flushed by file data transfer at the tiny configuration, so that it can achieve same performance as non-tiny configuration with small memory footprint.

+
+ +
+

Considerations on Flash Memory Media

+

To maximize the write performance of flash memory media, such as SDC, CFC and U Disk, it must be controlled in consideration of its characteristitcs.

+

Using Mutiple-Sector Write

+
+Figure 6. Comparison between Multiple/Single Sector Write
+fig.6 +
+

The write throughput of the flash memory media becomes the worst at single sector write transaction. The write throughput increases as the number of sectors per a write transaction as shown in Figure 6. This effect more appers at faster interface speed and the performance ratio often becomes grater than ten. This graph is clearly explaining how fast is multiple block write (W:16K, 32 sectors) than single block write (W:100, 1 sector), and also larger card tends to be slow at single block write. Number of write transactions also affects life time of the flash memory media. When compared at same amount of write data, the single sector write in Figure 6 above wears flash memory media 16 times more than multiple sector write in Figure 6 below. Single sector write is pretty pain for the flash memory media.

+

Therefore the application program should write the data in large block as possible. The ideal write chunk size and alighment is size of sector, and size of cluster is the best. Of course all layers between the application and the storage device must have consideration on multiple sector write, however most of open-source memory card drivers lack it. Do not split a multiple sector write request into single sector write transactions or the write throughput gets poor. Note that FatFs module and its sample disk drivers supprt multiple sector read/write operation.

+

Forcing Memory Erase

+

When remove a file with f_unlink function, the data clusters occupied by the file are marked 'free' on the FAT. But the data sectors containing the file data are not that applied any process, so that the file data left occupies a part of the flash memory array as 'live block'. If the file data can be erased on removing the file, those data blocks will be turned into the free block pool. This may skip internal block erase operation to the data block on next write operation. As the result the write performance might be improved. FatFs can manage this function by setting _USE_TRIM to 1. Note that this is an expectation of internal process of the storage device and not that always effective. Most applications will not need this function. Also f_unlink function can take a time when remove a large file.

+
+ +
+

Critical Section

+

If a write operation to the FAT volume is interrupted due to an accidental failure, such as sudden blackout, incorrect media removal and unrecoverable disk error, the FAT structure on the volume can be broken. Following images shows the critical section of the FatFs module.

+
+Figure 4. Long critical section
+fig.4 +
+
+Figure 5. Minimized critical section
+fig.5 +
+
+

An interruption in the red section can cause a cross link; as a result, the object being changed can be lost. If an interruption in the yellow section is occured, there is one or more possibility listed below.

+ +

Each case does not affect the files that not opened in write mode. To minimize risk of data loss, the critical section can be minimized by minimizing the time that file is opened in write mode or using f_sync function as shown in Figure 5.

+
+ +
+

Extended Use of FatFs API

+

These are examples of extended use of FatFs APIs. New item will be added whenever a useful code is found.

+
    +
  1. Open or create a file for append (for only R0.12 and earlier)
  2. +
  3. Empty a directory
  4. +
  5. Allocate contiguous area to the file (for only R0.11a and earlier)
  6. +
  7. Compatibility checker for low level disk I/O module
  8. +
  9. FAT image creator
  10. +
+
+ +
+

About FatFs License

+

FatFs has being developped as a personal project of the author, ChaN. It is free from the code anyone else wrote at current release. Following code block shows a copy of the FatFs license document that included in the source files.

+
+/*----------------------------------------------------------------------------/
+/  FatFs - Generic FAT file system module  R0.12a                             /
+/-----------------------------------------------------------------------------/
+/
+/ Copyright (C) 2016, ChaN, all right reserved.
+/
+/ FatFs module is an open source software. Redistribution and use of FatFs in
+/ source and binary forms, with or without modification, are permitted provided
+/ that the following condition is met:
+
+/ 1. Redistributions of source code must retain the above copyright notice,
+/    this condition and the following disclaimer.
+/
+/ This software is provided by the copyright holder and contributors "AS IS"
+/ and any warranties related to this software are DISCLAIMED.
+/ The copyright owner or contributors be NOT LIABLE for any damages caused
+/ by use of this software.
+/----------------------------------------------------------------------------*/
+
+

Therefore FatFs license is one of the BSD-style licenses but there is a significant feature. FatFs is mainly intended for embedded systems. In order to extend the usability for commercial products, the redistributions of FatFs in binary form, such as embedded code, binary library and any forms without source code, does not need to include about FatFs in the documentations. This is equivalent to the 1-clause BSD license. Of course FatFs is compatible with the most open source software licenses including GNU GPL. When you redistribute the FatFs source code with any changes or create a fork, the license can also be changed to GNU GPL, BSD-style license or any open source software licenses that not conflict with FatFs license.

+
+ +

Return Home

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/chdir.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/chdir.html new file mode 100644 index 0000000..e80b914 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/chdir.html @@ -0,0 +1,81 @@ + + + + + + + + +FatFs - f_chdir + + + + +
+

f_chdir

+

The f_chdir function changes the current directory of a drive.

+
+FRESULT f_chdir (
+  const TCHAR* path /* [IN] Path name */
+);
+
+
+ +
+

Parameters

+
+
path
+
Pointer to the null-terminated string that specifies the directory to go.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_NO_PATH, +FR_INVALID_NAME, +FR_INVALID_DRIVE, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT, +FR_NOT_ENOUGH_CORE +

+
+ + +
+

Description

+

The f_chdir function changes the current directory of the logical drive. The current directory of a drive is set to the root directory when the drive is mounted. Note that the current directory is retained in the each file system object, so that it also affects other tasks that use the volume.

+
+ + +
+

QuickInfo

+

Available when _FS_RPATH >= 1.

+
+ + +
+

Example

+
+    /* Change current direcoty of the current drive ('dir1' under root directory) */
+    f_chdir("/dir1");
+
+    /* Change current direcoty of drive 2 (parent directory) */
+    f_chdir("2:..");
+
+
+ +
+

See Also

+

f_chdrive, f_getcwd

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/chdrive.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/chdrive.html new file mode 100644 index 0000000..e41d442 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/chdrive.html @@ -0,0 +1,60 @@ + + + + + + + + +FatFs - f_chdrive + + + + +
+

f_chdrive

+

The f_chdrive function changes the current drive.

+
+FRESULT f_chdrive (
+  const TCHAR* path  /* [IN] Logical drive number */
+);
+
+
+ +
+

Parameters

+
+
path
+
Specifies the logical drive number to be set as the current drive.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_INVALID_DRIVE +

+
+ + +
+

Description

+

The f_chdrive function changes the current drive. The initial value of the current drive number is 0. Note that the current drive is retained in a static variable so that it also affects other tasks that using the file functions.

+
+ +
+

QuickInfo

+

Available when _FS_RPATH >= 1 and _VOLUMES >= 2.

+
+ + +
+

See Also

+

f_chdir, f_getcwd

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/chmod.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/chmod.html new file mode 100644 index 0000000..f9869d5 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/chmod.html @@ -0,0 +1,89 @@ + + + + + + + + +FatFs - f_chmod + + + + +
+

f_chmod

+

The f_chmod function changes the attribute of a file or sub-directory.

+
+FRESULT f_chmod (
+  const TCHAR* path, /* [IN] Object name */
+  BYTE attr,         /* [IN] Attribute flags */
+  BYTE mask          /* [IN] Attribute masks */
+);
+
+
+ +
+

Parameters

+
+
path
+
Pointer to the null-terminated string that specifies an object to be changed
+
attr
+
Attribute flags to be set in one or more combination of the following flags. The specified flags are set and others are cleard.
+ + + + + + +
AttributeDescription
AM_RDORead only
AM_ARCArchive
AM_SYSSystem
AM_HIDHidden
+
+
mask
+
Attribute mask that specifies which attribute is changed. The specified attributes are set or cleard and others are left unchanged.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_NO_FILE, +FR_NO_PATH, +FR_INVALID_NAME, +FR_WRITE_PROTECTED, +FR_INVALID_DRIVE, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT, +FR_NOT_ENOUGH_CORE +

+
+ + +
+

Description

+

The f_chmod function changes the attribute of a file or sub-directory.

+
+ + +
+

QuickInfo

+

Available when _FS_READONLY == 0 and _USE_CHMOD == 1.

+
+ + +
+

Example

+
+    /* Set read-only flag, clear archive flag and others are left unchanged. */
+    f_chmod("file.txt", AM_RDO, AM_RDO | AM_ARC);
+
+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/close.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/close.html new file mode 100644 index 0000000..3c64a46 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/close.html @@ -0,0 +1,65 @@ + + + + + + + + +FatFs - f_close + + + + +
+

f_close

+

The f_close function closes an open file.

+
+FRESULT f_close (
+  FIL* fp     /* [IN] Pointer to the file object */
+);
+
+
+ +
+

Parameter

+
+
fp
+
Pointer to the open file object structure to be closed.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_INVALID_OBJECT, +FR_TIMEOUT +

+
+ + +
+

Description

+

The f_close function closes an open file object. If any data has been written to the file, the cached information of the file is written back to the volume. After the function succeeded, the file object is no longer valid and it can be discarded.

+

Note that if the file object is in read-only mode and _FS_LOCK is not enabled, the file object can also be discarded without this process. However this is not recommended for future compatibility.

+
+ + +
+

QuickInfo

+

Always available.

+
+ + +
+

See Also

+

f_open, f_read, f_write, f_sync, FIL, FATFS

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/closedir.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/closedir.html new file mode 100644 index 0000000..15b4017 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/closedir.html @@ -0,0 +1,64 @@ + + + + + + + + +FatFs - f_closedir + + + + +
+

f_closedir

+

The f_closedir function closes an open directory.

+
+FRESULT f_closedir (
+  DIR* dp     /* [IN] Pointer to the directory object */
+);
+
+
+ +
+

Parameter

+
+
dp
+
Pointer to the open directory object structure to be closed.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_INT_ERR, +FR_INVALID_OBJECT, +FR_TIMEOUT +

+
+ + +
+

Description

+

The f_closedir function closes an open directory object. After the function succeeded, the directory object is no longer valid and it can be discarded.

+

Note that the directory object can also be discarded without this process when option _FS_LOCK is not enabled. However this is not recommended for future compatibility.

+
+ + +
+

QuickInfo

+

Available when _FS_MINIMIZE <= 1.

+
+ + +
+

See Also

+

f_opendir, f_readdir, DIR

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/config.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/config.html new file mode 100644 index 0000000..d7fbe0b --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/config.html @@ -0,0 +1,204 @@ + + + + + + + + +FatFs - Configuration Options + + + +

Configuration Options

+

There are many options to configure the functions of FatFs for each project. The configuration options are defined in the ffconf.h.

+ +
+

Function Configurations

+ +

_FS_READONLY

+

Read/Write (0) or Read-only (1). Read-only configuration removes writing API functions, f_write, f_sync, f_unlink, f_mkdir, f_chmod, f_rename, f_truncate, f_getfree and optional writing functions as well.

+ +

_FS_MINIMIZE

+

This option defines minimization level to remove some basic API functions as follows:

+ + + + + + +
ValueDescription
0All basic API functions are available.
1f_stat, f_getfree, f_unlink, f_mkdir, f_chmod, f_utime, f_truncate and f_rename function are removed.
2f_opendir, f_readdir and f_closedir function are removed in addition to 1.
3f_lseek function is removed in addition to 2.
+ +

_USE_STRFUNC

+

This option switches string functions, f_gets, f_putc, f_puts and f_printf.

+ + + + + +
ValueDescription
0Disable string functions.
1Enable string functions without LF-CRLF conversion.
2Enable string functions with LF-CRLF conversion.
+ +

_USE_FIND

+

Disable (0) or Enable (1) filtered directory read functions, f_findfirst and f_findnext. Also _FS_MINIMIZE needs to be 0 or 1.

+ +

_USE_MKFS

+

Disable (0) or Enable (1) f_mkfs function.

+ +

_USE_FASTSEEK

+

Disable (0) or Enable (1) fast seek function to enable accelerated mode for f_lseek, f_read and f_write function. For more information, read here.

+ +

_USE_EXPAND

+

Disable (0) or Enable (1) , f_enpand function. Also _FS_READONLY needs to be 0.

+ +

_USE_CHMOD

+

Disable (0) or Enable (1) metadata control functions, f_chmod and f_utime. Also _FS_READONLY needs to be 0.

+ +

_USE_LABEL

+

Disable (0) or Enable (1) API functions for volume label, f_getlabel and f_setlabel.

+ +

_USE_FORWARD

+

Disable (0) or Enable (1) f_forward function.

+ +
+ + +
+

Namespace and Locale Configurations

+ +

_CODE_PAGE

+

This option specifies the OEM code page to be used on the target system. Incorrect setting of the code page can cause a file open failure. If any extended character is not used at all, there is no difference between any code pages.

+ + + + + + + + + + + + + + + + + + + + + + + + +
ValueDescription
1ASCII (valid at non-LFN cfg.)
437U.S.
720Arabic
737Greek
771KBL
775Baltic
850Latin 1
852Latin 2
855Cyrillic
857Turkish
860Portuguese
861Icelandic
862Hebrew
863Canadian French
864Arabic
865Nordic
866Russian
869Greek 2
932Japanese (DBCS)
936Simplified Chinese (DBCS)
949Korean (DBCS)
950Traditional Chinese (DBCS)
+ +

_USE_LFN

+

This option switches the support for long file name (LFN). When enable the LFN, Unicode support functions option/unicode.c need to be added to the project. The working buffer occupies (_MAX_LFN + 1) * 2 bytes and additional 608 bytes when exFAT enabled. When use stack for the working buffer, take care on stack overflow. When use heap memory for the working buffer, memory management functions, ff_memalloc and ff_memfree, need to be added to the project.

+ + + + + + +
ValueDescription
0Disable LFN. Only 8.3 format can be used.
1Enable LFN with static working buffer on the BSS. Always NOT thread-safe.
2Enable LFN with dynamic working buffer on the STACK.
3Enable LFN with dynamic working buffer on the HEAP.
+ +

_MAX_LFN

+

This option defines the size of LFN working buffer from 12 to 255 in unit of character. This option has no effect when LFN is disabled.

+ +

_LFN_UNICODE

+

ANSI/OEM (0) or Unicode (1). This option switches character encoding on the API. To use Unicode (UTF16) string for the path name, enable LFN and set this option to 1. This option also affects behavior of string I/O functions. When LFN is disabled, this option must be 0. For more information, read here.

+ +

_STRF_ENCODE

+

When Unicode API is selected by setting _LFN_UNICODE 1, this option defines the assumption of character encoding on the file to be read/written via string I/O functions, f_gets, f_putc, f_puts and f_printf. This option has no effect when _LFN_UNICODE = 0.

+ + + + + + +
ValueDescription
0ANSI/OEM
1UTF-16LE
2UTF-16BE
3UTF-8
+ +

_FS_RPATH

+

This option configures relative path function. For more information, read here.

+ + + + + +
ValueDescription
0Disable relative path function and remove related functions.
1Enable relative path function. f_chdir and f_chdrive function is available.
2f_getcwd function is available in addition to 1
+ +
+ + +
+

Volume/Drive Configurations

+ +

_VOLUMES

+

This option configures number of volumes (logical drives, from 1 to 10) to be used.

+ +

_STR_VOLUME_ID

+

Disable (0) or Enable (1). This option switches the support for string volume ID. When enabled, also pre-defined strings in _VOLUME_STRS can be used as drive identifier in the path name.

+ +

_VOLUME_STRS

+

This option defines the drive ID strings for each logical drives. Number of items must not be less than _VOLUMES. Valid characters for the drive ID string are: A-Z and 0-9.

+ +

_MULTI_PARTITION

+

Disable (0) or Enable (1). This option switches multi-partition function. By default (0), each logical drive number is bound to the same physical drive number and only an FAT volume in the physical drive is mounted. When enabled, each logical drive is bound to the partition on the physical drive listed in the user defined partition resolution table VolToPart[]. Also f_fdisk funciton will be available. For more information, read here.

+ +

_MIN_SS, _MAX_SS

+

This set of options defines the size of sector on low level disk I/O interface, disk_read and disk_write function. Valid values are 512, 1024, 2048 and 4096. _MIN_SS defines minimum sector size and _MAX_SS defines the maximum sector size. Always set both 512 for any type of memory card and harddisk. But a larger value may be required for on-board flash memory and some type of optical media. When _MAX_SS > _MIN_SS, FatFs is configured to variable sector size and GET_SECTOR_SIZE command must be implemented to the disk_ioctl function.

+ +

_USE_TRIM

+

Disable (0) or Enable (1). This option switches ATA-TRIM function. To enable Trim function, also CTRL_TRIM command should be implemented to the disk_ioctl function.

+ +

_FS_NOFSINFO

+

0 to 3. If you need to know correct free space on the FAT32 volume, set bit 0 of this option, and f_getfree function at first time after volume mount will force a full FAT scan. Bit 1 controls the use of last allocated cluster number.

+ + + + + + +
ValueDescription
bit0=0Use free cluster count in the FSINFO if available.
bit0=1Do not trust free cluster count in the FSINFO.
bit1=0Use last allocated cluster number in the FSINFO to find a free cluster if available.
bit1=1Do not trust last allocated cluster number in the FSINFO.
+ +
+ + +
+

System Configurations

+ +

_FS_TINY

+

Normal (0) or Tiny (1). At the tiny configuration, size of the file object FIL is reduced _MAX_SS bytes. Instead of private data buffer eliminated from the file object, common sector buffer in the file system object FATFS is used for the file data transfer.

+ +

_FS_EXFAT

+

This option switches support for the exFAT file system in addition to the FAT file system, Enabled(1) or Disabled(1). To enable this feature, also LFN must be enabled and configureing _LFN_UNICODE = 1 and _MAX_LFN = 255 is recommended for full-featured exFAT function. Note that enabling exFAT discards C89 compatibility because of need for 64-bit integer type.

+ +

_FS_NORTC

+

Use RTC (0) or Do not use RTC (1). This option controls timestamp function. If the system does not have an RTC function or valid timestamp is not needed, set _FS_NORTC to 1 to disable the timestamp function. Any object modified by FatFs will have a fixed timestamp defined by _NORTC_MON, _NORTC_MDAY and _NORTC_YEAR. To use the timestamp function, set _FS_NORTC = 0 and add get_fattime function to the project to get the current time form real-time clock. This option has no effect at read-only configuration.

+ +

_NORTC_MON, _NORTC_MDAY, _NORTC_YEAR

+

This set of options defines the time to be used at no RTC systems. This option has no effect at read-only configuration or _FS_NORTC = 0.

+ +

_FS_LOCK

+

This option switches file lock function to control duplicated file open and illegal operations to open objects. Note that the file lock function is independent of re-entrancy. This option must be 0 at read-only configuration.

+ + + + +
ValueDescription
0Disable file lock function. To avoid collapsing file by wrong file operation, application program needs to avoid illegal open, remove and rename to the open objects.
>0Enable file lock function. The value defines how many files/sub-directories can be opened simultaneously under the file lock control. Illigal operations to the open object will be rejected with FR_LOCKED.
+ +

_FS_REENTRANT

+

Disable (0) or Enable (1). This option switches the re-entrancy (thread safe) of the FatFs module itself. Note that file/directory access to the different volume is always re-entrant and it can work simultaneously regardless of this option but volume control functions. f_mount, f_mkfs and f_fdisk, are always not re-entrant. Only file/directory access to the same volume, in other words, exclusive use of each file system object, is under control of this function. To enable this feature, also user provided synchronization handlers, ff_req_grant, ff_rel_grant, ff_del_syncobj and ff_cre_syncobj, need to be added to the project. Sample code is available in option/syscall.c.

+ +

_FS_TIMEOUT

+

Number of time ticks to abort the file function with FR_TIMEOUT when wait time is too long. This option has no effect when _FS_REENTRANT = 0.

+ +

_SYNC_t

+

This option defines O/S dependent sync object type. e.g. HANDLE, ID, OS_EVENT*, SemaphoreHandle_t and etc. A header file for O/S definitions needs to be included somewhere in the scope of ff.c. This option has no effect when _FS_REENTRANT = 0.

+ +
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/dinit.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/dinit.html new file mode 100644 index 0000000..418d596 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/dinit.html @@ -0,0 +1,46 @@ + + + + + + + + +FatFs - disk_initialize + + + + +
+

disk_initialize

+

The disk_initialize function initializes the storage device.

+
+DSTATUS disk_initialize (
+  BYTE pdrv           /* [IN] Physical drive number */
+);
+
+
+ +
+

Parameter

+
+
pdrv
+
Physical drive number to identify the target device. Always zero at single drive system.
+
+
+ + +
+

Return Values

+

This function returns the current drive status flags as the result. For details of the drive status, refer to the disk_status function.

+
+ +
+

Description

+

This function initializes the storage device and put it ready to generic read/write. When the function succeeded, STA_NOINIT flag in the return value is cleared.

+

Remarks: This function needs to be under control of FatFs module. Application program MUST NOT call this function, or FAT structure on the volume can be broken. To re-initialize the file system, use f_mount function instead.

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/dioctl.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/dioctl.html new file mode 100644 index 0000000..35fd691 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/dioctl.html @@ -0,0 +1,100 @@ + + + + + + + + +FatFs - disk_ioctl + + + + +
+

disk_ioctl

+

The disk_ioctl function controls device specific features and miscellaneous functions other than generic read/write.

+
+DRESULT disk_ioctl (
+  BYTE pdrv,     /* [IN] Drive number */
+  BYTE cmd,      /* [IN] Control command code */
+  void* buff     /* [I/O] Parameter and data buffer */
+);
+
+
+ +
+

Parameters

+
+
pdrv
+
Physical drive number to identify the target device.
+
cmd
+
Command code.
+
buff
+
Pointer to the parameter depends on the command code. Do not care if no parameter to be passed.
+
+
+ + +
+

Return Value

+
+
RES_OK (0)
+
The function succeeded.
+
RES_ERROR
+
An error occured.
+
RES_PARERR
+
The command code or parameter is invalid.
+
RES_NOTRDY
+
The device has not been initialized.
+
+
+ + +
+

Description

+

The FatFs module requires only five device independent commands described below.

+ + + + + + + + +
Standard ioctl command used by FatFs
CommandDescription
CTRL_SYNCMake sure that the device has finished pending write process. If the disk I/O module has a write back cache, the dirty buffers must be written back to the media immediately. Nothing to do for this command if each write operation to the media is completed within the disk_write function.
GET_SECTOR_COUNTReturns number of available sectors on the drive into the DWORD variable pointed by buff. This command is used by only f_mkfs and f_fdisk function to determine the volume/partition size to be created. Required at _USE_MKFS == 1 or _MULTI_PARTITION == 1.
GET_SECTOR_SIZEReturns sector size of the media into the WORD variable pointed by buff. Valid return values of this command are 512, 1024, 2048 and 4096. This command is required only at variable sector size configuration, _MAX_SS > _MIN_SS. At fixed sector size configuration, _MAX_SS == _MIN_SS, this command is not used and the device must work at that sector size.
GET_BLOCK_SIZEReturns erase block size of the flash memory media in unit of sector into the DWORD variable pointed by buff. The allowable value is from 1 to 32768 in power of 2. Return 1 if the erase block size is unknown or non flash memory media. This command is used by only f_mkfs function and it attempts to align data area to the erase block boundary. Required at _USE_MKFS == 1.
CTRL_TRIMInforms the device the data on the block of sectors that specified by DWORD array {<start sector>, <end sector>} pointed by buff is no longer needed and it may be erased. This is an identical command to Trim of ATA device. Nothing to do for this command if this funcion is not supported or not a flash memory device. The FatFs does not check the result code and the file function is not affected even if the sector block was not erased well. This command is called on remove a cluster chain and in the f_mkfs function. Required at _USE_TRIM == 1.
+ +

FatFs never uses any device dependent command nor user defined command. Following table shows an example of non-standard commands usable for some applications.

+ + + + + + + + + + + + + + + + + + + + +
Example of optional ioctl command
CommandDescription
CTRL_FORMATCreate a physical format on the media. If buff is not null, it is pointer to the call-back function for progress notification.
CTRL_POWER_IDLEPut the device idle state. STA_NOINIT in status flag may not be set if the device goes active state by generic read/write function.
CTRL_POWER_OFFPut the device off state. Shut-down the power to the device and deinitialize the device interface if needed. STA_NOINIT in status flag must be set. The device goes active state by disk_initialize function.
CTRL_LOCKLock media eject mechanism.
CTRL_UNLOCKUnlock media eject mechanism.
CTRL_EJECTEject media cartridge. STA_NOINIT and STA_NODISK in status flag are set after the function succeeded.
MMC_GET_TYPEGet card type. The type flags, bit0:MMCv3, bit1:SDv1, bit2:SDv2+ and bit3:LBA, is stored to a BYTE variable pointed by buff. (MMC/SDC specific command)
MMC_GET_CSDGet CSD register into a 16-byte buffer pointed by buff. (MMC/SDC specific command)
MMC_GET_CIDGet CID register into a 16-byte buffer pointed by buff. (MMC/SDC specific command)
MMC_GET_OCRGet OCR register into a 4-byte buffer pointed by buff. (MMC/SDC specific command)
MMC_GET_SDSTATGet SDSTATUS register into a 64-byte buffer pointed by buff. (SDC specific command)
ATA_GET_REVGet the revision string into a 16-byte buffer pointed by buff. (ATA/CFC specific command)
ATA_GET_MODELGet the model string into a 40-byte buffer pointed by buff. (ATA/CFC specific command)
ATA_GET_SNGet the serial number string into a 20-byte buffer pointed by buff. (ATA/CFC specific command)
ISDIO_READRead a block of iSDIO registers specified by command structure pointed by buff. (FlashAir specific command)
ISDIO_WRITEWrite a block of data to iSDIO registers specified by command structure pointed by buff. (FlashAir specific command)
ISDIO_MRITEChange bits in an iSDIO register specified by command structure pointed by buff. (FlashAir specific command)
+
+ + +
+

QuickInfo

+

The disk_ioctl function is not needed when _FS_READONLY == 1 and _MAX_SS == _MIN_SS.

+
+ + +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/dread.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/dread.html new file mode 100644 index 0000000..1265aa3 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/dread.html @@ -0,0 +1,72 @@ + + + + + + + + +FatFs - disk_read + + + + +
+

disk_read

+

The disk_read function reads sector(s) from the storage device.

+
+DRESULT disk_read (
+  BYTE pdrv,     /* [IN] Physical drive number */
+  BYTE* buff,    /* [OUT] Pointer to the read data buffer */
+  DWORD sector,  /* [IN] Start sector number */
+  UINT count     /* [IN] Number of sectros to read */
+);
+
+
+ +
+

Parameters

+
+
pdrv
+
Physical drive number to identify the target device.
+
buff
+
Pointer to the first item of the byte array to store read data.
+
sector
+
Start sector number in 32-bit LBA.
+
count
+
Number of sectors to read.
+
+
+ + +
+

Return Value

+
+
RES_OK (0)
+
The function succeeded.
+
RES_ERROR
+
Any hard error occured during the read operation and could not recover it.
+
RES_PARERR
+
Invalid parameter.
+
RES_NOTRDY
+
The device has not been initialized.
+
+
+ + +
+

Description

+

The data read/write operation to the storage devices is done in unit of sector. FatFs supports the sector size in range of from 512 to 4096 bytes. When FatFs is configured to fixed sector size (_MIN_SS == MAX_SS, this will be the most case), the read/write function must work at that sector size. When FatFs is configured to variable sector size (_MIN_SS != MAX_SS), sector size is inquired with disk_ioctl function following disk_initialize function.

+

The memory address specified by buff is not that always aligned to word boundary because the argument is defined as BYTE*. The unaligned read/write request can occure at direct transfer. If the bus architecture, especially DMA controller, does not allow unaligned memory access, it should be solved in this function. There are some workarounds described below to avoid this issue.

+ +

Generally, a multiple sector transfer request must not be split into single sector transactions to the storage device, or you will not get good read throughput.

+
+ + +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/dstat.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/dstat.html new file mode 100644 index 0000000..795d72b --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/dstat.html @@ -0,0 +1,48 @@ + + + + + + + + +FatFs - disk_status + + + + +
+

disk_status

+

The disk_status function returns the current drive status.

+
+DSTATUS disk_status (
+  BYTE pdrv     /* [IN] Physical drive number */
+);
+
+
+ +
+

Parameter

+
+
pdrv
+
Physical drive number to identify the target device. Always zero at single drive system.
+
+
+ + +
+

Return Values

+

The current drive status is returned in combination of status flags described below. FatFs refers only STA_NOINIT and STA_PROTECT.

+
+
STA_NOINIT
+
Indicates that the device is not initialized and not ready to work. This flag is set on system reset, media removal or failure of disk_initialize function. It is cleared on disk_initialize function succeeded. Any media change that occurs asynchronously must be captured and reflect it to the status flags, or auto-mount function will not work correctly. If the system does not support media change detection, application program needs to force de-initialize the file system object and re-mount the volume with f_mount function after each media change.
+
STA_NODISK
+
Indicates that no medium in the drive. This is always cleared at fixed disk drive. Note that FatFs does not refer this flag.
+
STA_PROTECT
+
Indicates that the medium is write protected. This is always cleared at the drives without write protect function. Not valid if no medium in the drive.
+
+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/dwrite.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/dwrite.html new file mode 100644 index 0000000..9591fd9 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/dwrite.html @@ -0,0 +1,76 @@ + + + + + + + + +FatFs - disk_write + + + + +
+

disk_write

+

The disk_write writes sector(s) to the storage device.

+
+DRESULT disk_write (
+  BYTE drv,         /* [IN] Physical drive number */
+  const BYTE* buff, /* [IN] Pointer to the data to be written */
+  DWORD sector,     /* [IN] Sector number to write from */
+  UINT count        /* [IN] Number of sectors to write */
+);
+
+
+ +
+

Parameters

+
+
pdrv
+
Physical drive number to identify the target device.
+
buff
+
Pointer to the first item of the byte array to be written. The size of data to be written is sector size * count bytes.
+
sector
+
Start sector number in 32-bit LBA.
+
count
+
Number of sectors to write.
+
+
+ + +
+

Return Values

+
+
RES_OK (0)
+
The function succeeded.
+
RES_ERROR
+
Any hard error occured during the write operation and could not recover it.
+
RES_WRPRT
+
The medium is write protected.
+
RES_PARERR
+
Invalid parameter.
+
RES_NOTRDY
+
The device has not been initialized.
+
+
+ + +
+

Description

+

The specified memory address is not that always aligned to word boundary because the type of pointer is defined as BYTE*. For more information, refer to the description of disk_read function.

+

Generally, a multiple sector transfer request must not be split into single sector transactions to the storage device, or you will never get good write throughput.

+

FatFs expects delayed write function of the disk control layer. The write operation to the media does not need to be completed when return from this function by what write operation is in progress or data is only stored into the write-back cache. But write data on the buff is invalid after return from this function. The write completion request is done by CTRL_SYNC command of disk_ioctl function. Therefore, if a delayed write function is implemented, the write throughput will be improved.

+

Remarks: Application program MUST NOT call this function, or FAT structure on the volume can be collapsed.

+
+ + +
+

QuickInfo

+

This function is not needed when _FS_READONLY == 1.

+
+ + +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/eof.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/eof.html new file mode 100644 index 0000000..e2c3bff --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/eof.html @@ -0,0 +1,62 @@ + + + + + + + + +FatFs - f_eof + + + + +
+

f_eof

+

The f_eof function tests for end-of-file on a file.

+
+int f_eof (
+  FIL* fp   /* [IN] File object */
+);
+
+
+ + +
+

Parameters

+
+
fp
+
Pointer to the open file object structure.
+
+
+ + +
+

Return Values

+

The f_eof function returns a non-zero value if the read/write pointer has reached end of the file; otherwise it returns a zero.

+
+ + +
+

Description

+

In this revision, this function is implemented as a macro. It does not have any validation and mutual exclusion.

+
+#define f_eof(fp) ((int)((fp)->fptr == (fp)->fsize))
+
+
+ + +
+

QuickInfo

+

Always available.

+
+ + +
+

See Also

+

f_open, f_lseek, FIL

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/error.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/error.html new file mode 100644 index 0000000..8e082d9 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/error.html @@ -0,0 +1,62 @@ + + + + + + + + +FatFs - f_error + + + + +
+

f_error

+

The f_error tests for an error on a file.

+
+int f_error (
+  FIL* fp   /* [IN] File object */
+);
+
+
+ + +
+

Parameters

+
+
fp
+
Pointer to the open file object structure.
+
+
+ + +
+

Return Values

+

Returns a non-zero value if a hard error has occured; otherwise it returns a zero.

+
+ + +
+

Description

+

In this revision, this function is implemented as a macro. It does not have any validation and mutual exclusion.

+
+#define f_error(fp) ((fp)->err)
+
+
+ + +
+

QuickInfo

+

Always available.

+
+ + +
+

See Also

+

f_open, FIL

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/expand.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/expand.html new file mode 100644 index 0000000..c49e5e6 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/expand.html @@ -0,0 +1,116 @@ + + + + + + + + +FatFs - f_expand + + + + +
+

f_expand

+

The f_expand function prepares or allocates a contiguous data area to the file.

+ +
+FRESULT f_expand (
+  FIL*    fp,  /* [IN] File object */
+  FSIZE_t fsz, /* [IN] File size expanded to */
+  BYTE    opt  /* [IN] Operation mode */
+);
+
+
+ +
+

Parameters

+
+
fp
+
Pointer to the open file object.
+
fsz
+
Number of bytes in size to prepare or allocate for the file. The data type FSIZE_t is an alias of either DWORD(32-bit) or QWORD(64-bit) depends on the configuration option _FS_EXFAT.
+
opt
+
Operation mode. Prepare only (0) or Allocate now (1).
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_INVALID_OBJECT, +FR_DENIED, +FR_TIMEOUT +

+
+ + +
+

Description

+

The f_expand function prepares or allocates a contiguous data area to the file. When opt is 1, the function allocates a contiguous data area to the file. Unlike expansion of file by f_lseek function, the file must be truncated prior to use this function and read/write pointer of the file stays at top of the file after the function. The file content allocated with this function is undefined because no data is written to the file in this process. The function can fail with FR_DENIED due to some reasons below.

+ +

When opt is 0, the function finds a contiguous data area and set it as suggested point for next allocation instead of allocating it to the file. The next cluster allocation is started at top of the contiguous area found by this function. Thus the write file is guaranteed be contiguous and no allocation delay until the size reaches that size at least unless any other changes to the volume is performed.

+

The contiguous file would have an advantage at time-critical read/write operations. It reduces some overheads in the file system and the storage media caused by random access due to fragmented file data. Especially, at the exFAT volume, any FAT access for the contiguous file is completely eliminated and storage media will be accessed sequentially.

+

Also the contiguous file data can be easily accessed directly via low-level disk functions but it is not recommended in consideration for future compatibility.

+
+ +
+

QuickInfo

+

Available when _USE_EXPAND == 1 and _FS_READONLY == 0.

+
+ + +
+

Example

+
+    /* Creating a contiguous file */
+
+    /* Create a new file */
+    res = f_open(fp = malloc(sizeof (FIL)), "file.dat", FA_WRITE|FA_CREATE_ALWAYS);
+    if (res) { /* Check if the file has been opened */
+        free(fp);
+        ...
+    }
+
+    /* Alloacte a 100 MiB of contiguous area to the file */
+    res = f_expand(fp, 104857600, 1);
+    if (res) { /* Check if the file has been expanded */
+        ...
+        free(fp);
+        ...
+    }
+    /* Now you have a contiguous file accessible with fp */
+
+
+
+    /* Accessing the file data directly via low-level disk functions */
+
+    /* Get physical location of the file data */
+    drv = fp->obj.fs->drv;
+    sect = fp->obj.fs->database + fp->obj.fs->csize * (fp->obj.sclust - 2);
+
+    /* Write 2048 sectors from top of the file at a time */
+    res = disk_write(drv, buffer, sect, 2048);
+
+
+
+ + +
+

See Also

+

f_open, f_lseek, FIL

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/fattime.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/fattime.html new file mode 100644 index 0000000..da3dc29 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/fattime.html @@ -0,0 +1,57 @@ + + + + + + + + +FatFs - get_fattime + + + + +
+

get_fattime

+

The get_fattime function gets the current time.

+
+DWORD get_fattime (void);
+
+
+ + +
+

Return Value

+

Currnet local time is returned in bit-fields packed into a DWORD value. The bit field is as follows:

+
+
bit31:25
+
Year origin from the 1980 (0..127)
+
bit24:21
+
Month (1..12)
+
bit20:16
+
Day of the month(1..31)
+
bit15:11
+
Hour (0..23)
+
bit10:5
+
Minute (0..59)
+
bit4:0
+
Second / 2 (0..29)
+
+
+ + +
+

Description

+

The get_fattime function shall return any valid time even if the system does not support a real time clock. If a zero is returned, the file will not have a valid timestamp.

+
+ + +
+

QuickInfo

+

This function is not needed when _FS_READONLY == 1 or _FS_NORTC == 1.

+
+ + +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/fdisk.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/fdisk.html new file mode 100644 index 0000000..7a272ff --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/fdisk.html @@ -0,0 +1,92 @@ + + + + + + + + +FatFs - f_fdisk + + + + +
+

f_fdisk

+

The f_fdisk fucntion divides a physical drive.

+
+FRESULT f_fdisk (
+  BYTE  pdrv,        /* [IN] Physical drive number */
+  const DWORD* szt,  /* [IN] Partition map table */
+  void* work         /* [IN] Work area */
+);
+
+
+ +
+

Parameters

+
+
pdrv
+
Specifies the physical drive to be divided. This is not the logical drive number but the drive identifier passed to the low level disk functions.
+
szt
+
Pointer to the first item of the partition map table.
+
work
+
Pointer to the function work area. The size must be at least _MAX_SS bytes.
+
+
+ +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_NOT_READY, +FR_WRITE_PROTECTED, +FR_INVALID_PARAMETER +

+
+ +
+

Description

+

The f_fdisk function creates partitions on the physical drive. The partitioning format is in generic FDISK format, so that it can create upto four primary partitions. Logical volumes in the extended partition is not supported. The partition map table with four items specifies how to divide the physical drive. The first item specifies the size of first primary partition and fourth item specifies the fourth primary partition. If the value is less than or equal to 100, it specifies the partition size in percentage of the entire drive space. If it is larger than 100, it specifies the partition size in unit of sector. The partitions are located on the drive in order of from first item.

+
+ +
+

QuickInfo

+

Available when _FS_READOLNY == 0, _USE_MKFS == 1 and _MULTI_PARTITION == 1.

+
+ +
+

Example

+
+    /* Volume management table defined by user (required when _MULTI_PARTITION == 1) */
+
+    PARTITION VolToPart[] = {
+        {0, 1},    /* Logical drive 0 ==> Physical drive 0, 1st partition */
+        {0, 2},    /* Logical drive 1 ==> Physical drive 0, 2nd partition */
+        {1, 0}     /* Logical drive 2 ==> Physical drive 1, auto detection */
+    };
+
+
+    /* Initialize a brand-new disk drive mapped to physical drive 0 */
+
+    FATFS fs;
+    DWORD plist[] = {50, 50, 0, 0};  /* Divide drive into two partitions */
+    BYTE work[_MAX_SS];
+
+    f_fdisk(0, plist, work);                     /* Divide physical drive 0 */
+
+    f_mkfs("0:", FMT_ANY, work, sizeof work);    /* Create FAT volume on the logical drive 0 */
+    f_mkfs("1:", FMT_ANY, work, sizeof work);    /* Create FAT volume on the logical drive 1 */
+
+
+
+ +
+

See Also

+

Volume management, f_mkfs

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/filename.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/filename.html new file mode 100644 index 0000000..07916a2 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/filename.html @@ -0,0 +1,85 @@ + + + + + + + + +FatFs - Path Names + + + +

Path Names

+ +
+

Format of the path names

+

The format of path name on the FatFs module is similer to the filename specs of DOS/Windos as follows:

+
"[drive:][/]directory/file"
+

The FatFs module supports long file name (LFN) and 8.3 format file name (SFN). The LFN can be used when (_USE_LFN != 0). The sub directories are separated with a \ or / in the same way as DOS/Windows API. Duplicated separators are skipped and ignored. Only a difference is that the logical drive is specified in a numeral with a colon. When drive number is omitted, the drive number is assumed as default drive (drive 0 or current drive).

+

Control characters ('\0' to '\x1F') are recognized as end of the path name. Leading/embedded spaces in the path name are valid as a part of the name at LFN configuration but the space is recognized as end of the path name at non-LFN configuration. Trailing spaces and dots are ignored at both configurations.

+

In default configuration (_FS_RPATH == 0), it does not have a concept of current directory like OS oriented file system. All objects on the volume are always specified in full path name that follows from the root directory. Dot directory names (".", "..") are not allowed. Heading separator is ignored and it can be exist or omitted. The default drive is fixed to drive 0.

+

When relative path is enabled (_FS_RPATH >= 1), specified path is followed from the root directory if a heading separator is exist. If not, it is followed from the current directory of the drive set by f_chdir function. Dot names are also allowed for the path names. The default drive is the current drive set by f_chdrive function.

+ + + + + + + + + + + + + + +
Path name_FS_RPATH == 0_FS_RPATH >= 1
file.txtA file in the root directory of the drive 0A file in the current directory of the current drive
/file.txtA file in the root directory of the drive 0A file in the root directory of the current drive
The root directory of the drive 0The current directory of the current drive
/The root directory of the drive 0The root directory of the current drive
2:The root directory of the drive 2The current directory of the drive 2
2:/The root directory of the drive 2The root directory of the drive 2
2:file.txtA file in the root directory of the drive 2A file in the current directory of the drive 2
../file.txtInvalid nameA file in the parent directory
.Invalid nameThis directory
..Invalid nameParent directory of the current directory (*)
dir1/..Invalid nameThe current directory
/..Invalid nameThe root directory (sticks the top level)
+

When option _STR_VOLUME_ID is specified, also pre-defined strings can be used as drive identifier in the path name instead of a numeral. e.g. "sd:file1.txt", "ram:swapfile.dat" and DOS/Windows style drive letter, of course.

+

Remark: In this revision, double dot name ".." cannot follow the parent directory on the exFAT volume. It will work as "." and stay there.

+
+ +
+

Legal Characters and Case Sensitivity

+

On the FAT file system, legal characters for file name are, 0-9 A-Z ! # $ % & ' ( ) - @ ^ _ ` { } ~ and extended characters (\x80-\xFF). Under LFN supported system, also white space and + , ; = [ ] are legal for the file name and the white spaces and periods can be placed anywhere in the name except for end of the name string.

+

FAT file system is case-insensitive to the object names on the volume. All object names are compared in case-insensitive. For example, these three names, file.txt, File.Txt and FILE.TXT, are identical. This is applied to also extended charactres. When an object is created on the FAT volume, upper converted name is recorded to the SFN entry, and the raw name is recorded to the LFN entry.

+

As for the DBCS language MS-DOS, it was case-sensitive to the extended characters. To follow this specification, FatFs works with case-sensitive to the extended characters at only non-LFN with DBCS configuration (DOS/DBCS specs). But at LFN configuration, FatFs works with case-insensitive to all characters (WindowsNT specs). This can cause a problem on compatibility with Windows system when an object with extended characters is created on the volume at non-LFN and DBCS configuration; therfore the object names with DBCS extended characters should not be used on the FAT volume shared by those systems.

+
+ +
+

Unicode API

+

The path names are input/output in either ANSI/OEM code or Unicode depends on the configuration options. The type of arguments which specify the path names are defined as TCHAR. It is an alias of char by default. The code set used to the path name string is ANSI/OEM specifid by _CODE_PAGE. When _LFN_UNICODE is set to 1, the type of the TCHAR is switched to WCHAR to support Unicode (UTF-16 encoding). In this case, the full-featured LFN specification is supported and the Unicode specific characters, such as ✝☪✡☸☭, can also be used for the path name. It also affects data types and encoding of the string I/O functions. To define literal strings, _T(s) and _TEXT(s) macro are available to select either ANSI/OEM or Unicode automatically. The code shown below is an example to define the literal strings.

+
+ f_open(fp, "filename.txt", FA_READ);      /* ANSI/OEM string */
+ f_open(fp, L"filename.txt", FA_READ);     /* Unicode string */
+ f_open(fp, _T("filename.txt"), FA_READ);  /* Changed by configuration */
+
+
+ +
+

Volume Management

+

FatFs module needs dynamic work area, file system object, for each volume (logical drive). It is registered/unregistered to the FatFs module by f_mount function. By default, each logical drive is bound to the physical drive with the same drive number and an FAT volume on the drive is serched by the volume mount process. It reads boot sectors and checks it if it is an FAT boot sector in order of sector 0 as SFD format, 1st partition, 2nd partition, 3rd partition and 4th partition as FDISK format.

+

When _MULTI_PARTITION == 1 is specified by configuration option, each individual logical drive is bound to the partition on the physical drive specified by volume management table. The volume management table must be defined by user to resolve the relationship between logical drives and partitions. Following code is an example of a volume management table.

+
+Example: Logical drive 0-2 are tied to three pri-partitions on the physical drive 0 (fixed drive)
+         Logical drive 3 is tied to an FAT volume on the physical drive 1 (removable drive)
+
+PARTITION VolToPart[] = {
+    {0, 1},     /* "0:" ==> Physical drive 0, 1st partition */
+    {0, 2},     /* "1:" ==> Physical drive 0, 2nd partition */
+    {0, 3},     /* "2:" ==> Physical drive 0, 3rd partition */
+    {1, 0}      /* "3:" ==> Physical drive 1, auto detection */
+};
+
+
relationship between logical drive and physical drive
+

There are some considerations on using multi-partition configuration.

+ +
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/findfirst.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/findfirst.html new file mode 100644 index 0000000..80b621e --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/findfirst.html @@ -0,0 +1,110 @@ + + + + + + + + +FatFs - f_findfirst + + + + +
+

f_findfirst

+

The f_findfirst function searches a directroy for an item.

+
+FRESULT f_findfirst (
+  DIR* dp,              /* [OUT] Poninter to the directory object */
+  FILINFO* fno,         /* [OUT] Pointer to the file information structure */
+  const TCHAR* path,    /* [IN] Pointer to the directory name to be opened */
+  const TCHAR* pattern  /* [IN] Pointer to the matching pattern string */
+);
+
+
+ +
+

Parameters

+
+
dp
+
Pointer to the blank directory object.
+
fno
+
Pointer to the file information structure to store the information about the found item.
+
path
+
Pointer to the null-terminated string that specifies the directory name to be opened.
+
pattern
+
Pointer to the nul-terminated string that specifies the name matching pattern to be searched for. It is referred by also subsequent f_findnext function, so that the string must be valid while the successive function calls.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_NO_PATH, +FR_INVALID_NAME, +FR_INVALID_OBJECT, +FR_INVALID_DRIVE, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT, +FR_NOT_ENOUGH_CORE, +FR_TOO_MANY_OPEN_FILES +

+
+ + +
+

Description

+

After the directory specified by path could be opened, it starts to search the directory for items with the name specified by pattern. If the first item is found, the information about the object is stored into the file information structure. For more information about file information structure, refer to f_readdir function.

+

The matching pattern can contain wildcard characters (? and *). A ? matches an any character and an * matches an any string in length of zero or longer. When support of long file name is enabled, only fname[] is tested at _USE_FIND == 1 and also altname[] is tested at _USE_FIND == 2. In this revision, there are some differences listed below between FatFs and standard systems in matching condition.

+ +
+ + +
+

QuickInfo

+

This is a wrapper function of f_opendir and f_readdir function. Available when _USE_FIND >= 1 and _FS_MINIMIZE <= 1.

+
+ + +
+

Examples

+
+/* Search a directory for objects and display it */
+
+void find_image (void)
+{
+    FRESULT fr;     /* Return value */
+    DIR dj;         /* Directory search object */
+    FILINFO fno;    /* File information */
+
+    fr = f_findfirst(&dj, &fno, "", "dsc*.jpg");  /* Start to search for photo files */
+
+    while (fr == FR_OK && fno.fname[0]) {         /* Repeat while an item is found */
+        printf("%s\n", fno.fname);                /* Display the object name */
+        fr = f_findnext(&dj, &fno);               /* Search for next item */
+    }
+    f_closedir(&dj);
+}
+
+
+ + +
+

See Also

+

f_findnext, f_closedir, DIR, FILINFO

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/findnext.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/findnext.html new file mode 100644 index 0000000..a8591d5 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/findnext.html @@ -0,0 +1,69 @@ + + + + + + + + +FatFs - f_findnext + + + + +
+

f_findnext

+

The f_findnext function searches for a next matched object

+
+FRESULT f_findnext (
+  DIR* dp,              /* [IN] Poninter to the directory object */
+  FILINFO* fno          /* [OUT] Pointer to the file information structure */
+);
+
+
+ +
+

Parameters

+
+
dp
+
Pointer to the valid directory object created by f_findfirst function.
+
fno
+
Pointer to the file information structure to store the information about the found directory item.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_INVALID_OBJECT, +FR_TIMEOUT, +FR_NOT_ENOUGH_CORE +

+
+ + +
+

Description

+

It continues the search from a previous call to the f_findfirst or f_findnext function. If found, the information about the object is stored into the file information structure. If no item to be read, a null string will be returned into fno->fname[].

+
+ + +
+

QuickInfo

+

This is a wrapper function of f_readdir function. Available when _USE_FIND == 1 and _FS_MINIMIZE <= 1.

+
+ + +
+

See Also

+

f_findfirst, f_closedir, DIR, FILINFO

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/forward.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/forward.html new file mode 100644 index 0000000..6fee72d --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/forward.html @@ -0,0 +1,138 @@ + + + + + + + + +FatFs - f_forward + + + + +
+

f_forward

+

The f_forward function reads the file data and forward it to the data streaming device.

+
+FRESULT f_forward (
+  FIL* fp,                        /* [IN] File object */
+  UINT (*func)(const BYTE*,UINT), /* [IN] Data streaming function */
+  UINT btf,                       /* [IN] Number of bytes to forward */
+  UINT* bf                        /* [OUT] Number of bytes forwarded */
+);
+
+
+ +
+

Parameters

+
+
fp
+
Pointer to the open file object.
+
func
+
Pointer to the user-defined data streaming function. For details, refer to the sample code.
+
btf
+
Number of bytes to forward in range of UINT.
+
bf
+
Pointer to the UINT variable to return number of bytes forwarded.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_INVALID_OBJECT, +FR_TIMEOUT +

+
+ + +
+

Description

+

The f_forward function reads the data from the file and forward it to the outgoing stream without data buffer. This is suitable for small memory system because it does not require any data buffer at application module. The file pointer of the file object increases in number of bytes forwarded. In case of *bf is less than btf without error, it means the requested bytes could not be transferred due to end of file or stream goes busy during data transfer.

+
+ + +
+

QuickInfo

+

Available when _USE_FORWARD == 1.

+
+ + +
+

Example (Audio playback)

+
+/*------------------------------------------------------------------------*/
+/* Sample code of data transfer function to be called back from f_forward */
+/*------------------------------------------------------------------------*/
+
+UINT out_stream (   /* Returns number of bytes sent or stream status */
+    const BYTE *p,  /* Pointer to the data block to be sent */
+    UINT btf        /* >0: Transfer call (Number of bytes to be sent). 0: Sense call */
+)
+{
+    UINT cnt = 0;
+
+
+    if (btf == 0) {     /* Sense call */
+        /* Return stream status (0: Busy, 1: Ready) */
+        /* When once it returned ready to sense call, it must accept a byte at least */
+        /* at subsequent transfer call, or f_forward will fail with FR_INT_ERR. */
+        if (FIFO_READY) cnt = 1;
+    }
+    else {              /* Transfer call */
+        do {    /* Repeat while there is any data to be sent and the stream is ready */
+            FIFO_PORT = *p++;
+            cnt++;
+        } while (cnt < btf && FIFO_READY);
+    }
+
+    return cnt;
+}
+
+
+/*------------------------------------------------------------------------*/
+/* Sample code using f_forward function                                   */
+/*------------------------------------------------------------------------*/
+
+FRESULT play_file (
+    char *fn        /* Pointer to the audio file name to be played */
+)
+{
+    FRESULT rc;
+    FIL fil;
+    UINT dmy;
+
+    /* Open the audio file in read only mode */
+    rc = f_open(&fil, fn, FA_READ);
+    if (rc) return rc;
+
+    /* Repeat until the file pointer reaches end of the file */
+    while (rc == FR_OK && !f_eof(&fil)) {
+
+        /* any other processes... */
+
+        /* Fill output stream periodicaly or on-demand */
+        rc = f_forward(&fil, out_stream, 1000, &dmy);
+    }
+
+    /* Close the file and return */
+    f_close(&fil);
+    return rc;
+}
+
+
+ + +
+

See Also

+

f_open, fgets, f_write, f_close, FIL

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/getcwd.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/getcwd.html new file mode 100644 index 0000000..4843c7c --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/getcwd.html @@ -0,0 +1,71 @@ + + + + + + + + +FatFs - f_getcwd + + + + +
+

f_getcwd

+

The f_getcwd function retrieves the current directory and current drive.

+
+FRESULT f_getcwd (
+  TCHAR* buff, /* [OUT] Buffer to return path name */
+  UINT len     /* [IN] The length of the buffer */
+);
+
+
+ +
+

Parameters

+
+
buff
+
Pointer to the buffer to receive the current directory string.
+
len
+
Size of the buffer in unit of TCHAR.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT, +FR_NOT_ENOUGH_CORE +

+
+ + +
+

Description

+

The f_getcwd function retrieves full path name of the current directory of the current drive. When _VOLUMES is larger than 1, a logical drive number is added to top of the path name.

+

Note: In this revision, this function cannot retrieve the current directory path on the exFAT volume. It always returns the root directory path.

+
+ + +
+

QuickInfo

+

Available when _FS_RPATH == 2.

+
+ + +
+

See Also

+

f_chdrive, f_chdir

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/getfree.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/getfree.html new file mode 100644 index 0000000..ebbdf05 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/getfree.html @@ -0,0 +1,95 @@ + + + + + + + + +FatFs - f_getfree + + + + +
+

f_getfree

+

The f_getfree function gets number of the free clusters on the volume.

+
+FRESULT f_getfree (
+  const TCHAR* path,  /* [IN] Logical drive number */
+  DWORD* nclst,       /* [OUT] Number of free clusters */
+  FATFS** fatfs       /* [OUT] Corresponding file system object */
+);
+
+
+ +
+

Parameters

+
+
path
+
Pointer to the null-terminated string that specifies the logical drive. A null-string means the default drive.
+
nclst
+
Pointer to the DWORD variable to store number of free clusters.
+
fatfs
+
Pointer to pointer that to store a pointer to the corresponding file system object.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_INVALID_DRIVE, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT +

+
+ + +
+

Descriptions

+

The f_getfree function gets number of free clusters on the volume. The member csize in the file system object indicates number of sectors per cluster, so that the free space in unit of sector can be calcurated with this information. When FSINFO structure on the FAT32 volume is not in sync, this function can return an incorrect free cluster count. To avoid this problem, FatFs can be forced full FAT scan by _FS_NOFSINFO option.

+
+ + +
+

QuickInfo

+

Available when _FS_READONLY == 0 and _FS_MINIMIZE == 0.

+
+ + +
+

Example

+
+    FATFS *fs;
+    DWORD fre_clust, fre_sect, tot_sect;
+
+
+    /* Get volume information and free clusters of drive 1 */
+    res = f_getfree("1:", &fre_clust, &fs);
+    if (res) die(res);
+
+    /* Get total sectors and free sectors */
+    tot_sect = (fs->n_fatent - 2) * fs->csize;
+    fre_sect = fre_clust * fs->csize;
+
+    /* Print the free space (assuming 512 bytes/sector) */
+    printf("%10lu KiB total drive space.\n%10lu KiB available.\n",
+           tot_sect / 2, fre_sect / 2);
+
+
+ + +
+

See Also

+

FATFS

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/getlabel.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/getlabel.html new file mode 100644 index 0000000..8992f3d --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/getlabel.html @@ -0,0 +1,82 @@ + + + + + + + + +FatFs - f_getlabel + + + + +
+

f_getlabel

+

The f_getlabel function returns volume label and volume serial number of a drive.

+
+FRESULT f_getlabel (
+  const TCHAR* path,  /* [IN] Drive number */
+  TCHAR* label,       /* [OUT] Volume label */
+  DWORD* vsn          /* [OUT] Volume serial number */
+);
+
+
+ +
+

Parameters

+
+
path
+
Pointer to the null-terminated string that specifies the logical drive. Null-string specifies the default drive.
+
label
+
Pointer to the buffer to store the volume label. The buffer size must be at least 24 items at _LFN_UNICODE == 0 or 12 items at _LFN_UNICODE == 1. If the volume has no label, a null-string will be returned. Set null pointer if this information is not needed.
+
vsn
+
Pointer to the DWORD variable to store the volume serial number. Set null pointer if this information is not needed.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_INVALID_DRIVE, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT +

+
+ + +
+

QuickInfo

+

Available when _USE_LABEL == 1.

+
+ + +
+

Example

+
+    char str[24];
+
+    /* Get volume label of the default drive */
+    f_getlabel("", str, 0);
+
+    /* Get volume label of the drive 2 */
+    f_getlabel("2:", str, 0);
+
+
+ + +
+

See Also

+f_setlabel +
+ + +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/gets.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/gets.html new file mode 100644 index 0000000..296a988 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/gets.html @@ -0,0 +1,65 @@ + + + + + + + + +FatFs - f_gets + + + + +
+

f_gets

+

The f_gets reads a string from the file.

+
+TCHAR* f_gets (
+  TCHAR* buff, /* [OUT] Read buffer */
+  int len,     /* [IN] Size of the read buffer */
+  FIL* fp      /* [IN] File object */
+);
+
+
+ +
+

Parameters

+
+
buff
+
Pointer to read buffer to store the read string.
+
len
+
Size of the read buffer in unit of character.
+
fp
+
Pointer to the open file object structure.
+
+
+ + +
+

Return Values

+

When the function succeeded, buff will be returuned.

+
+ + +
+

Description

+

The read operation continues until a '\n' is stored, reached end of the file or the buffer is filled with len - 1 characters. The read string is terminated with a '\0'. When no character to read or any error occured during read operation, it returns a null pointer. The status of EOF and error can be examined with f_eof and f_error function.

+

When FatFs is configured to Unicode API (_LFN_UNICODE == 1), data types on the srting fuctions, f_putc, f_puts, f_printf and f_gets, is also switched to Unicode. The character encoding on the file to be read/written via those functions is selected by _STRF_ENCODE option.

+
+ + +
+

QuickInfo

+

This is a wrapper function of f_read function. Available when _USE_STRFUNC is 1 or 2. When it is set to 2, '\r's contained in the file are stripped out.

+
+ + +
+

See Also

+

f_open, f_read, f_putc, f_puts, f_printf, f_close, FIL

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/lseek.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/lseek.html new file mode 100644 index 0000000..ed7df60 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/lseek.html @@ -0,0 +1,130 @@ + + + + + + + + +FatFs - f_lseek + + + + +
+

f_lseek

+

The f_lseek function moves the file read/write pointer of an open file object. It can also be used to expand the file size (cluster pre-allocation).

+ +
+FRESULT f_lseek (
+  FIL*    fp,  /* [IN] File object */
+  FSIZE_t ofs  /* [IN] File read/write pointer */
+);
+
+
+ +
+

Parameters

+
+
fp
+
Pointer to the open file object.
+
ofs
+
Byte offset from top of the file. The data type FSIZE_t is an alias of either DWORD(32-bit) or QWORD(64-bit) depends on the configuration option _FS_EXFAT.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_INVALID_OBJECT, +FR_TIMEOUT +

+
+ + +
+

Description

+

The f_lseek function moves the file read/write pointer of an open file. The offset can be specified in only origin from top of the file. When an offset beyond the file size is specified at write mode, the file size is expanded to the specified offset. The file data in the expanded area is undefined because no data is written to the file in this process. This is suitable to pre-allocate a cluster chain quickly, for fast write operation. When a contiguous data area needs to be allocated to the file, use f_expand function instead. After the f_lseek function succeeded, the current read/write pointer should be checked in order to make sure the read/write pointer has been moved correctry. In case of the read/write pointer is not the expected value, either of followings has been occured.

+ +

The fast seek function enables fast backward/long seek operations without FAT access by using an on-memory CLMT (cluster link map table). It is applied to f_read and f_write function as well, however, the file size cannot be expanded by f_write, f_lseek function while the file is in fast seek mode.

+

The fast seek function is enabled when the member cltbl in the file object is not NULL. The CLMT must be created into the DWORD array prior to use the fast seek function. To create the CLMT, set address of the DWORD array to the member cltbl in the open file object, set the size of array in unit of items to the first item and call the f_lseek function with ofs = CREATE_LINKMAP. After the function succeeded and CLMT is created, no FAT access is occured in subsequent f_read, f_write, f_lseek function to the file. The number of items used or required is returned into the first item of the array. The number of items to be used is (number of the file fragments + 1) * 2. For example, when the file is fragmented in 5, 12 items in the array will be used. If the function failed with FR_NOT_ENOUGH_CORE, the given array size is insufficient for the file.

+
+ + +
+

QuickInfo

+

Available when _FS_MINIMIZE <= 2. To use fast seek function, _USE_FASTSEEK needs to be set 1.

+
+ + +
+

Example

+
+    /* Open file */
+    fp = malloc(sizeof (FIL));
+    res = f_open(fp, "file.dat", FA_READ|FA_WRITE);
+    if (res) ...
+
+    /* Move to offset of 5000 from top of the file */
+    res = f_lseek(fp, 5000);
+
+    /* Move to end of the file to append data */
+    res = f_lseek(fp, f_size(fp));
+
+    /* Forward 3000 bytes */
+    res = f_lseek(fp, f_tell(fp) + 3000);
+
+    /* Rewind 2000 bytes (take care on wraparound) */
+    res = f_lseek(fp, f_tell(fp) - 2000);
+
+
+/* Cluster pre-allocation (to prevent buffer overrun on streaming write) */
+
+    res = f_open(fp, recfile, FA_CREATE_NEW | FA_WRITE);   /* Create a file */
+
+    res = f_lseek(fp, PRE_SIZE);             /* Expand file size (cluster pre-allocation) */
+    if (res || f_tell(fp) != PRE_SIZE) ...   /* Check if the file has been expanded */
+
+    res = f_lseek(fp, DATA_START);           /* Record data stream WITHOUT cluster allocation delay */
+    ...                                      /* Write operation should be aligned to sector boundary to optimize the write throughput */
+
+    res = f_truncate(fp);                    /* Truncate unused area */
+    res = f_lseek(fp, 0);                    /* Put file header */
+    ...
+
+    res = f_close(fp);
+
+
+/* Using fast seek function */
+
+    DWORD clmt[SZ_TBL];                    /* Cluster link map table buffer */
+
+    res = f_open(fp, fname, FA_READ | FA_WRITE);   /* Open a file */
+
+    res = f_lseek(fp, ofs1);               /* This is normal seek (cltbl is nulled on file open) */
+
+    fp->cltbl = clmt;                      /* Enable fast seek function (cltbl != NULL) */
+    clmt[0] = SZ_TBL;                      /* Set table size */
+    res = f_lseek(fp, CREATE_LINKMAP);     /* Create CLMT */
+    ...
+
+    res = f_lseek(fp, ofs2);               /* This is fast seek */
+
+
+ + +
+

See Also

+

f_open, f_truncate, f_expand, FIL

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/mkdir.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/mkdir.html new file mode 100644 index 0000000..bc3e864 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/mkdir.html @@ -0,0 +1,80 @@ + + + + + + + + +FatFs - f_mkdir + + + + +
+

f_mkdir

+

The f_mkdir function creates a new directory.

+
+FRESULT f_mkdir (
+  const TCHAR* path /* [IN] Directory name */
+);
+
+
+ +
+

Parameter

+
+
path
+
Pointer to the null-terminated string that specifies the directory name to create.
+
+
+ + +
+

Return Value

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_NO_PATH, +FR_INVALID_NAME, +FR_DENIED, +FR_EXIST, +FR_WRITE_PROTECTED, +FR_INVALID_DRIVE, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT, +FR_NOT_ENOUGH_CORE +

+
+ + +
+

Description

+

This function creates a new directory. To remove a directory, use f_unlink function.

+
+ + +
+

QuickInfo

+

Available when _FS_READONLY == 0 and _FS_MINIMIZE == 0.

+
+ + +
+

Example

+
+    res = f_mkdir("sub1");
+    if (res) die(res);
+    res = f_mkdir("sub1/sub2");
+    if (res) die(res);
+    res = f_mkdir("sub1/sub2/sub3");
+    if (res) die(res);
+
+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/mkfs.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/mkfs.html new file mode 100644 index 0000000..b10e370 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/mkfs.html @@ -0,0 +1,116 @@ + + + + + + + + +FatFs - f_mkfs + + + + +
+

f_mkfs

+

The f_mkfs fucntion creates an FAT/exFAT volume on the logical drive.

+
+FRESULT f_mkfs (
+  const TCHAR* path,  /* [IN] Logical drive number */
+  BYTE  opt,          /* [IN] Format options */
+  DWORD au,           /* [IN] Size of the allocation unit */
+  void* work,         /* [-]  Working buffer */
+  UINT len            /* [IN] Size of working buffer */
+);
+
+
+ +
+

Parameters

+
+
path
+
Pointer to the null-terminated string specifies the logical drive to be formatted. If there is no drive number in it, it means the default drive. The logical drive may or may not be mounted for the format process.
+
opt
+
Specifies the format option in combination of FM_FAT, FM_FAT32, FM_EXFAT and bitwise-or of these three, FM_ANY. FM_EXFAT is ignored when exFAT is not enabled. These flags specify which FAT type to be created on the volume. If two or more types are specified, one out of them will be selected depends on the volume size. The flag FM_SFD specifies to place the volume on the drive in SFD format.
+
au
+
Specifies size of the allocation unit (cluter) in unit of byte. The valid value is N times the sector size. N is power of 2 from 1 to 128 for FAT volume and upto 16MiB for exFAT volume. If zero is given, the default allocation unit size is selected depends on the volume size.
+
work
+
Pointer to the working buffer used for the format process.
+
len
+
Size of the working buffer in unit of byte. It needs to be the sector size at least. Plenty of working buffer reduces number of write transaction to the device and the format process will be finished quickly.
+
+
+ +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_NOT_READY, +FR_WRITE_PROTECTED, +FR_INVALID_DRIVE, +FR_MKFS_ABORTED, +FR_INVALID_PARAMETER +

+
+ +
+

Description

+

The FAT sub-type, FAT12/FAT16/FAT32, of FAT volume except exFAT is determined by only number of clusters on the volume and nothing else, according to the FAT specification issued by Microsoft. Thus which FAT sub-type is selected, is depends on the volume size and the specified cluster size. In case of the combination of FAT type and cluter size specified by argument cannot be valid on the volume, the function will fail with FR_MKFS_ABORTED.

+

The allocation unit, also called 'cluster', is a unit of disk space allocation for files. When the size of allocation unit is 32768 bytes, a file with 100 bytes in size occupies 32768 bytes of disk space. The space efficiency of disk usage gets worse as increasing size of allocation unit, but, on the other hand, the read/write performance increases as the size of allocation unit. Therefore the allocation unit is a trade-off between space efficiency and performance. For the large storages in GB order, 32768 bytes or larger cluster (this is automatically selected by default) is recommended for most case unless extremely many files are created on a volume.

+

There are two disk formats, FDISK and SFD. The FDISK format is usually used for harddisk, MMC, SDC, CFC and U Disk. It can divide a physical drive into one or more partitions with a partition table on the MBR (maser boot record, the first sector of the physical drive). The SFD (super-floppy disk) is non-partitioned disk format. The FAT volume starts at the first sector of the physical drive without any disk partitioning. It is usually used for floppy disk, Microdrive, optical disk and most type of super-floppy media. Some systems support only either one of two formats and other is not supported.

+

When FM_SFD is not specified, a primary partition occupies whole drive space is created and then the FAT volume is created in it. When FM_SFD is specified, the FAT volume occupies from the first sector of the drive is created.

+

If the logical drive to be formatted is bound to the specific partition (1-4) by support of multiple partition, _MULTI_PARTITION, the FAT volume is created into the partition and FM_SFD flag is ignored. The physical drive needs to be partitioned with f_fdisk function or any other partitioning tools prior to create the FAT volume with this function.

+
+ +
+

QuickInfo

+

Available when _FS_READOLNY == 0 and _USE_MKFS == 1.

+
+ +
+

Example

+
+/* Format default drive and create a file */
+int main (void)
+{
+    FATFS fs;           /* File system object */
+    FIL fil;            /* File object */
+    FRESULT res;        /* API result code */
+    UINT bw;            /* Bytes written */
+    BYTE work[_MAX_SS]; /* Work area (larger is better for process time) */
+
+
+    /* Create FAT volume */
+    res = f_mkfs("", FM_ANY, 0, work, sizeof work);
+    if (res) ...
+
+    /* Register work area */
+    f_mount(&fs, "", 0);
+
+    /* Create a file as new */
+    res = f_open(&fil, "hello.txt", FA_CREATE_NEW | FA_WRITE);
+    if (res) ...
+
+    /* Write a message */
+    f_write(&fil, "Hello, World!\r\n", 15, &bw);
+    if (bw != 15) ...
+
+    /* Close the file */
+    f_close(&fil);
+
+    /* Unregister work area */
+    f_mount(0, "", 0);
+
+    ...
+
+
+ +
+

See Also

+

Example of volume size and format parameters, Volume management, f_fdisk

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/mount.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/mount.html new file mode 100644 index 0000000..35462ee --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/mount.html @@ -0,0 +1,83 @@ + + + + + + + + +FatFs - f_mount + + + + +
+

f_mount

+

The f_mount fucntion registers/unregisters file system object to the FatFs module.

+
+FRESULT f_mount (
+  FATFS*       fs,    /* [IN] File system object */
+  const TCHAR* path,  /* [IN] Logical drive number */
+  BYTE         opt    /* [IN] Initialization option */
+);
+
+
+ +
+

Parameters

+
+
fs
+
Pointer to the file system object to be registered and cleared. Null pointer unregisters the registered file system object.
+
path
+
Pointer to the null-terminated string that specifies the logical drive. The string without drive number means the default drive.
+
opt
+
Mounting option. 0: Do not mount now (to be mounted on the first access to the volume), 1: Force mounted the volume to check if it is ready to work.
+
+
+ +
+

Return Values

+

+FR_OK, +FR_INVALID_DRIVE, +FR_DISK_ERR, +FR_NOT_READY, +FR_NO_FILESYSTEM +

+
+ + +
+

Description

+

The f_mount function registers/unregisters a file system object used for the volume (logical drive) to the FatFs module as follows:

+
    +
  1. Determines the logical drive which specified by path.
  2. +
  3. Clears and unregisters the regsitered work area of the drive if exist.
  4. +
  5. Clears and registers the new work area to the drive if fs is not NULL.
  6. +
  7. Performs volume mount process to the drive if forced mounting is specified.
  8. +
+

The file system object is the work area needed for each logical drive. It must be given to the logical drive with this function prior to use any API functions except for f_mkfs/f_fdisk function to the logical drive.

+

If forced mounting is not specified (opt = 0), this function always succeeds regardless of the physical drive status. It only clears (de-initializes) the given work area and registers its address to the internal table and no activity of the physical drive in this function. To unregister the work area, specify a NULL to the fs, and then the work area can be discarded. The volume mount processes, initialize the corresponding physical drive, find the FAT volume in it and initialize the work area, is performed in the subsequent file access functions when either or both of following condition is true.

+ +

If the function with forced mounting (opt = 1) failed, it means that the file system object has been registered successfully but the volume is currently not ready to work. The volume mount process will be attempted at subsequent file access functions if the file system object is not initialized. (delayed mounting)

+

If implementation of the disk I/O layer lacks media change detection, application program needs to perform a f_mount function after each media change to force cleared the file system object.

+
+ + +
+

QuickInfo

+

Always available.

+
+ + +
+

See Also

+

f_open, FATFS

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/open.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/open.html new file mode 100644 index 0000000..7435142 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/open.html @@ -0,0 +1,173 @@ + + + + + + + + +FatFs - f_open + + + + +
+

f_open

+

The f_open function creates a file object to be used to access the file.

+
+FRESULT f_open (
+  FIL* fp,           /* [OUT] Pointer to the file object structure */
+  const TCHAR* path, /* [IN] File name */
+  BYTE mode          /* [IN] Mode flags */
+);
+
+
+ +
+

Parameters

+
+
fp
+
Pointer to the blank file object structure.
+
path
+
Pointer to the null-terminated string that specifies the file name to open or create.
+
mode
+
Mode flags that specifies the type of access and open method for the file. It is specified by a combination of following flags.
+ + + + + + + + + +
ValueMeaning
FA_READSpecifies read access to the object. Data can be read from the file.
FA_WRITESpecifies write access to the object. Data can be written to the file. Combine with FA_READ for read-write access.
FA_OPEN_EXISTINGOpens the file. The function fails if the file is not existing. (Default)
FA_CREATE_NEWCreates a new file. The function fails with FR_EXIST if the file is existing.
FA_CREATE_ALWAYSCreates a new file. If the file is existing, it will be truncated and overwritten.
FA_OPEN_ALWAYSOpens the file if it is existing. If not, a new file will be created.
FA_OPEN_APPENDSame as FA_OPEN_ALWAYS except read/write pointer is set end of the file.
+
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_NO_FILE, +FR_NO_PATH, +FR_INVALID_NAME, +FR_DENIED, +FR_EXIST, +FR_INVALID_OBJECT, +FR_WRITE_PROTECTED, +FR_INVALID_DRIVE, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT, +FR_LOCKED, +FR_NOT_ENOUGH_CORE, +FR_TOO_MANY_OPEN_FILES +

+
+ + +
+

Description

+

Before using any file function, a work area (file system object) needs to be registered to the logical drive with f_mount function. All API functions except for f_mkfs/f_fdisk function get ready to work after this procedure.

+

After f_open function succeeded, the file object is valid. The file object is used for subsequent operations to the file to identify the file. Open file must be closed prior to power down, media removal or re-mount, or the file can be collapsed. To close an open file, use f_close function.

+

If duplicated file open is needed, read here carefully. However duplicated open of a file with any write mode flag is always prohibited.

+
+ + +
+

QuickInfo

+

Always available. Only FA_READ and FA_OPEN_EXISTING are supported when _FS_READONLY == 1.

+
+ + +
+

Example

+
+/* Read a text file and display it */
+
+FATFS FatFs;   /* Work area (file system object) for logical drive */
+
+int main (void)
+{
+    FIL fil;       /* File object */
+    char line[82]; /* Line buffer */
+    FRESULT fr;    /* FatFs return code */
+
+
+    /* Register work area to the default drive */
+    f_mount(&FatFs, "", 0);
+
+    /* Open a text file */
+    fr = f_open(&fil, "message.txt", FA_READ);
+    if (fr) return (int)fr;
+
+    /* Read all lines and display it */
+    while (f_gets(line, sizeof line, &fil))
+        printf(line);
+
+    /* Close the file */
+    f_close(&fil);
+
+    return 0;
+}
+
+
+/* Copy a file "file.bin" on the drive 1 to drive 0 */
+
+int main (void)
+{
+    FATFS fs[2];         /* Work area (file system object) for logical drives */
+    FIL fsrc, fdst;      /* File objects */
+    BYTE buffer[4096];   /* File copy buffer */
+    FRESULT fr;          /* FatFs function common result code */
+    UINT br, bw;         /* File read/write count */
+
+
+    /* Register work area for each logical drive */
+    f_mount(&fs[0], "0:", 0);
+    f_mount(&fs[1], "1:", 0);
+
+    /* Open source file on the drive 1 */
+    fr = f_open(&fsrc, "1:file.bin", FA_READ);
+    if (fr) return (int)fr;
+
+    /* Create destination file on the drive 0 */
+    fr = f_open(&fdst, "0:file.bin", FA_WRITE | FA_CREATE_ALWAYS);
+    if (fr) return (int)fr;
+
+    /* Copy source to destination */
+    for (;;) {
+        fr = f_read(&fsrc, buffer, sizeof buffer, &br);  /* Read a chunk of source file */
+        if (fr || br == 0) break; /* error or eof */
+        fr = f_write(&fdst, buffer, br, &bw);            /* Write it to the destination file */
+        if (fr || bw < br) break; /* error or disk full */
+    }
+
+    /* Close open files */
+    f_close(&fsrc);
+    f_close(&fdst);
+
+    /* Unregister work area prior to discard it */
+    f_mount(NULL, "0:", 0);
+    f_mount(NULL, "1:", 0);
+
+    return (int)fr;
+}
+
+
+ + +
+

See Also

+

f_read, f_write, f_close, FIL, FATFS

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/opendir.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/opendir.html new file mode 100644 index 0000000..750cc67 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/opendir.html @@ -0,0 +1,75 @@ + + + + + + + + +FatFs - f_opendir + + + + +
+

f_opendir

+

The f_opendir function opens a directory.

+
+FRESULT f_opendir (
+  DIR* dp,           /* [OUT] Pointer to the directory object structure */
+  const TCHAR* path  /* [IN] Directory name */
+);
+
+
+ +
+

Parameters

+
+
dp
+
Pointer to the blank directory object to create a new one.
+
path
+
Pointer to the null-terminated string that specifies the directory name to be opened.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_NO_PATH, +FR_INVALID_NAME, +FR_INVALID_OBJECT, +FR_INVALID_DRIVE, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT, +FR_NOT_ENOUGH_CORE, +FR_TOO_MANY_OPEN_FILES +

+
+ + +
+

Description

+

The f_opendir function opens an exsisting directory and creates a directory object for subsequent f_readdir function.

+
+ + +
+

QuickInfo

+

Available when _FS_MINIMIZE <= 1.

+
+ + +
+

See Also

+

f_readdir, f_closedir, DIR

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/printf.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/printf.html new file mode 100644 index 0000000..f603052 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/printf.html @@ -0,0 +1,93 @@ + + + + + + + + +FatFs - f_printf + + + + +
+

f_printf

+

The f_printf function writes formatted string to the file.

+
+int f_printf (
+  FIL* fp,          /* [IN] File object */
+  const TCHAR* fmt, /* [IN] Format stirng */
+  ...
+);
+
+
+ +
+

Parameters

+
+
fp
+
Pointer to the open file object structure.
+
fmt
+
Pointer to the null terminated format string. The terminator charactor will not be written.
+
...
+
Optional arguments...
+ +
+
+ + +
+

Return Values

+

When the function succeeded, it returns number of characters written. If the function could not write the generated string to the file due to disk full or an error, EOF (-1) will be returned.

+
+ + +
+

Description

+

The format control directive is a sub-set of standard library shown as follos:

+ +
+ + +
+

QuickInfo

+

This is a wrapper function of f_write function. Available when _FS_READONLY == 0 and _USE_STRFUNC is 1 or 2. When it is set to 2, '\n's contained in the output are converted to '\r'+'\n'.

+

When FatFs is configured to Unicode API (_LFN_UNICODE == 1), data types on the srting fuctions, f_putc, f_puts, f_printf and f_gets function, is also switched to Unicode. The character encoding on the file to be read/written via those functions is selected by _STRF_ENCODE option.

+
+ + +
+

Example

+
+    f_printf(&fil, "%d", 1234);            /* "1234" */
+    f_printf(&fil, "%6d,%3d%%", -200, 5);  /* "  -200,  5%" */
+    f_printf(&fil, "%ld", 12345L);         /* "12345" */
+    f_printf(&fil, "%06d", 25);            /* "000025" */
+    f_printf(&fil, "%06d", -25);           /* "000-25" */
+    f_printf(&fil, "%-6d", 25);            /* "25    " */
+    f_printf(&fil, "%u", -1);              /* "65535" or "4294967295" */
+    f_printf(&fil, "%04x", 0xAB3);         /* "0ab3" */
+    f_printf(&fil, "%08LX", 0x123ABCL);    /* "00123ABC" */
+    f_printf(&fil, "%016b", 0x550F);       /* "0101010100001111" */
+    f_printf(&fil, "%s", "String");        /* "String" */
+    f_printf(&fil, "%8s", "abc");          /* "     abc" */
+    f_printf(&fil, "%-8s", "abc");         /* "abc     " */
+    f_printf(&fil, "%c", 'a');             /* "a" */
+    f_printf(&fil, "%f", 10.0);            /* f_printf lacks floating point support */
+
+
+ + +
+

See Also

+

f_open, f_putc, f_puts, f_gets, f_close, FIL

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/putc.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/putc.html new file mode 100644 index 0000000..5537669 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/putc.html @@ -0,0 +1,56 @@ + + + + + + + + +FatFs - f_putc + + + + +
+

f_putc

+

The f_putc funciton puts a character to the file.

+
+int f_putc (
+  TCHAR chr,  /* [IN] A character to put */
+  FIL* fp     /* [IN] File object */
+);
+
+
+ +
+

Parameters

+
+
chr
+
A character to be put.
+
fp
+
Pointer to the open file object structuer.
+
+
+ + +
+

Return Values

+

When the character was written successfuly, it returns number of characters written. When the function failed due to disk full or any error, an EOF (-1) will be returned.

+

When FatFs is configured to Unicode API (_LFN_UNICODE == 1), character encoding on the string fuctions, f_putc, f_puts, f_printf and f_gets function, is also switched to Unicode. The character encoding on the file to be read/written via those functions is selected by _STRF_ENCODE option.

+
+ + +
+

QuickInfo

+

This is a wrapper function of f_write function. Available when _FS_READONLY == 0 and _USE_STRFUNC is 1 or 2. When it is set to 2, a '\n' is converted to '\r'+'\n'.

+
+ + +
+

See Also

+

f_open, f_puts, f_printf, f_gets, f_close, FIL

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/puts.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/puts.html new file mode 100644 index 0000000..d737116 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/puts.html @@ -0,0 +1,56 @@ + + + + + + + + +FatFs - f_puts + + + + +
+

f_puts

+

The f_puts function writes a string to the file.

+
+int f_puts (
+  const TCHAR* str, /* [IN] String */
+  FIL* fp           /* [IN] File object */
+);
+
+
+ +
+

Parameters

+
+
str
+
Pointer to the null terminated string to be written. The terminator character will not be written.
+
fp
+
Pointer to the open file object structure.
+
+
+ + +
+

Return Value

+

When the function succeeded, it returns number of characters written. When the write operation is aborted due to disk full or any error, an EOF (-1) will be returned.

+

When FatFs is configured to Unicode API (_LFN_UNICODE == 1), character encoding on the srting fuctions, f_putc, f_puts, f_printf and f_gets function, is also switched to Unicode. The character encoding on the file to be read/written via those functions is selected by _STRF_ENCODE option.

+
+ + +
+

QuickInfo

+

This is a wrapper function of f_write function. Available when _FS_READONLY == 0 and _USE_STRFUNC is 1 or 2. When it is set to 2, '\n's contained in the string are converted to '\r'+'\n'.

+
+ + +
+

See Also

+

f_open, f_putc, f_printf, f_gets, f_close, FIL

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/rc.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/rc.html new file mode 100644 index 0000000..81e801d --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/rc.html @@ -0,0 +1,116 @@ + + + + + + + + +FatFs - API Return Code + + + +

Return Code of API Functions

+

Most of API functions return common result code as enum type FRESULT. When an API function succeeded, it returns zero (FR_OK), otherwise it returns non-zero value indicates type of error.

+ +
+ +
FR_OK (0)
+
The function succeeded.
+ +
FR_DISK_ERR
+
An unrecoverable hard error occured in the lower layer, disk_read, disk_write or disk_ioctl function.
Note that if once this error occured at any operation to an open file, the file object is aborted and all operations to the file except for close will be rejected.
+ +
FR_INT_ERR
+
Assertion failed. An insanity is detected in the internal process. One of the following possibilities is suspected. +
    +
  • Work area (file system object, file object or etc...) has been broken by stack overflow or any other tasks. This is the reason in most case.
  • +
  • There is an error of the FAT structure on the volume.
  • +
  • There is a bug in the FatFs module itself.
  • +
+Note that if once this error occured at any operation to an open file, the file object is aborted and all operations to the file except for close will be rejected. +
+ +
FR_NOT_READY
+
The storage device cannot work due to a failure of disk_initialize function due to no medium or any other reason.
+ +
FR_NO_FILE
+
Could not find the file.
+ +
FR_NO_PATH
+
Could not find the path.
+ +
FR_INVALID_NAME
+
The given string is invalid as the path name.
+ +
FR_DENIED
+
The required access was denied due to one of the following reasons: +
    +
  • Write mode open against the read-only file.
  • +
  • Deleting the read-only file or directory.
  • +
  • Deleting the non-empty directory or current directory.
  • +
  • Reading the file opened without FA_READ flag.
  • +
  • Any modification to the file opened without FA_WRITE flag.
  • +
  • Could not create the object due to root directory full or disk full.
  • +
  • Could not allocate a contiguous area to the file.
  • +
+
+ +
FR_EXIST
+
Name collision. An object with the same name is already existing.
+ +
FR_INVALID_OBJECT
+
The file/directory object is invalid or a null pointer is given. There are some reasons as follows: +
    +
  • It has been closed, it has not been opened or it has been collapsed.
  • +
  • It has been invalidated by a voulme mount process. Open objects on the volume are invalidated by voulme mount process.
  • +
  • Physical drive is not ready to work due to a media removal.
  • +
+
+ +
FR_WRITE_PROTECTED
+
A write mode operation against the write-protected media.
+ +
FR_INVALID_DRIVE
+
Invalid drive number is specified in the path name. A null pointer is given as the path name. (Related option: _VOLUMES)
+ +
FR_NOT_ENABLED
+
Work area for the logical drive has not been registered by f_mount function.
+ +
FR_NO_FILESYSTEM
+
There is no valid FAT volume on the drive.
+ +
FR_MKFS_ABORTED
+
The f_mkfs function aborted before start in format due to a reason as follows: +
    +
  • It is pmpossible to formart with the given parameters.
  • +
  • The size of volume is too small.
  • +
  • The size of given work area is too small.
  • +
  • The partition bound to the logical drive coulud not be found. (Related option: _MULTI_PARTITION)
  • +
+
+ +
FR_TIMEOUT
+
The function was canceled due to a timeout of thread-safe control. (Related option: _TIMEOUT)
+ +
FR_LOCKED
+
The operation to the object was rejected by file sharing control. (Related option: _FS_LOCK)
+ +
FR_NOT_ENOUGH_CORE
+
Not enough memory for the operation. There is one of the following reasons: +
    +
  • Could not allocate a memory for LFN working buffer. (Related option: _USE_LFN)
  • +
  • Size of the given buffer is insufficient for the size required.
  • +
+
+ +
FR_TOO_MANY_OPEN_FILES
+
Number of open objects has been reached maximum value and no more object can be opened. (Related option: _FS_LOCK)
+ +
FR_INVALID_PARAMETER
+
The given parameter is invalid or there is an inconsistent for the volume.
+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/read.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/read.html new file mode 100644 index 0000000..2d5b397 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/read.html @@ -0,0 +1,73 @@ + + + + + + + + +FatFs - f_read + + + + +
+

f_read

+

The f_read function reads data from a file.

+
+FRESULT f_read (
+  FIL* fp,     /* [IN] File object */
+  void* buff,  /* [OUT] Buffer to store read data */
+  UINT btr,    /* [IN] Number of bytes to read */
+  UINT* br     /* [OUT] Number of bytes read */
+);
+
+
+ +
+

Parameters

+
+
fp
+
Pointer to the open file object.
+
buff
+
Pointer to the buffer to store read data.
+
btr
+
Number of bytes to read in range of UINT type.
+
br
+
Pointer to the UINT variable to return number of bytes read. The value is always valid after the function call regardless of the result code.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_INVALID_OBJECT, +FR_TIMEOUT +

+
+ + +
+

Description

+

The function starts to read data from the file at the position pointed by the read/write pointer. The read/write pointer advances as number of bytes read. After the function succeeded, *br should be checked to detect end of the file. In case of *br < btr, it means the read/write pointer reached end of the file during read operation.

+
+ + +
+

QuickInfo

+

Always available.

+
+ + +
+

See Also

+

f_open, fgets, f_write, f_close, FIL

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/readdir.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/readdir.html new file mode 100644 index 0000000..9c891d3 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/readdir.html @@ -0,0 +1,129 @@ + + + + + + + + +FatFs - f_readdir + + + + +
+

f_readdir

+

The f_readdir function reads an item of the directory.

+
+FRESULT f_readdir (
+  DIR* dp,      /* [IN] Directory object */
+  FILINFO* fno  /* [OUT] File information structure */
+);
+
+
+ +
+

Parameters

+
+
dp
+
Pointer to the open directory object or null pointer.
+
fno
+
Pointer to the file information structure to store the information about read item.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_INVALID_OBJECT, +FR_TIMEOUT, +FR_NOT_ENOUGH_CORE +

+
+ + +
+

Description

+

The f_readdir function reads a directory item, informations about the object. All items in the directory can be read in sequence by f_readdir function calls. Dot entries ("." and "..") in the sub-directory are filtered out and they will never appear in the read items. When all directory items have been read and no item to read, a nul string is stored into the fno->fname[] without any error. When a null pointer is given to the fno, the read index of the directory object is rewinded.

+

When support of long file name (LFN) is enabled, a member altname[] is defined in the file information structure to store the short file name of the object. In case of the some conditions listed below, short file name is stored into the fname[] and altname[] has a null string.

+ +

There is a problem on reading a directory of exFAT volume. The exFAT does not support short file name. This means no name can be returned on the condition above. If it is the case, a "?" is returned as file name to indicate that the object is not accessible. To avoid this problem, configure FatFs _LFN_UNICODE = 1 and _MAX_LFN = 255 to support the full feature of LFN specification.

+
+ + +
+

QuickInfo

+

Available when _FS_MINIMIZE <= 1.

+
+ + +
+

Sample Code

+
+FRESULT scan_files (
+    char* path        /* Start node to be scanned (***also used as work area***) */
+)
+{
+    FRESULT res;
+    DIR dir;
+    UINT i;
+    static FILINFO fno;
+
+
+    res = f_opendir(&dir, path);                       /* Open the directory */
+    if (res == FR_OK) {
+        for (;;) {
+            res = f_readdir(&dir, &fno);                   /* Read a directory item */
+            if (res != FR_OK || fno.fname[0] == 0) break;  /* Break on error or end of dir */
+            if (fno.fattrib & AM_DIR) {                    /* It is a directory */
+                i = strlen(path);
+                sprintf(&path[i], "/%s", fno.fname);
+                res = scan_files(path);                    /* Enter the directory */
+                if (res != FR_OK) break;
+                path[i] = 0;
+            } else {                                       /* It is a file. */
+                printf("%s/%s\n", path, fno.fname);
+            }
+        }
+        f_closedir(&dir)
+    }
+
+    return res;
+}
+
+
+int main (void)
+{
+    FATFS fs;
+    FRESULT res;
+    char buff[256];
+
+
+    res = f_mount(&fs, "", 1);
+    if (res == FR_OK) {
+        strcpy(buff, "/");
+        res = scan_files(buff);
+    }
+
+    return res;
+}
+
+
+ + +
+

See Also

+

f_opendir, f_closedir, f_stat, FILINFO, DIR

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/rename.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/rename.html new file mode 100644 index 0000000..c172a74 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/rename.html @@ -0,0 +1,88 @@ + + + + + + + + +FatFs - f_rename + + + + +
+

f_rename

+

The f_rename function renames and/or moves a file or sub-directory.

+
+FRESULT f_rename (
+  const TCHAR* old_name, /* [IN] Old object name */
+  const TCHAR* new_name  /* [IN] New object name */
+);
+
+
+ +
+

Parameters

+
+
old_name
+
Pointer to a null-terminated string that specifies the existing file or sub-directory to be renamed.
+
new_name
+
Pointer to a null-terminated string that specifies the new object name. A drive number may be specified in this string but it is ignored and assumed as the same drive of the old_name. Any object with this path name except old_name must not be exist, or the function fails with FR_EXIST.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_NO_FILE, +FR_NO_PATH, +FR_INVALID_NAME, +FR_DENIED, +FR_EXIST, +FR_WRITE_PROTECTED, +FR_INVALID_DRIVE, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT, +FR_LOCKED, +FR_NOT_ENOUGH_CORE +

+
+ + +
+

Description

+

Renames a file or sub-directory and can also move it to other directory in the same volume. The object to be renamed must not be an open object, or the FAT volume can be collapsed. Such the wrong operation is rejected safely when file lock function is enabled.

+
+ + +
+

QuickInfo

+

Available when _FS_READONLY == 0 and _FS_MINIMIZE == 0.

+
+ + +
+

Example

+
+    /* Rename an object in the default drive */
+    f_rename("oldname.txt", "newname.txt");
+
+    /* Rename an object in the drive 2 */
+    f_rename("2:oldname.txt", "newname.txt");
+
+    /* Rename an object and move it to other directory in the volume */
+    f_rename("log.txt", "old/log0001.txt");
+
+
+ + +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/sdir.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/sdir.html new file mode 100644 index 0000000..7599ab6 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/sdir.html @@ -0,0 +1,38 @@ + + + + + + + + +FatFs - DIR + + + + +
+

DIR

+

The DIR structure is used for the work area to read a directory by f_oepndir, f_readdir, f_findfirst and f_findnext function. Application program must not modify any member in this structure, or any data on the FAT volume can be collapsed.

+
+typedef struct {
+    _FDID   obj;        /* Owner file sytem object and object identifier */
+    DWORD   dptr;       /* Current read/write offset */
+    DWORD   clust;      /* Current cluster */
+    DWORD   sect;       /* Current sector */
+    BYTE*   dir;        /* Pointer to the current SFN entry in the win[] */
+    BYTE*   fn;         /* Pointer to the SFN buffer (in/out) {file[8],ext[3],status[1]} */
+#if _USE_LFN
+    DWORD   blk_ofs;    /* Offset of the entry block (0xFFFFFFFF:Invalid) */
+    WCHAR*  lfn;        /* Pointer to the LFN working buffer (in/out) */
+#endif
+#if _USE_FIND
+    const TCHAR*  pat;  /* Ponter to the matching pattern */
+#endif
+} DIR;
+
+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/setlabel.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/setlabel.html new file mode 100644 index 0000000..8184d04 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/setlabel.html @@ -0,0 +1,91 @@ + + + + + + + + +FatFs - f_setlabel + + + + +
+

f_setlabel

+

The f_setlabel function sets/removes the label of a volume.

+
+FRESULT f_setlabel (
+  const TCHAR* label  /* [IN] Volume label to be set */
+);
+
+
+ +
+

Parameters

+
+
label
+
Pointer to the null-terminated string that specifies the volume label to be set.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_INVALID_NAME, +FR_WRITE_PROTECTED, +FR_INVALID_DRIVE, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT +

+
+ + +
+

Description

+

When the string has a drive number, the volume label will be set to the volume specified by the drive number. If not, the volume label will be set to the default drive. If length of the given volume label is zero, the volume label on the volume will be removed. The format of the volume label on the FAT volume is similar to the file name but there are some differences shown below:

+ +

Remark: The standard system (Windows) has a problem at handling of the volume label with a heading \xE5 on the FAT volume. To avoid this problem, this function rejects such volume label as invalid name.

+
+ +
+

QuickInfo

+

Available when _FS_READONLY == 0 and _USE_LABEL == 1.

+
+ + +
+

Example

+
+    /* Set volume label to the default drive */
+    f_setlabel("DATA DISK");
+
+    /* Set volume label to the drive 2 */
+    f_setlabel("2:DISK 3 OF 4");
+
+    /* Remove volume label of the drive 2 */
+    f_setlabel("2:");
+
+
+ + +
+

See Also

+f_getlabel +
+ + +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/sfatfs.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/sfatfs.html new file mode 100644 index 0000000..6241397 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/sfatfs.html @@ -0,0 +1,62 @@ + + + + + + + + +FatFs - FATFS + + + + +
+

FATFS

+

The FATFS structure (file system object) holds dynamic work area of individual logical drives. It is given by application program and registerd/unregisterd to the FatFs module with f_mount function. Initialization is done on first API call after f_mount function or media change. Application program must not modify any member in this structure, or any data on the FAT volume can be collapsed.

+
+typedef struct {
+    BYTE    fs_type;      /* File system type (0, FS_FAT12, FS_FAT16, FS_FAT32 or FS_EXFAT) */
+    BYTE    drv;          /* Physical drive number */
+    BYTE    n_fats;       /* Number of FAT copies (1,2) */
+    BYTE    wflag;        /* win[] flag (b0:win[] is dirty) */
+    BYTE    fsi_flag;     /* FSINFO flags (b7:Disabled, b0:Dirty) */
+    WORD    id;           /* File system mount ID */
+    WORD    n_rootdir;    /* Number of root directory entries (FAT12/16) */
+    WORD    csize;        /* Sectors per cluster */
+#if _MAX_SS != _MIN_SS
+    WORD    ssize;        /* Sector size (512,1024,2048 or 4096) */
+#endif
+#if _FS_EXFAT
+    BYTE*   dirbuf;       /* Directory entry block scratchpad buffer */
+#endif
+#if _FS_REENTRANT
+    _SYNC_t sobj;         /* Identifier of sync object */
+#endif
+#if !_FS_READONLY
+    DWORD   last_clust;   /* FSINFO: Last allocated cluster (0xFFFFFFFF if invalid) */
+    DWORD   free_clust;   /* FSINFO: Number of free clusters (0xFFFFFFFF if invalid) */
+#endif
+#if _FS_RPATH
+    DWORD   cdir;         /* Cluster number of current directory (0:root) */
+#if _FS_EXFAT
+    DWORD   cdc_scl;      /* Containing directory start cluster (invalid when cdir is 0) */
+    DWORD   cdc_size;     /* b31-b8:Size of containing directory, b7-b0: Chain status */
+    DWORD   cdc_ofs;      /* Offset in the containing directory (invalid when cdir is 0) */
+#endif
+#endif
+    DWORD   n_fatent;     /* Number of FAT entries (Number of clusters + 2) */
+    DWORD   fsize;        /* Sectors per FAT */
+    DWORD   volbase;      /* Volume base LBA */
+    DWORD   fatbase;      /* FAT base LBA */
+    DWORD   dirbase;      /* Root directory base (LBA|Cluster) */
+    DWORD   database;     /* Data base LBA */
+    DWORD   winsect;      /* Sector LBA appearing in the win[] */
+    BYTE    win[_MAX_SS]; /* Disk access window for directory, FAT (and file data at tiny cfg) */
+} FATFS;
+
+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/sfile.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/sfile.html new file mode 100644 index 0000000..b1274c0 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/sfile.html @@ -0,0 +1,43 @@ + + + + + + + + +FatFs - FIL + + + + +
+

FIL

+

The FIL structure (file object) holds the state of an open file. It is created by f_open function and discarded by f_close function. Application program must not modify any member in this structure except for cltbl, or any data on the FAT volume can be collapsed. Note that a sector buffer is defined in this structure at non-tiny configuration (_FS_TINY == 0), so that the FIL structures at that configuration should not be defined as auto variable.

+ +
+typedef struct {
+    _FDID   obj;          /* Owner file sytem object and object identifier */
+    BYTE    flag;         /* File object status flags */
+    BYTE    err;          /* Abort flag (error code) */
+    FSIZE_t fptr;         /* File read/write pointer (Byte offset origin from top of the file) */
+    DWORD   clust;        /* Current cluster of fptr (One cluster behind if fptr is on the cluster boundary. Invalid if fptr == 0.) */
+    DWORD   sect;         /* Current data sector (Can be invalid if fptr is on the cluster boundary.)*/
+#if !_FS_READONLY
+    DWORD   dir_sect;     /* Sector number containing the directory entry */
+    BYTE*   dir_ptr;      /* Ponter to the directory entry in the window */
+#endif
+#if _USE_FASTSEEK
+    DWORD*  cltbl;        /* Pointer to the cluster link map table (Nulled on file open. Set by application.) */
+#endif
+#if !_FS_TINY
+    BYTE    buf[_MAX_SS]; /* File private data transfer buffer (Always valid if fptr is not on the sector boundary but can be invalid if fptr is on the sector boundary.) */
+#endif
+} FIL;
+
+ +
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/sfileinfo.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/sfileinfo.html new file mode 100644 index 0000000..2439317 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/sfileinfo.html @@ -0,0 +1,69 @@ + + + + + + + + +FatFs - FILINFO + + + + +
+

FILINFO

+

The FILINFO structure holds information about the object returned by f_readdir, f_findfirst, f_findnext and f_stat function.

+
+typedef struct {
+    FSIZE_t fsize;               /* File size */
+    WORD    fdate;               /* Last modified date */
+    WORD    ftime;               /* Last modified time */
+    BYTE    fattrib;             /* Attribute */
+#if _USE_LFN != 0
+    TCHAR   altname[13];         /* Alternative object name */
+    TCHAR   fname[_MAX_LFN + 1]; /* Primary object name */
+#else
+    TCHAR   fname[13];           /* Object name */
+#endif
+} FILINFO;
+
+
+ +

Members

+
+
fsize
+
Indicates size of the file in unit of byte. FSIZE_t is an alias of integer type either DWORD(32-bit) or QWORD(64-bit) depends on the configuration option _FS_EXFAT. Do not care when the item is a directory.
+
fdate
+
Indicates the date when the file was modified or the directory was created.
+
+
bit15:9
+
Year origin from 1980 (0..127)
+
bit8:5
+
Month (1..12)
+
bit4:0
+
Day (1..31)
+
+
+
ftime
+
Indicates the time when the file was modified or the directory was created.
+
+
bit15:11
+
Hour (0..23)
+
bit10:5
+
Minute (0..59)
+
bit4:0
+
Second / 2 (0..29)
+
+
+
fattrib
+
Indicates the file/directory attribute in combination of AM_DIR, AM_RDO, AM_HID, AM_SYS and AM_ARC.
+
fname[]
+
The null-terminated object name is stored. A null string is stored when no item to read and it indicates this structure is invalid.
+
altname[]
+
Alternative object name is stored if available. This member is not available at non-LFN configuration.
+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/size.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/size.html new file mode 100644 index 0000000..8e2a105 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/size.html @@ -0,0 +1,62 @@ + + + + + + + + +FatFs - f_size + + + + +
+

f_size

+

The f_size function gets the size of a file.

+
+FSIZE_t f_size (
+  FIL* fp   /* [IN] File object */
+);
+
+
+ + +
+

Parameters

+
+
fp
+
Pointer to the open file object structure.
+
+
+ + +
+

Return Values

+

Returns the size of the file in unit of byte.

+
+ + +
+

Description

+

In this revision, the f_size function is implemented as a macro. It does not have any validation and mutual exclusion.

+
+#define f_size(fp) ((fp)->obj.objsize)
+
+
+ + +
+

QuickInfo

+

Always available.

+
+ + +
+

See Also

+

f_open, f_lseek, FIL

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/stat.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/stat.html new file mode 100644 index 0000000..22349a4 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/stat.html @@ -0,0 +1,110 @@ + + + + + + + + +FatFs - f_stat + + + + +
+

f_stat

+

The f_stat function checks the existence of a file or sub-directory.

+
+FRESULT f_stat (
+  const TCHAR* path,  /* [IN] Object name */
+  FILINFO* fno        /* [OUT] FILINFO structure */
+);
+
+
+ +
+

Parameters

+
+
path
+
Pointer to the null-terminated string that specifies the object to get its information.
+
fno
+
Pointer to the blank FILINFO structure to store the information of the object. Set null pointer if it is not needed.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_NO_FILE, +FR_NO_PATH, +FR_INVALID_NAME, +FR_INVALID_DRIVE, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT, +FR_NOT_ENOUGH_CORE +

+
+ + +
+

Description

+

The f_stat function checks the existence of a file or sub-directory. If not exist, the function returns with FR_NO_FILE. If exist, the function returns with FR_OK and the informations of the object, file size, timestamp and attribute, are stored to the file information structure. For details of the file information, refer to the FILINFO structure and f_readdir function.

+
+ + +
+

QuickInfo

+

Available when _FS_MINIMIZE == 0.

+
+ + +
+

Example

+
+    FRESULT fr;
+    FILINFO fno;
+
+
+    printf("Test for 'file.txt'...\n");
+
+    fr = f_stat("file.txt", &fno);
+    switch (fr) {
+
+    case FR_OK:
+        printf("Size: %lu\n", fno.fsize);
+        printf("Timestamp: %u/%02u/%02u, %02u:%02u\n",
+               (fno.fdate >> 9) + 1980, fno.fdate >> 5 & 15, fno.fdate & 31,
+               fno.ftime >> 11, fno.ftime >> 5 & 63);
+        printf("Attributes: %c%c%c%c%c\n",
+               (fno.fattrib & AM_DIR) ? 'D' : '-',
+               (fno.fattrib & AM_RDO) ? 'R' : '-',
+               (fno.fattrib & AM_HID) ? 'H' : '-',
+               (fno.fattrib & AM_SYS) ? 'S' : '-',
+               (fno.fattrib & AM_ARC) ? 'A' : '-');
+        break;
+
+    case FR_NO_FILE:
+        printf("It is not exist.\n");
+        break;
+
+    default:
+        printf("An error occured. (%d)\n", fr);
+    }
+
+
+ + +
+

References

+

f_opendir, f_readdir, FILINFO

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/sync.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/sync.html new file mode 100644 index 0000000..ee8c535 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/sync.html @@ -0,0 +1,65 @@ + + + + + + + + +FatFs - f_sync + + + + +
+

f_sync

+

The f_sync function flushes the cached information of a writing file.

+
+FRESULT f_sync (
+  FIL* fp     /* [IN] File object */
+);
+
+
+ +
+

Parameter

+
+
fp
+
Pointer to the open file object to be flushed.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_INVALID_OBJECT, +FR_TIMEOUT +

+
+ + +
+

Description

+

The f_sync function performs the same process as f_close function but the file is left opened and can continue read/write/seek operations to the file. This is suitable for the applications that open files for a long time in write mode, such as data logger. Performing f_sync function of periodic or immediataly after f_write function can minimize the risk of data loss due to a sudden blackout or an unintentional media removal. For more information, refer to application note.

+

However there is no sense in f_sync function immediataly before f_close function because it performs f_sync function in it. In other words, the differnce between those functions is that the file object is invalidated or not.

+
+ + +
+

QuickInfo

+

Available when _FS_READONLY == 0.

+
+ + +
+

See Also

+

f_close

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/tell.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/tell.html new file mode 100644 index 0000000..03844ef --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/tell.html @@ -0,0 +1,62 @@ + + + + + + + + +FatFs - f_tell + + + + +
+

f_tell

+

The f_tell function gets the current read/write pointer of a file.

+
+FSIZE_t f_tell (
+  FIL* fp   /* [IN] File object */
+);
+
+
+ + +
+

Parameters

+
+
fp
+
Pointer to the open file object structure.
+
+
+ + +
+

Return Values

+

Returns current read/write pointer of the file.

+
+ + +
+

Description

+

In this revision, the f_tell function is implemented as a macro. It does not have any validation and mutual exclusion.

+
+#define f_tell(fp) ((fp)->fptr)
+
+
+ + +
+

QuickInfo

+

Always available.

+
+ + +
+

See Also

+

f_open, f_lseek, FIL

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/truncate.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/truncate.html new file mode 100644 index 0000000..3511f7f --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/truncate.html @@ -0,0 +1,66 @@ + + + + + + + + +FatFs - f_truncate + + + + +
+

f_truncate

+

The f_truncate function truncates the file size.

+
+FRESULT f_truncate (
+  FIL* fp     /* [IN] File object */
+);
+
+
+ +
+

Parameter

+
+
fp
+
Pointer to the open file object to be truncated.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_DENIED, +FR_INVALID_OBJECT, +FR_TIMEOUT +

+
+ + +
+

Description

+

The f_truncate function truncates the file size to the current file read/write pointer. This function has no effect if the file read/write pointer is already pointing end of the file.

+
+ + +
+

QuickInfo

+

Available when _FS_READONLY == 0 and _FS_MINIMIZE == 0.

+
+ + +
+

See Also

+

f_open, f_lseek, FIL

+
+ + +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/unlink.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/unlink.html new file mode 100644 index 0000000..c765783 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/unlink.html @@ -0,0 +1,75 @@ + + + + + + + + +FatFs - f_unlink + + + + +
+

f_unlink

+

The f_unlink function removes a file or sub-directory.

+
+FRESULT f_unlink (
+  const TCHAR* path  /* [IN] Object name */
+);
+
+
+ +
+

Parameter

+
+
path
+
Pointer to a null-terminated string that specifies the file or sub-directory to be removed.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_NO_FILE, +FR_NO_PATH, +FR_INVALID_NAME, +FR_DENIED, +FR_EXIST, +FR_WRITE_PROTECTED, +FR_INVALID_DRIVE, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT, +FR_LOCKED, +FR_NOT_ENOUGH_CORE +

+
+ + +
+

Description

+

+If condition of the object to be removed is applicable to the following terms, the function will be rejected.

+
+ + +
+

QuickInfo

+

Available when _FS_READONLY == 0 and _FS_MINIMIZE == 0.

+
+ + +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/utime.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/utime.html new file mode 100644 index 0000000..ec54b65 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/utime.html @@ -0,0 +1,99 @@ + + + + + + + + +FatFs - f_utime + + + + +
+

f_utime

+

The f_utime function changes the timestamp of a file or sub-directory.

+
+FRESULT f_utime (
+  const TCHAR* path,  /* [IN] Object name */
+  const FILINFO* fno  /* [IN] Time and data to be set */
+);
+
+
+ +
+

Parameters

+
+
path
+
Pointer to the null-terminated string that specifies an object to be changed.
+
fno
+
Pointer to the file information structure that has a timestamp to be set in member fdate and ftime. Do not care any other members.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_NO_FILE, +FR_NO_PATH, +FR_INVALID_NAME, +FR_WRITE_PROTECTED, +FR_INVALID_DRIVE, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT, +FR_NOT_ENOUGH_CORE +

+
+ + +
+

Description

+

The f_utime function changes the timestamp of a file or sub-directory

+
+ + +
+

Example

+
+FRESULT set_timestamp (
+    char *obj,     /* Pointer to the file name */
+    int year,
+    int month,
+    int mday,
+    int hour,
+    int min,
+    int sec
+)
+{
+    FILINFO fno;
+
+    fno.fdate = (WORD)(((year - 1980) * 512U) | month * 32U | mday);
+    fno.ftime = (WORD)(hour * 2048U | min * 32U | sec / 2U);
+
+    return f_utime(obj, &fno);
+}
+
+
+ + +
+

QuickInfo

+

Available when _FS_READONLY == 0 and _USE_CHMOD == 1.

+
+ + +
+

See Also

+

f_stat, FILINFO

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/write.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/write.html new file mode 100644 index 0000000..48ef4ad --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/write.html @@ -0,0 +1,73 @@ + + + + + + + + +FatFs - f_write + + + + +
+

f_write

+

The f_write writes data to a file.

+
+FRESULT f_write (
+  FIL* fp,          /* [IN] Pointer to the file object structure */
+  const void* buff, /* [IN] Pointer to the data to be written */
+  UINT btw,         /* [IN] Number of bytes to write */
+  UINT* bw          /* [OUT] Pointer to the variable to return number of bytes written */
+);
+
+
+ +
+

Parameters

+
+
fp
+
Pointer to the open file object structure.
+
buff
+
Pointer to the data to be written.
+
btw
+
Specifies number of bytes to write in range of UINT type.
+
bw
+
Pointer to the UINT variable to return the number of bytes written. The value is always valid after the function call regardless of the result code.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_INVALID_OBJECT, +FR_TIMEOUT +

+
+ + +
+

Description

+

The function starts to write data to the file at the position pointed by the read/write pointer. The read/write pointer advances as number of bytes written. After the function succeeded, *bw should be checked to detect the disk full. In case of *bw < btw, it means the volume got full during the write operation. The function can take a time when the volume is full or close to full.

+
+ + +
+

QuickInfo

+

Available when _FS_READONLY == 0.

+
+ + +
+

See Also

+

f_open, f_read, fputc, fputs, fprintf, f_close, FIL

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/appnote.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/appnote.html new file mode 100644 index 0000000..06cd95e --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/appnote.html @@ -0,0 +1,283 @@ + + + + + + + + +FatFsモジュール アプリケーション ノート + + + +

FatFsモジュール アプリケーション ノート

+
    +
  1. ポーティングの際に配慮すべきこと
  2. +
  3. 限界値
  4. +
  5. メモリ使用量
  6. +
  7. モジュール サイズの縮小
  8. +
  9. 長いファイル名
  10. +
  11. exFATファイルシステム
  12. +
  13. Unicode入出力への対応
  14. +
  15. リエントランシー
  16. +
  17. 多重ファイル アクセス
  18. +
  19. 効率的なファイル アクセス
  20. +
  21. フラッシュ メモリの特性への配慮
  22. +
  23. クリチカル セクション
  24. +
  25. APIの拡張的使用例
  26. +
  27. FatFsのライセンスについて
  28. +
+ +
+

ポーティングの際に配慮すべきこと

+ +

ポーティングの際の前提条件

+

FatFsモジュールはポータビリティに関して次の点を前提としています。

+ + +

システム構成

+

下に示す依存関係図は、FatFsモジュール利用の組み込みシステムにおける代表的な構成を示します。

+

システム構成図

+

(a) FatFs用に書かれたディスク モジュールがある場合は、そのまま追加するだけです。 (b) しかし、多くの既存のディスク モジュールはそのAPIをFatFsに合わせるため、グルー関数が必要になるでしょう。

+

functional diagram

+ +

ユーザの作成する関数

+

ポーティング作業は、要求されるデバイス制御関数を用意することが全てで、それ以外にすることは何もありません。既に動作しているデバイス制御モジュールがあるなら、そのインターフェースをFatFsに合わせるかグルー関数を介してつなぐだけで済みますが、無い場合はほかから移植するか最初から書くかする必要があります。定義されている全ての関数が常に必要なわけではありません。例えば、リード オンリ構成では書き込み系関数は必要ありません。次の表に構成オプションと要求される関数の対応を示します。

+ + + + + + + + + + +
必要な関数必要となる条件備考
disk_status
disk_initialize
disk_read
常時ffsample.zip (サンプル)
その他web上に多数
disk_write
get_fattime
disk_ioctl (CTRL_SYNC)
_FS_READONLY == 0
disk_ioctl (GET_SECTOR_COUNT)
disk_ioctl (GET_BLOCK_SIZE)
_USE_MKFS == 1
disk_ioctl (GET_SECTOR_SIZE)_MAX_SS != _MIN_SS
disk_ioctl (CTRL_TRIM)_USE_TRIM == 1
ff_convert
ff_wtoupper
_USE_LFN != 0option/unicode.cをプロジェクトに
加えればよい
ff_cre_syncobj
ff_rel_grant
ff_req_grant
ff_del_syncobj
_FS_REENTRANT == 1option/syscall.c (サンプル)
ff_mem_alloc
ff_mem_free
_USE_LFN == 3
+
+ +
+

限界値

+ +
+ +
+

メモリ使用量

+

次の表にいくつかのターゲットにおけるメモリ使用量の例を示します。テスト時の構成オプションはその下の通りです。数値の単位はバイトで、Vはボリューム数、Fは同時オープン ファイル数を示します。コンパイラの最適化オプションはコード サイズとしています。

+ + + + + + + + + + + +
ARM7
32bit
ARM7
Thumb
CM3
Thumb-2
AVRH8/300HPIC24RL78V850ESSH-2ARX600IA-32
CompilerGCCGCCGCCGCCCH38C30CC78K0RCA850SHCRXCMSC
text (Full, R/W)10.4k6.8k6.3k12.4k 9.8k11.1k12.8k8.6k8.9k6.4k8.5k
text (Min, R/W) 6.8k4.6k4.3k 8.2k 6.7k 7.6k 9.1k6.0k5.9k4.5k5.9k
text (Full, R/O) 4.8k3.1k2.8k 5.6k 4.6k 5.3k 6.3k4.0k3.9k3.0k3.9k
text (Min, R/O) 3.6k2.4k2.3k 4.4k 3.5k 4.0k 4.9k3.3k3.0k2.4k3.1k
bssV*4 + 2V*4 + 2V*4 + 2V*2 + 2V*4 + 2V*2 + 2V*2 + 2V*4 + 2V*4 + 2V*4 + 2V*4 + 2
Work area
(_FS_TINY == 0)
V*564
+ F*552
V*564
+ F*552
V*564
+ F*552
V*560
+ F*546
V*560
+ F*546
V*560
+ F*546
V*560
+ F*546
V*564
+ F*552
V*564
+ F*552
V*564
+ F*552
V*564
+ F*552
Work area
(_FS_TINY == 1)
V*564
+ F*40
V*564
+ F*40
V*564
+ F*40
V*560
+ F*34
V*560
+ F*34
V*560
+ F*34
V*560
+ F*34
V*564
+ F*40
V*564
+ F*40
V*564
+ F*40
V*564
+ F*40
+
+FatFs R0.12b options:
+_FS_READONLY   0 (R/W) or 1 (R/O)
+_FS_MINIMIZE   0 (Full, with all basic functions) or 3 (Min, with fully minimized)
+_FS_TINY       0 (Default) or 1 (Tiny file object)
+And any other options are left not changed from default setting.
+
+
+ +
+

モジュール サイズの縮小

+

次の表は構成オプションの設定値によりどの機能が削除されるかを示します。API関数の行にxが無ければその関数は使用可能です。

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Function_FS_
MINIMIZE
_FS_
READONLY
_USE_
STRFUNC
_FS_
RPATH
_USE_
FIND
_USE_
CHMOD
_USE_
EXPAND
_USE_
LABEL
_USE_
MKFS
_USE_
FORWARD
_MULTI_
PARTITION
0123010101201010101010101
f_mount
f_open
f_close
f_read
f_write x
f_sync x
f_lseek x
f_opendir xx
f_closedir xx
f_readdir xx
f_findfirst xx x
f_findnext xx x
f_stat xxx
f_getfree xxx x
f_truncate xxx x
f_unlink xxx x
f_mkdir xxx x
f_rename xxx x
f_chdir x
f_chdrive x
f_getcwd xx
f_chmod x x
f_utime x x
f_getlabel x
f_setlabel x x
f_expand x x
f_forward x
f_mkfs x x
f_fdisk x x x
f_putc xx
f_puts xx
f_printf xx
f_gets x
+
+ +
+

長いファイル名

+

FatFsモジュールは、長いファイル名(LFN)をサポートします。ファイルに付けられた2つの異なる名前(短いファル名と長いファイル名)は、f_readdir関数を除くファイル操作関数において透過です。デフォルト構成では、LFN機能はOFFになっています。LFN機能を有効にするには、_USE_LFNを1,2または3に設定し、option/unicode.cをプロジェクトに追加します。LFN機能は、加えてある程度のワーク エリア(LFN操作バッファ)を必要とします。バッファ長は使用できるメモリに応じて_MAX_LFNで構成されることができます。LFNの長さは最大255文字に達するので、LFN完全対応のためには_MAX_LFNは255に設定されるべきです。与えられたファイル名に対してバッファ長が不足した場合、ファイル関数はFR_INVALID_NAMEで失敗します。

+

ファイル関数に再入を行う条件の下でLFN機能を使用する場合は、_USE_LFNは2または3に設定されなければなりません。この場合、ファイル関数はワーク エリアを動的に確保(スタックまたはヒープ)します。ワーク エリアのサイズは、(_MAX_LFN + 1) * 2バイト(exFAT利用時はさらに+608バイト)になるので、スタック等のサイズはそれを考慮した十分な余裕がなければなりません。

+ + + + + + + + +
LFN構成 at CM3
_CODE_PAGE追加コード
SBCS+2.8K
932(Shift_JIS)+62.6k
936(GBK)+177k
949(Korean)+139k
950(Big5)+111k
+

LFN機能の上手な使い方は、それを使わないということです。実際、組み込み用途ではLFN機能がどうしても必要になるということはほとんど無いはずです。LFNを有効にすると、選択されたコード ページに応じてモジュール サイズが増大します。右の表に各コード ページにおけるLFNを有効にしたときのモジュール サイズの違いを示します。特に、CJK地域では数万の文字が使われていますが、不幸なことにそれは巨大なOEM-Unicode相互変換テーブルを要求し、モジュール サイズは劇的に増大します。その結果、それらのコード ページにおいてLFNを有効にしたFatFsモジュールは、多くの8ビット マイコンにインプリメントすることができません。

+

LFN機能のハードルはそれだけではありません。マイクロソフト社はFATファイルシステムについていくつかの特許を保有しています。いずれもLFN機能の実装に関するもので、その利用に対して$0.25/unitのライセンス料を要求しています。このため、商用製品でLFN機能を利用する場合は、製品の最終仕向地によってはライセンスが必要になります。最近のFAT32ドライバの多くはLFN機能を含んでいるため、それらの使用に当たってライセンスが必要になりますが、FatFsは構成オプションでLFN機能を任意にON/OFFできるため、無効にしてライセンス問題を回避することもできます。

+
+ +
+

Unicode入出力への対応

+

FatFs API上におけるファイル名等の文字列データの入出力は、デフォルトではANSI/OEMコードで行われますが、これをUnicode(UTF-16)に切り替えることもできます(_LFN_UNICODEで設定)。つまり、これはFatFsがLFN機能に完全対応していることを意味します。Unicodeのファイル名に関する詳細は、パス名のフォーマットを参照してください。

+
+ +
+

exFATファイルシステム

+

exFAT(Microsoft's Extended File Allocation Table)ファイルシステムは、既に組み込みシステムや情報家電で広く使われているFATファイルシステムを置き換える目的で開発されました。exFATは、64GiB以上のSDメモリ カードで標準ファイルシステムに採用されるなど、FATに並びリムーバブル メディアの標準ファイルシステムの一つとなりつつあります。

+

exFATボリュームでは、FATボリュームで制約となっていた4GiB以上のサイズのファイルを扱え、ファイルシステムのオーバーヘッド(特にファイル アロケーション ディレイ)も大幅に低減され、書き込みスループットがFATより向上しています。しかし、現リビジョンのFatFsでは、実装上の理由から不連続ファイルへのサイズ拡大を伴う書き込み時のとき、スループットがFATより低下します。f_expand関数による連続領域の割り当て機能は、この問題の回避に有効かもしれません。

+

exFATはマイクロソフト社が開発したものなので、マイクロソフト社はexFATについていくつかの特許を保有しています。FatFsのexFAT機能は、それの US. Pat. App. Pub. No. 2009/0164440 A1 に基づいた実装です。このため、商用製品でexFAT機能を利用する場合、製品の最終仕向地によってはライセンスが必要になります。最近のFATドライバの多くはexFAT機能を含んでいるため、それらの使用に当たってライセンスが必要になりますが、FatFsは構成オプションでexFAT機能を任意にON/OFFできるため、無効にしてライセンス問題を回避することもできます。

+

exFATを有効にすると、FatFsモジュールのC89互換は失われます(64ビット整数型が必要なため)。

+
+ +
+

リエントランシー

+

互いに異なるボリュームに対するファイル操作は、_USE_LFN == 1を除いて構成にかかわらずリエントラントで、常に同時平行に動作できます。

+

同じボリュームに対してはデフォルトではリエントラントではありませんが、_FS_REENTRANTでリエントラント(スレッド セーフ)にすることはできます。この場合、OS依存の同期オブジェクト操作関数ff_cre_syncobj, ff_del_syncobj, ff_req_grant, ff_rel_grant関数もまたプロジェクトに追加されなければなりません。サンプル コードと解説はoption/syncobj.cにあります。

+

この場合、あるタスクがボリュームを使用中に他のタスクからそのボリュームに対するファイル関数が呼び出されると、そのアクセスは先のタスクがファイル関数を抜けるまでサスペンドされます。待ち時間が_TIMEOUTで指定された期間を越えた場合、その関数はFR_TIMEOUTでアボートします。いくつかのRTOSではタイムアウト機能はサポートされないかも知れません。

+

ひとつの例外がf_mount, f_mkfs, f_fdisk関数にあります。これらのボリューム制御関数は同じボリューム(または関連する物理ドライブ)に対してリエントラントではありません。これらの関数を使用するときは、アプリケーション レベルで排他制御しなければなりません。

+

注: このセクションはFatFsモジュールそれ自体のリエントランシーについて説明しています。_FS_REENTRANTは、各ファイルシステム オブジェクトの排他制御を行うのみで、下位のディスク関数への再入を防止するものではありません。たとえば、シングル ボリューム構成ではdisk_status関数のみ再入される可能性があり、マルチ ボリューム構成ではどのディスク関数も再入される可能性があります。このように、複数のタスクから同時にFatFs APIを使う条件では、ディスクI/Oモジュールはスレッド セーフである必要があります。

+
+ +
+

多重ファイル アクセス

+

FatFsモジュールではデフォルトでは多重アクセス制御機能をサポートしていません。ファイルに対する多重アクセスは、そのアクセス モードによって制限されます。一つのファイルに対する多重オープンは、それらが全てリード モードのときに限って許可されます。書き込みモードを含む多重オープン、また開かれているファイルに対するリネームや削除を行ってはなりません。さもないと、そのボリュームのFAT構造が破壊される可能性があります。

+

_FS_LOCKに1以上の値(値は同時に管理できるファイル数)をセットすることで多重アクセス制御機能が有効になり、ファイル単位のアクセス制御を自動で行うこともできます。この場合、上記のルールを破ったオープン・リネーム・削除を試みると、その関数はFR_LOCKEDで失敗します。また、_FS_LOCKを越える数のファイルやサブ ディレクトリを同時にオープンしようとすると、FR_TOO_MANY_OPEN_FILESで失敗します。

+
+ +
+

効率的なファイル アクセス

+

小規模な組込システムでのファイルの読み書きにおける効率の良いアクセスのため、アプリケーション プログラマはFatFsモジュールの中でどのような処理が行われているか考慮すべきです。ストレージ上のデータはf_read関数により次のシーケンスで転送されます。

+

図1. セクタ ミスアラインド リード (ショート)
+fig.1 +

+

図2. セクタ ミスアラインド リード (ロング)
+fig.2 +

+

図3. セクタ アラインド リード
+fig.3 +

+

ファイルI/Oバッファはセクタの一部のデータを読み書きするためのセクタ バッファを意味します。セクタ バッファは、それぞれのファイル オブジェクト内のプライベート セクタ バッファまたはファイルシステム オブジェクト内の共有セクタ バッファのどちらかです。バッファ構成オプションの_FS_TINYは、データ転送にどちらを使うかを決定します。タイニー バッファ(1)が選択されるとデータ メモリの消費はそれぞれのファイル オブジェクトで_MAX_SSバイト減少されます。この場合、FatFsモジュールはファイル データの転送とFAT/ディレクトリ アクセスにファイルシステム オブジェクト内のセクタ バッファだけを使用します。タイニー バッファの欠点は、セクタ バッファにキャッシュされたFATデータがファイル データの転送により失われ、クラスタ境界の毎にリロードされなければならないことです。でも、悪くない性能と少ないメモリ消費の視点から多くのアプリケーションに適するでしょう。

+

図1はセクタの一部のデータがファイルI/Oバッファを経由で転送されることを示します。図2に示される長いデータの転送では、転送データの中間の1セクタまたはそれ以上のセクタにまたがる転送データがアプリケーション バッファに直接転送されています。図3は転送データ全体がセクタ境界にアライメントされている場合を示しています。この場合、ファイルI/Oバッファは使用されません。直接転送においては最大の範囲のセクタがdisk_read関数で一度に読み込まれますが、クラスタ境界を越えるマルチ セクタ転送はそれが隣接であっても行われません。

+

このように、セクタにアライメントしたファイルの読み書きへの配慮はバッファ経由のデータ転送を避け、読み書き性能は改善されるでしょう。その効果に加え、タイニー構成でキャッシュされたFATデータがファイル データの転送によりフラッシュされず、非タイニー構成と同じ性能を小さなメモリ フットプリントで達成できます。

+
+ +
+

フラッシュ メモリの特性への配慮

+

HDDなどのディスク メディアとは異なり、SDCやCFCなどのフラッシュ メモリ メディアの性能を引き出すには、その特性を意識した制御が必要になります。

+

マルチ セクタ書き込み

+
+図6. マルチ/シングル セクタ ライトの比較
+fig.6 +
+

フラッシュ メモリ メディアの書き込み速度はシングル セクタ書き込みの時に最も低いものになり、一回のトランザクションで転送されるセクタ数が大きくなるほど書き込み速度は向上します(図6)。この効果はバス速度が高速になるほど大きく、10倍以上の差が現れることも珍しくありません。テスト結果は、マルチ セクタ書き込み(W:16K, 32 sectors)がシングル セクタ書き込み(W:100, 1 sector)よりどの程度速いかを明確に示しています。大容量メディアほどシングル セクタ書き込みが遅くなる点もまた重要です。書き込みトランザクションの回数はまた、メディアの寿命にも影響してきます。つまり、同じ量のデータを書き込む場合、図6上のシングル セクタ書き込みは、図6下のマルチ セクタ書き込みに比べて16倍早くフラッシュ メモリ メディアを消耗させてしまうということです。

+

このように、アプリケーションはなるべく大きなブロック(クラスタ サイズまたは2の累乗セクタ境界にアライメントした)で読み書きを行う必要があります。もちろん、アプリケーションからメディアに至る全てのレイヤがマルチ セクタ転送に対応していないと意味がありません。残念ながら、既存のオープン ソースのドライバの多くはマルチ セクタ転送に未対応です。なお、FatFsモジュールおよびサンプル ドライバはマルチ セクタ転送に対応しています。

+

明示的なメモリ消去

+

通常のファイル消去では、記録されたデータに対して何らかの処理が行われるわけではなく、単にFAT上にその領域を未使用と記録しているだけです。このため、ファイルが消去されたあともそれらは有効なデータ ブロックとしてフラッシュ メモリ上に残ります。そこで、ファイルを消去するとき、占有していたデータ セクタを明示的に消去(つまり未使用ブロックにする)することにより、メディア内の空きブロックを増やすことができます。これにより、次にそのブロックに書き込むときの消去動作が無くなり、書き込み性能が向上する可能性があります。また、ウェアレベリングに使えるブロックが増え、メディアの耐久性も向上するかも知れません。この機能を有効にするには、_USE_TRIMに1を設定します。これはフラッシュ メモリ ドライブの内部動作に期待した制御なので、効果があるとは限りません。また、ファイル消去の時間が延びることも考慮に入れるべきです。

+
+ +
+

クリチカル セクション

+

ストレージ上のFAT構造を操作している途中で、停電、不正なメディアの取り外し、回復不能なデータ エラー等の障害が発生すると、処理が中途半端な状態で中断され、その結果としてFATボリュームの構造が破壊される可能性があります。次にFatFsモジュールにおけるクリチカル セクションと、その間の障害により起きうるエラーの状態を示します。

+
+図4. 長いクリチカル セクション
+fig.4 +
+
+図5. 最小化したクリチカル セクション
+fig.5 +
+
+

赤で示したセクションを実行中に中断が発生した場合、クロス リンクが発生して操作中のファイルやディレクトリが失われる可能性があります。黄色で示したセクションを実行中に中断が発生した場合、次のうちいずれかまたは複数の結果が生じる可能性があります。

+ +

いずれの場合も操作の対象でないファイルには影響はありません。これらのクリチカル セクションは、ファイルを書き込みモードで開いている時間を最小限にするか、f_sync関数を適宜使用することで図5のようにリスクを最小化することができます。

+
+ +
+

APIの拡張的使用例

+

FatFs APIの拡張的使用例です。有用なコードがあった場合は、随時追加していきます。。

+
    +
  1. 追記モードでのオープン/新規作成(R0.12以前)
  2. +
  3. ディレクトリを空にする
  4. +
  5. ファイルに連続領域を割り当てる(R0.11a以前)
  6. +
  7. ディスクI/Oモジュールの機能/互換性チェッカー
  8. +
  9. FATイメージ作成ツール
  10. +
+
+ +
+

FatFsのライセンスについて

+

FatFsは、作者(ChaN)の個人プロジェクトとして開発されています。現在までのリビジョンにおいてコントリビューターはいないため、作者以外の書いたソース コードは含まれません。ソース ファイルにライセンス条件が記述されているので、利用の際はそれに従うこと。原文は英語ですが、参考までに以下に日本語訳を示しておきます。

+
+/*----------------------------------------------------------------------------/
+/  FatFs - Generic FAT file system module  R0.12a                             /
+/-----------------------------------------------------------------------------/
+/
+/ Copyright (C) 2016, ChaN, all right reserved.
+/
+/ FatFsモジュールはオープンソースソフトウェアです。FatFsの再配布および使用は、
+/ ソースコードかバイナリ形式か、また変更の有無にかかわらず、次の条件が満たされ
+/ る場合に限り許可されます。
+/
+/ 1. ソースコードで再配布するときは、その中に上記の著作権表示、この条件、および
+/    次の免責事項を保持すること。
+/ 
+/ このソフトウェアは、著作権者らおよびコントリビューターらによって現状のまま
+/ 提供されており、いかなる保証もありません。
+/ 著作権者もコントリビューターも、このソフトウェアの使用により発生するいかなる
+/ 損害についても、責任を負いません。
+/----------------------------------------------------------------------------*/
+
+

このようにFatFsはBSDライクなライセンスとしていますが、一つ大きな違いがあります。FatFsは主に組み込み向けとして開発されたため、バイナリ形式(ソース コードを含まない形式全て)での再配布については、商用での使いやすさを考慮して配布時の条件を設けていません。つまり、バイナリ配布の場合は、FatFsおよびそのライセンス文書についてドキュメントに明記してもしなくてもかまいません。これは、一条項BSDライセンスと等価ということです。もちろん、GNU GPLなどほとんど全てのオープン ソース ライセンスの下のプロジェクトにおいて共存可能です。FatFsからフォークを作成し公開する場合は、矛盾しない他のオープン ソース ライセンス(GNU GPLや修正BSDライセンスなど)に変更することも可能です。

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/chdir.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/chdir.html new file mode 100644 index 0000000..1d42e48 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/chdir.html @@ -0,0 +1,81 @@ + + + + + + + + +FatFs - f_chdir + + + + +
+

f_chdir

+

カレント ディレクトリを変更します。

+
+FRESULT f_chdir (
+  const TCHAR* path /* [IN] ディレクトリ名へのポインタ */
+);
+
+
+ +
+

引数

+
+
path
+
移動対象のディレクトリのパス名を示すヌル文字'\0'終端の文字列を指定します。
+
+
+ + +
+

戻り値

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_NO_FILE, +FR_NO_PATH, +FR_INVALID_NAME, +FR_INVALID_DRIVE, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_NOT_ENOUGH_CORE +

+
+ + +
+

解説

+

各ボリュームのカレント ディレクトリを変更します。カレント ディレクトリは、そのボリュームのマウント動作が行われたとき、ルート ディレクトリに初期設定されます。カレント ディレクトリは、ファイル システム オブジェクトに保持されるため、そのボリュームを使用する全てのタスクに対して影響を与えます。

+
+ + +
+

対応情報

+

_FS_RPATH == 1のときに使用可能となります。

+
+ + +
+

使用例

+
+    /* カレント ドライブのカレント ディレクトリを変更 (ルート下のdir1へ) */
+    f_chdir("/dir1");
+
+    /* ドライブ2のカレント ディレクトリを変更 (親ディレクトリへ) */
+    f_chdir("2:..");
+
+
+ +
+

参照

+

f_chdrive

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/chdrive.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/chdrive.html new file mode 100644 index 0000000..fd93188 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/chdrive.html @@ -0,0 +1,61 @@ + + + + + + + + +FatFs - f_chdrive + + + + +
+

f_chdrive

+

カレント ドライブを変更します。

+
+FRESULT f_chdrive (
+  const TCHAR* path  /* [IN] 対象ドライブを指定します */
+);
+
+
+ +
+

引数

+
+
path
+
カレント ドライブに設定する論理ドライブ番号を指定するパス名を指定します。
+
+
+ + +
+

戻り値

+

+FR_OK, +FR_INVALID_DRIVE +

+
+ + +
+

解説

+

カレント ドライブを変更します。システム起動時の初期値はドライブ0です。この設定はFatFsモジュールの静的変数に記録されるため、全てのタスクに対して影響を与えます。

+
+ + +
+

対応情報

+

_FS_RPATH == 1で、且つ_VOLUMES > 1のときに使用可能となります。

+
+ + +
+

参照

+

f_chdir

+
+ +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/chmod.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/chmod.html new file mode 100644 index 0000000..226725e --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/chmod.html @@ -0,0 +1,83 @@ + + + + + + + + +FatFs - f_chmod + + + + +
+

f_chmod

+

ファイルまたはサブ ディレクトリの属性を変更します。

+
+FRESULT f_chmod (
+  const TCHAR* path, /* [IN] オブジェクト名へのポインタ */
+  BYTE attr,         /* [IN] 設定値 */
+  BYTE mask          /* [IN] 変更マスク */
+);
+
+
+ +
+

引数

+
+
path
+
属性変更対象のオブジェクトのパス名を示すヌル文字'\0'終端の文字列を指定します。
+
attr
+
設定する属性。指定可能な属性は次の通りで、これらの組み合わせで指定します。指定されなかった属性は解除されます。
+ + + + + + +
意味
AM_RDOリード オンリー
AM_ARCアーカイブ
AM_SYSシステム
AM_HIDヒドゥン
+
+
mask
+
変更する属性のマスク。指定した属性が設定または解除され、指定されなかった属性は状態が保持されます。attrと同じ値を使います。
+
+
+ + +
+

戻り値

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_NO_FILE, +FR_NO_PATH, +FR_INVALID_NAME, +FR_WRITE_PROTECTED, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT, +FR_LOCKED, +FR_NOT_ENOUGH_CORE +

+
+ + +
+

対応情報

+

_FS_READONLY == 0で、且つ_FS_MINIMIZE == 0のとき使用可能です。

+
+ + +
+

使用例

+
+    /* リードオンリーをセット、アーカイブをクリア、その他は変更しない */
+    f_chmod("file.txt", AM_RDO, AM_RDO | AM_ARC);
+
+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/close.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/close.html new file mode 100644 index 0000000..e9e2168 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/close.html @@ -0,0 +1,65 @@ + + + + + + + + +FatFs - f_close + + + + +
+

f_close

+

ファイルを閉じます。

+
+FRESULT f_close (
+  FIL* fp     /* [IN] ファイル オブジェクトへのポインタ */
+);
+
+
+ +
+

引数

+
+
fp
+
閉じようとするファイルのファイル オブジェクト構造体へのポインタを指定します。
+
+
+ + +
+

戻り値

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_INVALID_OBJECT, +FR_TIMEOUT +

+
+ + +
+

解説

+

ファイルを閉じます。何らかの書き込みの行われたファイルの場合、キャッシュされた状態(リード/ライト バッファ上のデータ、変更されたFATやディレクトリ項目)はディスクに書き戻されます。関数が正常終了すると、そのファイル オブジェクトは無効になり、そのメモリも解放できます。

+

ファイル オブジェクトが読み出し専用モードで、_FS_LOCKオプションが選択されていない場合は、ファイルを閉じずにファイル オブジェクトを破棄することもできます。しかし、これは将来の互換性の点で推奨はされません。

+
+ + +
+

対応情報

+

全ての構成で使用可能です。

+
+ + +
+

参照

+f_open, f_read, f_write, f_sync, FIL, FATFS +
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/closedir.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/closedir.html new file mode 100644 index 0000000..8b2a476 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/closedir.html @@ -0,0 +1,64 @@ + + + + + + + + +FatFs - f_closedir + + + + +
+

f_closedir

+

ディレクトリを閉じます。

+
+FRESULT f_closedir (
+  DIR* dp     /* [IN] ディレクトリ オブジェクトへのポインタ */
+);
+
+
+ +
+

引数

+
+
dp
+
閉じようとするディレクトリのディレクトリ オブジェクト構造体へのポインタを指定します。
+
+
+ + +
+

戻り値

+

+FR_OK, +FR_INT_ERR, +FR_INVALID_OBJECT, +FR_TIMEOUT +

+
+ + +
+

解説

+

ディレクトリを閉じます。関数が正常終了すると、そのディレクトリ オブジェクトは無効になり、そのメモリも解放できます。

+

_FS_LOCKオプションが選択されていない場合は、この処理を行わずにディレクトリ オブジェクトを破棄することもできます。しかし、これは将来の互換性の点で推奨はされません。

+
+ + +
+

対応情報

+

_FS_MINIMIZE <= 1のとき使用可能になります。

+
+ + +
+

参照

+f_opendir, f_readdir, DIR +
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/config.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/config.html new file mode 100644 index 0000000..a698d66 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/config.html @@ -0,0 +1,209 @@ + + + + + + + + + +FatFs - 構成オプション + + + +

構成オプション

+

FatFsには多くの構成オプションがあり、それぞれのプロジェクトの要求に応じて柔軟に機能を構成することができます。構成オプションは、ffconf.hに記述されます。

+ +
+

基本機能の設定

+ +

_FS_READONLY

+

0:リード/ライト or 1:リード オンリ。リード オンリ構成では、f_writef_syncf_unlinkf_mkdirf_chmodf_renamef_truncatef_getfreeの基本API関数およびオプションの書き込み系API関数が削除されます。

+ +

_FS_MINIMIZE

+

基本API関数を段階的に削除します。

+ + + + + + +
解説
0全ての基本API関数が利用可能。
1f_statf_getfreef_unlinkf_mkdirf_chmodf_utimef_truncatef_rename関数が削除される。
21に加え、f_opendirf_readdirf_closedir関数が削除される。
32に加え、f_lseek関数が削除される。
+ +

_USE_STRFUNC

+

文字列入出力API関数f_gets, f_putc, f_puts and f_printfの構成。

+ + + + + +
解説
0文字列入出力API関数を使用しない。
1文字列入出力API関数を使用する。データのLF-CRLF変換はしない。
2文字列入出力API関数を使用する。データのLF-CRLF変換をする。
+ +

_USE_FIND

+

フィルタ付きディレクトリ読み出し機能の構成(0:無効 または 1:有効)。有効にすると、f_findfirstf_findnext関数が利用可能になります。_FS_MINIMIZEは、1以下でなければなりません。

+ +

_USE_MKFS

+

ボリューム作成機能の構成(0:無効 または 1:有効)。有効にするとf_mkfs関数が利用可能になります。

+ +

_USE_FASTSEEK

+

高速シーク機能の構成(0:無効 または 1:有効)。有効にすると、f_lseekf_readf_write関数において高速化モードが利用可能になります。詳しくは、こちらを参照してください。

+ +

_USE_EXPAND

+

連続領域割り当て機能の構成(0:無効 または 1:有効)。有効にするとf_expand関数が利用可能になります。_FS_READONLYは0でなければなりません。

+ +

_USE_CHMOD

+

メタデータ操作機能の構成(0:無効 または 1:有効)。有効にすると、f_chmodf_utime関数が利用可能になります。_FS_READONLYは0でなければなりません。

+ +

_USE_LABEL

+

ボリューム ラベル操作機能の構成(0:無効 または 1:有効)。有効にすると、f_getlabelf_setlabel関数(_FS_READONLY == 0のとき)が利用可能になります。

+ +

_USE_FORWARD

+

ストリーミング読み出し機能(f_forward関数)の構成(0:無効 または 1:有効)。

+ +
+ + +
+

名前空間とロケールの設定

+ +

_CODE_PAGE

+

パス名等の文字列データのコード ページを指定します。不適切な設定は、ファイル オープン エラーの原因になる可能性があります。拡張文字が全く使われない場合は、どれを選んでも同じです。

+ + + + + + + + + + + + + + + + + + + + + + + + +
解説
1ASCII (非LFN構成でのみ有効)
437U.S.
720Arabic
737Greek
771KBL
775Baltic
850Latin 1
852Latin 2
855Cyrillic
857Turkish
860Portuguese
861Icelandic
862Hebrew
863Canadian French
864Arabic
865Nordic
866Russian
869Greek 2
932日本語 (DBCS)
936簡体字中国語 (DBCS)
949韓国語 (DBCS)
950繁体字中国語 (DBCS)
+ +

_USE_LFN

+

LFN(長いファイル名)対応を設定します。LFN機能を有効にするときは、Unicode操作関数option/unicode.cをプロジェクトに加える必要があります。また、LFN操作のワーク エリアとして(_MAX_LFN + 1) * 2バイト(exFAT構成時はさらに608バイト)を使用します。このため、バッファをスタックに確保するときは、スタック オーバ フローに注意する必要があります。ヒープに確保するときは、メモリ操作関数(ff_memallocff_memfree(option/syscall.cにサンプルあり))をプロジェクトに加える必要があります。

+ + + + + + +
解説
0LFN機能を使わない。8.3形式の名前のみ使用可能。
1LFN機能を使う。ワーク エリアは静的に確保。常にスレッド セーフではない。
2LFN機能を使う。ワーク エリアはスタックに確保。
3LFN機能を使う。ワーク エリアはヒープに確保。
+ +

_MAX_LFN

+

LFN操作バッファのサイズを文字単位で指定(12~255)します。LFN機能が無効のときは意味を持ちません。

+ +

_LFN_UNICODE

+

ファイルAPI上におけるUnicode対応機能を設定します。非LFN構成のときは、0でなければなりません。LFN構成のときに1を選択すると、ファイルAPI上の文字列データTCHAR型の定義が切り替わり、パス名等にUnicodeを使用するようになります。この機能は、文字列入出力関数にも影響します。詳しくは、こちらを参照してください。

+ +

_STRF_ENCODE

+

Unicode API構成のとき、文字列入出力関数、f_getsf_putcf_putsf_printf、におけるファイル上のエンコーディングを指定します。非Unicode API構成のときは意味を持ちません。

+ + + + + + +
解説
0ANSI/OEM
1UTF-16LE
2UTF-16BE
3UTF-8
+ +

_FS_RPATH

+

相対パス機能を設定します。この機能は、ディレクトリ読み出し関数の出力にも影響します。詳しくは、こちらを参照してください。

+ + + + + +
解説
0相対パス機能を使わない。パス名は常にルート ディレクトリから辿る。
1相対パス機能を使う。f_chdirf_chdrive関数が利用可能になる。
21に加え、f_getcwd関数が利用可能になる。
+ +
+ + +
+

ボリューム/物理ドライブの設定

+ +

_VOLUMES

+

利用するボリューム(論理ドライブ)の数を1~9の範囲で設定します。

+ +

_STR_VOLUME_ID

+

文字列ボリュームIDの設定(0:無効 または 1:有効)。パス名中のボリュームIDに数字に加え任意の文字列も使用できるようにするオプションです。ボリュームID文字列は_VOLUME_STRSで定義します。

+ +

_VOLUME_STRS

+

ボリュームID文字列を定義します。_VOLUMESで設定された個数の文字列を"RAM","SD","CF",... のように挙列します。使用可能な文字はA~Zおよび0~9で、先頭の項目が論理ドライブ0に対応します。

+ +

_MULTI_PARTITION

+

マルチ区画機能の設定(0:無効 または 1:有効)。無効のときは、個々の論理ドライブは同じ番号の物理ドライブに1:1で対応し、それぞれの物理ドライブ中の最初の区画に結びつけられます。マルチ区画機能を有効にすると、論理ドライブはそれぞれ任意の物理ドライブの任意の区画に結びつけることができます。マッピングは、ユーザ定義の変換テーブルVolToPart[]によって行います。また、f_fdisk関数が利用可能になります。詳しくは、こちらを参照してください。

+ +

_MIN_SS、_MAX_SS

+

使用する物理ドライブのセクタ サイズ(データの読み書きの最小単位)を設定します。有効な値は、512、1024、2048、4096です。_MIN_SSは最小サイズ、_MAX_SSは最大サイズを設定します。メモリ カードやハードディスクでは、常に両方に512を設定しますが、オンボード メモリや一部の光学メディアでは大きな値を設定する必要があるかも知れません。_MAX_SS > _MIN_SSに設定したときは可変セクタ サイズ構成となり、disk_ioctl関数にはGET_SECTOR_SIZEコマンドを実装する必要があります。

+ +

_USE_TRIM

+

ATA-TRIM機能の使用の設定(0:無効 または 1:有効)。この機能を有効にしたときは、disk_ioctl関数にCTRL_TRIMコマンドを実装するべきです。

+ +

_FS_NOFSINFO

+

FAT32ボリュームのFSINFOの使用の設定(0~3)。FAT32ボリュームで必ず正確な空き容量を取得する必要があるとき、設定値のビット0をセットするとf_getfree関数はFSINFOの情報を使わずに全FATスキャンを行って空き容量を得ます。ビット1は最終割り当てクラスタ番号の利用の制御です。

+ + + + + + +
解説
bit0=0FSINFOの空きクラスタ情報が有効なときはそれを利用する。
bit0=1FSINFOの空きクラスタ情報を利用しない。
bit1=0FSINFOの最終割り当てクラスタ番号が有効なときはそれを利用する。
bit1=1FSINFOの最終割り当てクラスタ番号を利用しない。
+ +
+ + +
+

システムの設定

+ +

_FS_TINY

+

ファイル データ転送バッファの構成(0:ノーマル または 1:タイニ)。タイニ構成では、ファイル オブジェクトFIL内のプライベート セクタ バッファが削除され、_MAX_SSバイト小さくなります。ファイル データの転送には、代わりにファイル システム オブジェクトFATFS内のボリューム共有セクタ バッファが使われます。

+ +

_FS_EXFAT

+

exFATのサポート(0:使用しない または 1:使用する)。exFATを使用するには、LFN機能を有効にしなければなりません。また、exFATの完全サポートのためには、_LFN_UNICODE = 1_MAX_LFN = 255の設定が推奨されます。exFAT機能では64ビット整数を使用するため、これを有効にするとC89(ANSI C)互換が失われます。

+ +

_FS_NORTC

+

RTC機能の使用の設定(0:使用する または 1:使用しない)。システムがRTC(カレンダ時計)をサポートしない場合は、1をセットします。この場合、FatFsが変更を加えたオブジェクトのタイムスタンプはデフォルトの日時を持ちます。RTCが使用可能なときは、0を設定し、get_fattime関数をプロジェクトに加えます。リード オンリ構成ではこのオプションは意味を持ちません。

+ +

_NORTC_MON、_NORTC_MDAY、_NORTC_YEAR

+

デフォルト日時の設定。_FS_NORTCが1のとき、固定して与えられる日付を指定します。_FS_NORTCが0のとき、およびリード オンリ構成ではこれらのオプションは意味を持ちません。

+ +

_FS_LOCK

+

ファイル ロック機能の設定。このオプションは、開かれたオブジェクトに対する不正な操作の制御機能を設定します。リード オンリ構成では0に設定しなければなりません。なお、ファイル ロック機能はリエントランシーとは関係ありません。

+ + + + + +
解説
0ファイル ロック機能を使わない。ボリュームの破損を防ぐため、アプリケーションは不正なファイル操作を避けなければならない。
>0ファイル ロック機能を使う。数値は同時にオープンできるファイルやサブ ディレクトリの数を設定します。
+ +

_FS_REENTRANT

+

リエントランシーの設定(0:無効 または 1:有効)。このオプションは、FatFsモジュール自体のリエントランシー(スレッド セーフ)の設定をします。異なるボリュームに対するファイル アクセスはこのオプションに関係なく常にリエントラントで、f_mountf_mkfsf_fdiskなどのボリューム操作関数はこのオプションに関係なく常にリエントラントではありません。同じボリュームに対するファイル アクセス(つまり、ファイル システム オブジェクトの排他使用)のみがこのオプションの制御下にあります。このオプションを有効にしたときは、同期関数であるff_req_grantff_rel_grantff_del_syncobjff_cre_syncobjをプロジェクトに追加する必要があります。サンプルがoption/syscall.cにあります。

+ +

_FS_TIMEOUT

+

タイムアウト時間の設定。待ち合わせ時間が長いときにFR_TIMEOUTでファイル関数をアボートする時間を設定します。_FS_REENTRANTが0のときは意味を持ちません。

+ +

_SYNC_t

+

O/S定義の同期オブジェクトの型を設定します。例: HANDLEIDOS_EVENT*SemaphoreHandle_tなど。また、O/S機能のヘッダ ファイルをff.cのスコープ内にインクルードする必要があります。_FS_REENTRANTが0のときは意味を持ちません。

+ +
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/dinit.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/dinit.html new file mode 100644 index 0000000..7d61578 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/dinit.html @@ -0,0 +1,46 @@ + + + + + + + + +FatFs - disk_initialize + + + + +
+

disk_initialize

+

ストレージ デバイスを初期化します。

+
+DSTATUS disk_initialize (
+  BYTE pdrv      /* [IN] 物理ドライブ番号 */
+);
+
+
+ +
+

引数

+
+
pdrv
+
対象のデバイスを識別する物理ドライブ番号(0-9)が指定されます。
+
+
+ + +
+

戻り値

+

この関数は戻り値としてディスク ステータスを返します。ディスク ステータスの詳細に関してはdisk_status関数を参照してください。

+
+ +
+

解説

+

ストレージ デバイスを初期化し、データの読み書きなど全ての動作が可能な状態にします。関数が成功すると、戻り値のSTA_NOINITフラグがクリアされます。

+

この関数はFatFsの管理下にあり、自動マウント動作により必要に応じて呼び出されます。アプリケーションからはこの関数を呼び出してはなりません。さもないと、FATボリュームが破壊される可能性があります。再初期化が必要なときは、f_mount関数を使用してください。

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/dioctl.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/dioctl.html new file mode 100644 index 0000000..1537d7b --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/dioctl.html @@ -0,0 +1,98 @@ + + + + + + + + +FatFs - disk_ioctl + + + + +
+

disk_ioctl

+

一般的なデータ読み書き以外のストレージ デバイス自体に対する様々な制御を行います。

+
+DRESULT disk_ioctl (
+  BYTE pdrv,    /* [IN] 物理ドライブ番号 */
+  BYTE cmd,     /* [IN] 制御コマンド */
+  void* buff    /* [I/O] データ受け渡しバッファ */
+);
+
+
+ +
+

引数

+
+
pdrv
+
対象のデバイスを識別する物理ドライブ番号(0-9)が指定されます。
+
cmd
+
制御コマンド コードが指定されます。
+
buff
+
制御コマンドに依存したパラメータを授受するバッファを指すポインタが指定されます。パラメータの授受のないコマンドの場合は、値に意味はありません。
+
+
+ +
+

戻り値

+
+
RES_OK (0)
+
正常終了。
+
RES_ERROR
+
何らかのエラーが発生した。
+
RES_PARERR
+
コマンドが不正。
+
RES_NOTRDY
+
ドライブが動作可能状態ではない、または初期化されていない。
+
+
+ +
+

解説

+

ストレージ デバイスの種類によりサポートされるコマンドは異なりますが、FatFsモジュール自体は、次の汎用コマンドのみ使用し、特定のデバイスに依存した制御は行いません。

+ + + + + + + + +
標準ioctlコマンド
コマンド解説
CTRL_SYNCデバイスのデータ書き込み処理を完了させます。ドライバがライト バック キャッシュなどを持っている場合は、書き込まれていないデータを即時書き込みます。メディア上への書き込みがそれぞれdisk_write関数の中で完了する場合は、このコマンドに対してすることはありません。
GET_SECTOR_COUNT総セクタ数の取得。buffの指すDWORD型変数にドライブ上の総セクタ数を返します。f_mkfs, f_fdisk関数内から呼び出され、作成するボリュームのサイズを決定するために使用されます。
GET_SECTOR_SIZEセクタ サイズの取得。セクタ サイズ可変(_MAX_SS > _MIN_SS)のとき、disk_initailize関数の成功に続き呼び出されるので、buffの指すWORD型変数に現在のセクタ サイズを返します。有効値は512、1024、2048または4096です。セクタ サイズ固定(_MAX_SS == _MIN_SS)のときはこのコマンドは使われることはなく、デバイスは常にそのセクタ サイズで動作しなければなりません。
GET_BLOCK_SIZE消去ブロック サイズの取得。buffの指すDWORD型変数にフラッシュ メモリの消去ブロック サイズ(セクタ単位)を返します。1から32768の範囲で2の累乗の値でなければなりません。ブロック サイズ不明またはフラッシュ メモリ以外のデバイスでは1を返します。f_mkfs関数内でのみ使用され、作成されるボリュームのデータ領域はこの境界にアライメントされます。
CTRL_TRIM不必要セクタの通知。buffの指すDWORD型配列には不必要になった領域 {開始セクタ,終了セクタ} を指定して呼び出されます。TRIM機能が有効(_USE_TRIM == 1)で、クラスタが解放されるとき、およびフォーマット時に呼び出されます。これは、ATAコマンド セットのTrimコマンドと等価で、この機能をサポートしないデバイスは何もする必要はありません。また、戻り値はチェックされず、結果によってFatFsの動作が影響を受けることはありません。
+ +

FatFs自体はデバイス依存コマンドやユーザ定義コマンドは一切使用しませんが、アプリケーションから何らかのデバイス制御が行えると便利なことがあります。アプリケーション上で標準以外の制御が必要なときは、必要に応じてユーザ定義コマンドを追加して利用するとよいでしょう。次にコマンドの例を示します。

+ + + + + + + + + + + + + + + + + + + + +
ユーザ定義ioctlコマンドの例
コマンド解説
CTRL_FORMATメディアの物理フォーマットを行います。buffはNULLでないとき、進行表示のためのコールバック関数のアドレスを示します。
CTRL_POWER_IDLEデバイスをアイドル状態にします。通常の読み書き要求でアクティブ状態に戻るなら、STA_NOINITフラグをセットする必要はありません。
CTRL_POWER_OFFデバイスをシャットダウン状態にします。STA_NOINITはセットされます。デバイスはdisk_initialize関数でアクティブ状態に戻ります。
CTRL_LOCKユーザによるメディアの取り出しを禁止します。
CTRL_UNLOCKユーザによるメディアの取り出しを許可します。
CTRL_EJECTメディアを排出します。完了後、STA_NOINITSTA_NODISKフラグはセットされます。
MMC_GET_TYPEカード タイプを示すフラグ(b0:MMCv3, b1:SDv1, b2:SDv2+, b3:LBA)をbuffの示すBYTE変数に読み出します。(MMC/SDカード専用)
MMC_GET_CSDCSDレジスタの内容をbuffの示す16バイトのバッファに読み出します。(MMC/SDカード専用)
MMC_GET_CIDCIDレジスタの内容をbuffの示す16バイトのバッファに読み出します。(MMC/SDカード専用)
MMC_GET_OCROCRレジスタの内容をbuffの示す4バイトのバッファに読み出します。(MMC/SDカード専用)
MMC_GET_SDSTATSD STATUSレジスタの内容をbuffの示す64バイトのバッファに読み出します。(SDカード専用)
ATA_GET_REVリビジョン コードをbuffの示す16バイトのバッファに読み出します。(ATA/CFカード専用)
ATA_GET_MODELモデル コードをbuffの示す40バイトのバッファに読み出します。(ATA/CFカード専用)
ATA_GET_SNシリアル番号をbuffの示す20バイトのバッファに読み出します。(ATA/CFカード専用)
ISDIO_READbuffの示すコマンド構造体に従いiSDIOレジスタからデータを読み出します。(FlashAir専用)
ISDIO_WRITEbuffの示すコマンド構造体に従いiSDIOレジスタにデータを書き込みます。(FlashAir専用)
ISDIO_MRITEbuffの示すコマンド構造体に従いiSDIOレジスタの一部のビットを書き換えます。(FlashAir専用)
+
+ + +
+

対応情報

+

リード オンリー構成で、かつセクタ サイズ固定構成のときは、この関数は必要とされません。

+
+ + +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/dread.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/dread.html new file mode 100644 index 0000000..ab2b4bc --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/dread.html @@ -0,0 +1,72 @@ + + + + + + + + +FatFs - disk_read + + + + +
+

disk_read

+

ストレージ デバイスからデータを読み出します。

+
+DRESULT disk_read (
+  BYTE pdrv,     /* [IN] 物理ドライブ番号 */
+  BYTE* buff,    /* [OUT] 読み出しバッファへのポインタ */
+  DWORD sector,  /* [IN] 読み出し開始セクタ番号 */
+  UINT count     /* [IN] 読み出すセクタ数 */
+);
+
+
+ +
+

引数

+
+
pdrv
+
対象のデバイスを識別する物理ドライブ番号(0-9)が指定されます。シングル ドライブ システムでは、常に0が指定されます。
+
buff
+
ストレージ デバイスから読み出したデータを格納するバイト配列が指定されます。
+
sector
+
読み出しを開始するセクタ番号。32ビットLBAで指定されます。
+
count
+
読み出すセクタ数(1以上の値)が指定されます。
+
+
+ + +
+

戻り値

+
+
RES_OK (0)
+
正常終了。
+
RES_ERROR
+
回復不能なエラーにより、読み出し操作を完了できなかった。
+
RES_PARERR
+
パラメータが不正。
+
RES_NOTRDY
+
ストレージ デバイスが動作可能な状態ではない (初期化されていない)。
+
+
+ + +
+

解説

+

ストレージ デバイスに対するデータの読み書きは、セクタ単位で行われます。FatFsでは512~4096バイトのセクタ サイズをサポートします。固定セクタ サイズ構成(_MIN_SS == MAX_SS)のときは、暗黙的にそのセクタ サイズで動作しなければなりません。可変セクタ サイズ構成(_MIN_SS < MAX_SS)のときは、disk_initialize関数に続いてdisk_ioctl関数でセクタ サイズを問い合わせてくるので、それに対して正しい値を返す必要があります。

+

buffBYTE型なので、指定されるアドレスは常にワード アライメントされているとは限りません。非アライメント アドレスへの転送は、直接転送において発生することがあります。もしも、ハードウェア上の制約でそのような転送が不可能なときは、この関数内で二段転送するなどして解決するか、または別の方法で対応しなければなりません。次にいくつかの対応方法を示します(いずれか一つでOK)。

+ +

一般的に、複数セクタの転送要求は、ストレージ デバイスに対して可能な限りマルチ セクタ転送しなければなりません。複数のシングル セクタ読み出しに分解された場合、スループットが低下することがあります。

+
+ + +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/dstat.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/dstat.html new file mode 100644 index 0000000..0035e3f --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/dstat.html @@ -0,0 +1,48 @@ + + + + + + + + +FatFs - disk_status + + + + +
+

disk_status

+

ストレージ デバイスの状態を取得します。

+
+DSTATUS disk_status (
+  BYTE pdrv           /* [IN] 物理ドライブ番号 */
+);
+
+
+ +
+

引数

+
+
pdrv
+
対象のデバイスを識別する物理ドライブ番号(0-9)が指定されます。物理ドライブが1台のときは、常に0になります。
+
+
+ + +
+

戻り値

+

現在のストレージ デバイスの状態を次のフラグの組み合わせ値で返します。

+
+
STA_NOINIT
+
デバイスが初期化されていないことを示すフラグ。システム リセットやメディアの取り外し等でセットされ、disk_initialize関数の正常終了でクリア、失敗でセットされます。メディア交換は非同期に発生するイベントなので、過去にメディア交換があった場合もこのフラグに反映させる必要があります。FatFsモジュールは、このフラグを参照してマウント動作が必要かどうかを判断します。
+
STA_NODISK
+
メディアが存在しないことを示すフラグ。メディアが取り外されている間はセットされ、セットされている間はクリアされます。固定ディスクでは常にクリアします。なお、このフラグはFatFsモジュールでは参照されません。
+
STA_PROTECT
+
メディアがライト プロテクトされていることを示すフラグ。ライト プロテクト機能をサポートしないときは、常にクリアします。リード オンリ構成では参照されません。
+
+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/dwrite.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/dwrite.html new file mode 100644 index 0000000..936d7ec --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/dwrite.html @@ -0,0 +1,76 @@ + + + + + + + + +FatFs - disk_write + + + + +
+

disk_write

+

ストレージ デバイスにデータを書き込みます。

+
+DRESULT disk_write (
+  BYTE pdrv,        /* [IN] 物理ドライブ番号 */
+  const BYTE* buff, /* [IN] 書き込むデータへのポインタ */
+  DWORD sector,     /* [IN] 書き込み開始セクタ番号 */
+  UINT count        /* [IN] 書き込むセクタ数 */
+);
+
+
+ +
+

引数

+
+
pdrv
+
対象のデバイスを識別する物理ドライブ番号(0-9)が指定されます。
+
buff
+
ストレージ デバイスに書き込むセクタ データが格納されたバイト配列が指定されます。データのバイト数は、セクタ サイズ*countとなります。
+
sector
+
書き込みを開始するセクタ番号。32ビットLBAで指定されます。
+
count
+
書き込むセクタ数(1以上の値)が指定されます。
+
+
+ + +
+

戻り値

+
+
RES_OK (0)
+
正常終了。
+
RES_ERROR
+
回復不能なエラーにより、書き込み操作を完了できなかった。
+
RES_WRPRT
+
メディアが書き込み禁止状態。
+
RES_PARERR
+
パラメータが不正。
+
RES_NOTRDY
+
ストレージ デバイスが動作可能な状態ではない (初期化されていない)。
+
+
+ + +
+

解説

+

buffに指定されるアドレスは常にワード アライメントされているとは限りません。これについては、disk_read関数の解説を参照してください。

+

一般的に、複数セクタの転送要求は、デバイスに対して可能な限りマルチ セクタ転送しなければなりません。複数のシングル セクタ書き込みに分解された場合、スループットが著しく低下することがあります。

+

FatFsはディスク制御レイヤが遅延書き込み機能を持つことも想定しています。この関数から戻るとき、デバイスが書き込みを実行中だったり単にライトバック キャッシュに書き込まれただけなど、必ずしもメディアへの書き込みが完了している必要はありません。ただし、buffのデータは、この関数から戻ると無効となります。書き込み完了の要求は、disk_ioctl関数のCTRL_SYNCコマンドによって行われます。このような遅延書き込み機能が実装された場合、書き込みスループットを向上させることができます。

+

アプリケーションからはこの関数を呼び出してはなりません。さもないと、FATボリュームが破壊される可能性があります。

+
+ + +
+

対応情報

+

リード オンリー構成(_FS_READONLY == 1)ではこの関数は必要とされません。

+
+ + +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/eof.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/eof.html new file mode 100644 index 0000000..dee0376 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/eof.html @@ -0,0 +1,62 @@ + + + + + + + + +FatFs - f_eof + + + + +
+

f_eof

+

リード/ライト ポインタがファイル終端に達しているかどうか調べます。.

+
+int f_eof (
+  FIL* fp   /* [IN] ファイル オブジェクト */
+);
+
+
+ + +
+

引数

+
+
fp
+
ファイル オブジェクト構造体へのポインタを指定します。
+
+
+ + +
+

戻り値

+

リード/ライト ポインタがファイル終端にあり読み出すデータがない場合は、0以外の値を返します。それ以外のときは0を返します。

+
+ + +
+

解説

+

この関数は、現リビジョンではマクロとして実装されています。ファイル オブジェクトの正当性チェックや排他制御は行いません。

+
+#define f_eof(fp) ((int)((fp)->fptr == (fp)->fsize))
+
+
+ + +
+

対応情報

+

常に使用可能。

+
+ + +
+

参照

+

f_open, f_lseek, FIL

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/error.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/error.html new file mode 100644 index 0000000..5e5510e --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/error.html @@ -0,0 +1,62 @@ + + + + + + + + +FatFs - f_error + + + + +
+

f_error

+

エラー発生の有無を調べます。

+
+int f_error (
+  FIL* fp   /* [IN] ファイル オブジェクト */
+);
+
+
+ + +
+

引数

+
+
fp
+
ファイル オブジェクト構造体へのポインタを指定します。
+
+
+ + +
+

戻り値

+

そのファイルにおいてハード エラーによって処理が中断されている場合は、0以外の値を返します。それ以外の時は0を返します。

+
+ + +
+

解説

+

この関数は、現リビジョンではマクロとして実装されています。ファイル オブジェクトの正当性チェックや排他制御は行いません。

+
+#define f_error(fp) ((fp)->err)
+
+
+ + +
+

対応情報

+

常に使用可能。

+
+ + +
+

参照

+

f_open, FIL

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/expand.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/expand.html new file mode 100644 index 0000000..a338121 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/expand.html @@ -0,0 +1,116 @@ + + + + + + + + +FatFs - f_expand + + + + +
+

f_expand

+

ファイルに連続したデータ領域を割り当てます。

+ +
+FRESULT f_expand (
+  FIL*    fp,  /* [IN] ファイル オブジェクト構造体へのポインタ */
+  FSIZE_t fsz, /* [IN] 割り当てサイズ */
+  BYTE    opt  /* [IN] 動作オプション */
+);
+
+
+ +
+

Parameters

+
+
fp
+
対象となるファイル オブジェクト構造体へのポインタを指定します。
+
fsz
+
ファイルに割り当てるバイト単位のサイズ。データ型FSIZE_tは、DWORD(32-bit)またはQWORD(64-bit)のエリアスで、exFATサポートの有無により切り替わります。
+
opt
+
実際に割り当てを行うかどうか指定するフラグ。
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_INVALID_OBJECT, +FR_DENIED, +FR_TIMEOUT +

+
+ + +
+

解説

+

optに1を指定すると、ファイルに連続したデータ領域を割り当てます。f_lseekによるサイズ拡張とは異なり、対象ファイルのサイズは0(つまりデータ領域未割り当て)でなければなりません。また、リード/ライト ポインタは、ファイル先頭に留まります。この関数により割り当てられたファイルの内容は未定義なので、それに対して何の前提も持つべきではありません。この関数は、次の理由によりFR_DENIEDで失敗することがあります。

+ +

optに0を指定したときは、連続したデータ領域を探すのみで、その時点ではファイルへの割り当てを行わず、代わりにそれを検索開始ポイントとしてファイル システム オブジェクトにセットします。これにより、そのボリューム上で別の操作(FAT変更を伴う)が行われない限り、書き込まれるファイルは少なくともそのサイズまでは連続性が保証され、遅延無く書き込めることになります。

+

時間的制約のあるファイル読み書き操作において、連続データ領域を割り当てられたファイルは有利となります。これは、分割されたファイルによりもたらされる無用なランダム アクセスが減ることにより、ファイル システムやストレージ デバイスの処理のオーバーヘッドが削減されるからです。特にexFATボリューム上の連続ファイルでは一切のFATアクセスが発生せず、効率的なシーケンシャル アクセスが行えます。

+

連続ファイルに対して低レベルI/Oを使用したさらに効率的な直接アクセスも容易に行えますが、これは将来の互換性の点で推奨はされません。

+
+ +
+

対応情報

+

_USE_EXPAND == 1で、かつ_FS_READONLY == 0のとき使用可能です。

+
+ + +
+

使用例

+
+    /* 連続ファイルの作成 */
+
+    /* 新しいファイルの作成 */
+    res = f_open(fp = malloc(sizeof (FIL)), "file.dat", FA_WRITE|FA_CREATE_ALWAYS);
+    if (res) { /* ファイルが開かれたかチェック */
+        free(fp);
+        ...
+    }
+
+    /* 100 MiB の連続領域を割り当てる */
+    res = f_expand(fp, 104857600, 1);
+    if (res) { /* 割り当てられたかチェック */
+        ...
+        free(fp);
+        ...
+    }
+    /* 連続ファイル作成成功 fp でアクセス可能 */
+
+
+
+    /* ファイル システムを介さず直接アクセスする例 */
+
+    /* ファイル データの物理的位置を取得 */
+    drv = fp->obj.fs->drv;
+    sect = fp->obj.fs->database + fp->obj.fs->csize * (fp->obj.sclust - 2);
+
+    /* ファイル先頭から2048セクタを書き込み */
+    res = disk_write(drv, buffer, sect, 2048);
+
+
+
+ + +
+

参照

+

f_open, f_lseek, FIL

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/fattime.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/fattime.html new file mode 100644 index 0000000..0b8f5ff --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/fattime.html @@ -0,0 +1,57 @@ + + + + + + + + +FatFs - get_fattime + + + + +
+

get_fattime

+

現在時刻を取得します。

+
+DWORD get_fattime (void);
+
+
+ + +
+

戻り値

+

現在のローカル タイムをDWORD値にパックして返します。ビット フィールドは次に示すようになります。

+
+
bit31:25
+
1980年を起点とした年を 0..127 でセット。
+
bit24:21
+
月を 1..12 の値でセット。
+
bit20:16
+
日を 1..31 の値でセット。
+
bit15:11
+
時を 0..23 の値でセット。
+
bit10:5
+
分を 0..59 の値でセット。
+
bit4:0
+
秒/2を 0..29 の値でセット
+
+
+ + +
+

解説

+

RTCをサポートしないシステムでも、ダミーとして何らかの日付として有効な値を返すべきです。0などを返した場合、そのファイルのタイムスタンプは無効になります。

+
+ + +
+

対応情報

+

リード オンリー構成(_FS_READONLY == 1)または、非RTCサポート構成(_RTC_NOUSE == 1)ではこの関数は必要とされません。

+
+ + +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/fdisk.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/fdisk.html new file mode 100644 index 0000000..ecf97cc --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/fdisk.html @@ -0,0 +1,92 @@ + + + + + + + + +FatFs - f_fdisk + + + + +
+

f_fdisk

+

物理ドライブを分割します。

+
+FRESULT f_fdisk (
+  BYTE  pdrv,       /* [IN] 物理ドライブ番号 */
+  const DWORD* szt, /* [IN] 区画サイズ テーブル */
+  void* work        /* [-] ワークエリア */
+);
+
+
+ +
+

引数

+
+
pdrv
+
分割する物理ドライブを指定します。これは論理ドライブ番号ではなく、ディスク関数に渡される物理ドライブ番号です。
+
szt
+
区画サイズ テーブルの先頭項目へのポインタを指定します。
+
work
+
ワークエリアへのポインタを指定します。サイズは_MAX_SSバイト必要です。
+
+
+ +
+

戻り値

+

+FR_OK, +FR_DISK_ERR, +FR_NOT_READY, +FR_WRITE_PROTECTED, +FR_INVALID_PARAMETER +

+
+ +
+

説明

+

この関数は、指定された物理ドライブのMBRに区画テーブルを作成します。区画分けは一般的なFDISK形式で行うため、最大4つの基本区画を作成することができます。拡張区画には対応していません。区画サイズ テーブルにはドライブをどのように分割するか指定します。この配列は4つの項目から成り、先頭の項目が1番目の区画のサイズを示します。項目の値が100以下の場合、その区画のドライブの総容量に対する割合をパーセント単位で指定します。100を超える値の場合はセクタ数の直接指定になります。ドライブ上への区画の配置順は、項目順になります。

+
+ +
+

対応情報

+

_FS_READOLNY == 0_USE_MKFS == 1_MULTI_PARTITION == 1 のとき使用可能です。

+
+ +
+

使用例

+
+    /* ユーザ定義のボリューム管理テーブル (_MULTI_PARTITION == 1 のとき必要) */
+
+    PARTITION VolToPart[] = {
+        {0, 1},    /* 論理ドライブ 0 ==> 物理ドライブ 0, 第1区画 */
+        {0, 2},    /* 論理ドライブ 1 ==> 物理ドライブ 0, 第2区画 */
+        {1, 0}     /* 論理ドライブ 2 ==> 物理ドライブ 1, 自動検出 */
+    };
+
+
+    /* 新しい物理ドライブ(0)の初期化 */
+
+    FATFS fs;
+    DWORD plist[] = {50, 50, 0, 0};  /* 第1区画,第2区画それぞれに50%ずつ割り当て */
+    BYTE work[_MAX_SS];
+
+    f_fdisk(0, plist, work);                    /* 物理ドライブ 0 の分割 */
+
+    f_mkfs("0:", FMT_ANY, work, sizeof work);   /* 論理ドライブ 0: のフォーマット */
+    f_mkfs("1:", FMT_ANY, work, sizeof work);   /* 論理ドライブ 1: のフォーマット */
+
+
+
+ +
+

参照

+

ボリューム管理, f_mkfs

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/filename.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/filename.html new file mode 100644 index 0000000..70d30e1 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/filename.html @@ -0,0 +1,83 @@ + + + + + + + + +FatFs - パス名のフォーマット + + + +

パス名のフォーマット

+
+

ファイル ディレクトリ名

+

FatFsモジュールでは、パス名によるファイル、ディレクトリ、ドライブの指定方法はDOS/Windows APIとほぼ同じです。パス名のフォーマットは次の通りです。

+
"[論理ドライブ番号:][/]ディレクトリ名/ファイル名"
+

FatFsモジュールは長いファイル名(LFN)および8.3形式ファイル名(SFN)に対応しています。LFNは、(_USE_LFN > 0)のとき使用可能になります。ディレクトリ セパレータにはDOS/Windows APIと同じく'/''\'を使用します。連続したセパレータは無視され1個として扱われます。唯一の違いは、論理ドライブの指定だけです。論理ドライブ番号は、'0''9'の一文字の数字とコロンで指定し、省略した場合はデフォルト ドライブ(0またはカレント ドライブ)が選択されます。

+

ヌル文字や制御文字('\0''\x1F')は、パス名の終端として認識されます。パス名に先行あるいは中に含まれるスペースは、LFN構成では名前の一部として有効ですが、非LFN構成ではスペースはパス名の終端として認識されます。

+

標準構成(_FS_RPATH == 0)のときは、全てのオブジェクトがルート ディレクトリから辿る絶対パスで指定されます。OS指向なカレント ディレクトリという概念は無く、またドット ディレクトリ(".""..")は使用できません。パス名先頭のセパレータは無視されます。デフォルト ドライブ番号は常に0になります。

+

相対パスを有効(_FS_RPATH >= 1)にしたときは、先行するセパレータの有無によって検索開始ディレクトリが変わり、セパレータがある場合はルート ディレクトリから、無い場合はf_chdir関数で設定されるカレント ディレクトリからになります。またパス名にドット ディレクトリが使用できます。デフォルト ドライブ番号はf_chdrive関数で設定された値となります。

+ + + + + + + + + + + + + +
パス名の例_FS_RPATH == 0_FS_RPATH >= 1
file.txtドライブ0のルート ディレクトリ下のファイルカレント ドライブのカレント ディレクトリ下のファイル
/file.txtドライブ0のルート ディレクトリ下のファイルカレント ドライブのルート ディレクトリ下のファイル
ドライブ0のルート ディレクトリカレント ドライブのカレント ディレクトリ
2:ドライブ2のルート ディレクトリドライブ2のカレント ディレクトリ
2:file1.txtドライブ2のルート ディレクトリ下のファイルドライブ2のカレント ディレクトリ下のファイル
2:/ドライブ2のルート ディレクトリドライブ2のルート ディレクトリ
../file.txt無効親ディレクトリ下のファイル
.無効このディレクトリ
..無効カレント ディレクトリの親ディレクトリ
dir1/..無効カレント ディレクトリ
/..無効ルート ディレクトリ(その上は辿れない)
+

また、_STR_VOLUME_IDオプションを有効にすることでドライブ番号の識別には数字のほか、"sd:file1.txt""ram:swapfile.dat"のように、任意の文字列(もちろんDOS/Windowsライクなドライブ文字も)を使用することも可能になります。

+

【注意】現リビジョン(R0.12)では、exFATボリューム上においてダブル ドット".."はシングル ドット"."として機能し、親ディレクトリを辿ることはできません。

+
+ +
+

使用可能な文字と大文字小文字の識別

+

FATファイル システムでファイル名に使用可能な文字は、0~9 A~Z ! # $ % & ' ( ) - @ ^ _ ` { } ~および拡張文字(\x80\xFF)となっています。LFN拡張ではこれらに加え、+ , ; = [ ]およびスペースが使用可能になり、スペースとピリオドはファイル名の末尾を除く任意の位置に挿入できます。

+

FATファイル システムでは、パス名についてケース インセンシティブです。たとえば、file.txt, File.Txt, FILE.TXTの3つの名前は同じ物として扱われます。これは、ASCII文字だけでなく拡張文字についても適用されます。ファイルが作成される際、SFNエントリには全て大文字に変換された名前が記録されます。LFN対応システムでは、LFNエントリには大文字変換されない名前が記録されます。

+

古い日本語MS-DOSでは拡張文字(いわゆる全角文字)についてはケース センシティブでした。FatFsモジュールではこれにしたがい、非LFN構成で文字コードにDBCSが選択されたときに限り、拡張文字に対して大文字変換を行わずにSFNエントリに記録および検索されます(日本語MSDOS仕様)。LFN構成では拡張文字についても大文字変換を行います(WindowsNT仕様)。このため、非LFN構成で全角小文字を含む名前でファイルを作成すると、Windowsでそのファイルを開けなくなるなどの互換性問題を起こすので、それらのシステムで相互利用するボリューム上ではDBCS拡張文字の使用は避けるべきです。

+
+ +
+

Unicode API

+

ファイル関数の入出力のうちファイル名やパス名を指定する引数の型は、TCHARで定義されていますが、これは通常はcharのエリアスになっています。そして、_CODE_PAGEで指定されるANSI/OEMコード(SBCSまたはDBCS)の文字列として扱われます。ファイル名入出力をUnicodeとする構成(_LFN_UNICODE == 1)にしたときは、TCHARはワイド文字(WCHAR, unsigned short)に切り替わり、パス名の入出力にUnicodeを使用するようになります。これによりLFN規格に完全対応となり、ファイル名としてANSI/OEMコードにない文字(たとえば ✝☪✡☸☭など)も使用できます。この設定は文字列入出力関数においては、データ型とファイル上のエンコーディングに影響を与えます。リテラル文字列を定義するとき、次に示すように_T(s)および_TEXT(s)マクロを使ってANSI/OEMとUnicodeを自動切り替えすることができます。

+
+ f_open(fp, "filename.txt", FA_READ);      /* ANSI/OEM専用コード */
+ f_open(fp, L"filename.txt", FA_READ);     /* Unicode専用コード */
+ f_open(fp, _T("filename.txt"), FA_READ);  /* 両用コード(自動切り替え) */
+
+
+ +
+

ボリューム管理

+

デフォルトの構成では、それぞれの論理ドライブは同じ番号の物理ドライブに1:1で結びつけられていて、自動検出機能によりその物理ドライブ上の一つのFATボリュームがマウントされます。FATボリュームの検出は、セクタ0(SFD)、第一区画~第四区画(FDISK)の順に行われます。

+

_MULTI_PARTITIONに1を指定すると、それぞれの論理ドライブに対して個別に物理ドライブ番号と区画を指定できるようになります。この構成では、論理ドライブと区画の対応を解決するためのテーブルを次に示すように定義する必要があります。

+
+例:論理ドライブ0~2を物理ドライブ0(非リムーバブル)の3つの基本区画に割り当て、
+   論理ドライブ3を物理ドライブ1(リムーバブル)に割り当てる場合。
+
+PARTITION VolToPart[] = {
+    {0, 1},     /* "0:" ==> 物理ドライブ 0, 第1区画 */
+    {0, 2},     /* "1:" ==> 物理ドライブ 0, 第2区画 */
+    {0, 3},     /* "2:" ==> 物理ドライブ 0, 第3区画 */
+    {1, 0}      /* "3:" ==> 物理ドライブ 1, 自動検出 */
+};
+
+
論理ドライブと物理ドライブの関係
+

複数区画指定を使用する場合、次の点に注意しなければなりません。 +

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/findfirst.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/findfirst.html new file mode 100644 index 0000000..1d92880 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/findfirst.html @@ -0,0 +1,110 @@ + + + + + + + + +FatFs - f_findfirst + + + + +
+

f_findfirst

+

ディレクトリ内のオブジェクトの検索を開始します。

+
+FRESULT f_findfirst (
+  DIR* dp,              /* [OUT] ディレクトリ オブジェクト構造体へのポインタ */
+  FILINFO* fno,         /* [OUT] ファイル情報構造体へのポインタ */
+  const TCHAR* path,    /* [IN] ディレクトリ名へのポインタ */
+  const TCHAR* pattern  /* [IN] マッチ パターン文字列へのポインタ */
+);
+
+
+ +
+

引数

+
+
dp
+
空のディレクトリ オブジェクト構造体へのポインタを指定します。
+
fno
+
最初にマッチしたディレクトリ項目を格納するファイル情報構造体へのポインタを指定します。
+
path
+
オープンするディレクトリのパス名を示すヌル文字'\0'終端の文字列へのポインタを指定します。
+
pattern
+
検索する名前を示すヌル文字'\0'終端の文字列へのポインタを指定します。この文字列は、続くf_findnext関数でも参照されるため、一連の処理が終了するまで有効でなければなりません。
+
+
+ + +
+

戻り値

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_NO_PATH, +FR_INVALID_NAME, +FR_INVALID_OBJECT, +FR_INVALID_DRIVE, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT, +FR_NOT_ENOUGH_CORE, +FR_TOO_MANY_OPEN_FILES +

+
+ + +
+

解説

+

pathで指定されるディレクトリを開き、そのディレクトリ内の項目の検索を開始します。正常終了すると、ディレクトリ オブジェクト構造体が作成され、最初に検索名文字列に名前がマッチした項目の情報がfnoの指定するファイル情報構造体にストアされます。名前のマッチする項目が見つからなかった場合は、fno->fname[]にヌル文字列が返されます。ファイル情報構造体の使い方については、f_readdir関数を参照してください。

+

マッチ パターン文字列は、ワイルドカード文字(?*)を含むことができます。?は任意の1文字に、*は0文字以上の任意の文字列にマッチします。LFN構成では、_USE_FIND = 1のときfname[]のみテストし、_USE_FIND = 2のときはaltname[]もテストします。現リビジョンではパターン マッチングにおいて次の点で標準システムとは異なる動作となります。

+ +
+ + +
+

対応情報

+

この関数は、f_opendir関数およびf_readdir関数のラッパー関数です。_USE_FIND >= 1で、かつ_FS_MINIMIZE <= 1のとき使用可能になります。

+
+ + +
+

使用例

+
+/* ディレクトリ内のオブジェクトの検索と表示 */
+
+void find_image (void)
+{
+    FRESULT fr;     /* API戻り値 */
+    DIR dj;         /* ディレクトリ オブジェクト */
+    FILINFO fno;    /* ファイル情報 */
+
+    fr = f_findfirst(&dj, &fno, "", "dsc*.jpg");  /* "dsc"で始まるJPEGファイルを検索 */
+
+    while (fr == FR_OK && fno.fname[0]) {         /* 見つかる間繰り返し */
+        printf("%s\n", fno.fname);                /* 見つけた項目の名前を表示 */
+        fr = f_findnext(&dj, &fno);               /* 次を検索 */
+    }
+    f_closedir(&dj);
+}
+
+
+ + +
+

参照

+

f_findnext, f_closedir, DIR, FILINFO

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/findnext.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/findnext.html new file mode 100644 index 0000000..c1bf3f7 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/findnext.html @@ -0,0 +1,68 @@ + + + + + + + + +FatFs - f_findnext + + + + +
+

f_findnext

+

次にマッチするオブジェクトを検索します。

+
+FRESULT f_findnext (
+  DIR* dp,              /* [IN] ディレクトリ構造体へのポインタ */
+  FILINFO* fno          /* [OUT] ファイル情報構造体へのポインタ */
+);
+
+
+ +
+

引数

+
+
dp
+
f_findfirst関数で作成された有効なディレクトリ構造体へのポインタを指定します。
+
fno
+
マッチしたディレクトリ項目を格納するファイル情報構造体へのポインタを指定します。
+
+
+ + +
+

戻り値

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_INVALID_OBJECT, +FR_TIMEOUT, +FR_NOT_ENOUGH_CORE +

+
+ + +
+

解説

+

次に名前のマッチするディレクトリ項目を検索し、見つかった項目をファイル情報構造体にストアします。名前のマッチする項目が見つからずディレクトリの最後まで達した場合は、fno->fname[]にヌル文字列が返されます。

+
+ + +
+

対応情報

+

この関数は、f_readdir関数のラッパー関数です。_USE_FIND >= 1で、かつ_FS_MINIMIZE <= 1のとき使用可能になります。

+
+ + +
+

参照

+

f_findfirst, f_closedir, DIR, FILINFO

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/forward.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/forward.html new file mode 100644 index 0000000..99456b2 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/forward.html @@ -0,0 +1,139 @@ + + + + + + + + +FatFs - f_forward + + + + +
+

f_forward

+

ファイルからデータを読み出し、送信ストリームに直接転送します。

+
+FRESULT f_forward (
+  FIL* fp,                         /* [IN] ファイル オブジェクト構造体 */
+  UINT (*func)(const BYTE*,UINT),  /* [IN] データ転送関数 */
+  UINT btf,                        /* [IN] 転送するバイト数 */
+  UINT* bf                         /* [OUT] 転送されたバイト数 */
+);
+
+
+ +
+

引数

+
+
fp
+
ファイル オブジェクト構造体へのポインタを指定します。
+
func
+
データを渡すユーザ定義関数へのポインタを指定します。この関数の仕様はサンプルを参照してください。
+
btf
+
転送するバイト数(0~UINTの最大値)を指定します。
+
bf
+
実際に転送されたバイト数を格納する変数を指すポインタを指定します。
+
+
+ + +
+

戻り値

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_DENIED, +FR_INVALID_OBJECT, +FR_TIMEOUT +

+
+ + +
+

解説

+

ファイルのデータをバッファに読み出さずに送信ストリームに直接転送します。アプリケーション側でデータ バッファを必要としないので、メモリの限られた環境で有効です。リード/ライト ポインタは転送されたバイト数だけ進みます。指定されたバイト数の転送中にファイルの終端に達した場合や送信ストリームがビジーになった場合、*bfbtfよりも小さくなります。

+
+ + +
+

対応情報

+

_USE_FORWARD == 1のときに使用可能です。

+
+ + +
+

使用例(オーディオ再生)

+
+/*-----------------------------------------------------------------------*/
+/* f_forward関数から呼ばれるデータ送信関数の例                           */
+/*-----------------------------------------------------------------------*/
+
+UINT out_stream (   /* 戻り値: 転送されたバイト数またはストリームの状態 */
+    const BYTE *p,  /* 転送するデータを指すポインタ */
+    UINT btf        /* >0: 転送を行う(バイト数). 0: ストリームの状態を調べる */
+)
+{
+    UINT cnt = 0;
+
+
+    if (btf == 0) {     /* センス要求 */
+        /* ストリームの状態を返す (0: ビジー, 1: レディ) */
+        /* 一旦、レディを返したら、続く転送要求で少なくとも1バイトは */
+        /* 転送されないと f_forward関数は FR_INT_ERR となる。 */
+        if (FIFO_READY) cnt = 1;
+    }
+    else {              /* 転送要求 */
+        do {    /* 全てのバイトを転送するか、ストリームがビジーになるまで繰り返す */
+            FIFO_PORT = *p++;
+            cnt++;
+        } while (cnt < btf && FIFO_READY);
+    }
+
+    return cnt;
+}
+
+
+/*-----------------------------------------------------------------------*/
+/* f_forward関数の使用例                                                 */
+/*-----------------------------------------------------------------------*/
+
+FRESULT play_file (
+    char *fn        /* 再生するオーディオ ファイル名を指すポインタ */
+)
+{
+    FRESULT rc;
+    FIL fil;
+    UINT dmy;
+
+    /* ファイルを読み出しモードで開く */
+    rc = f_open(&fil, fn, FA_READ);
+    if (rc) return rc;
+
+    /* 全てのデータが転送されるかエラーが発生するまで続ける */
+    while (rc == FR_OK && !f_eof(&fil)) {
+
+        /* ほかの処理... */
+
+        /* 定期的または要求に応じてデータをストリームに送出する */
+        rc = f_forward(&fil, out_stream, 1000, &dmy);
+    }
+
+    /* ファイルを閉じて戻る */
+    f_close(&fil);
+    return rc;
+}
+
+
+ + +
+

参照

+

f_open, fgets, f_write, f_close, FIL

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/getcwd.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/getcwd.html new file mode 100644 index 0000000..08bd22a --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/getcwd.html @@ -0,0 +1,71 @@ + + + + + + + + +FatFs - f_getcwd + + + + +
+

f_getcwd

+

カレント ディレクトリを得ます。

+
+FRESULT f_getcwd (
+  TCHAR* buff, /* [OUT] バッファ */
+  UINT len     /* [IN] バッファ サイズ */
+);
+
+
+ +
+

引数

+
+
buff
+
カレント ディレクトリのパス名文字列を格納するバッファ
+
len
+
TCHAR単位のバッファ サイズ
+
+
+ + +
+

戻り値

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT, +FR_NOT_ENOUGH_CORE +

+
+ + +
+

解説

+

カレント ドライブのカレント ディレクトリのフル パス文字列を取得します。_VOLUMESが2以上のときは、論理ドライブ番号の付加されたパス名となります。

+

現リビジョン(R0.12)では、exFATボリューム上ではカレント ディレクトリを得ることが出来ません。常にルート ディレクトリを返します。

+
+ + +
+

対応情報

+

_FS_RPATH == 2のとき使用可能です。

+
+ + +
+

参照

+

f_chdrive, f_chdir

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/getfree.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/getfree.html new file mode 100644 index 0000000..c821517 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/getfree.html @@ -0,0 +1,95 @@ + + + + + + + + +FatFs - f_getfree + + + + +
+

f_getfree

+

ボリューム上の空き領域のサイズを取得します。

+
+FRESULT f_getfree (
+  const TCHAR* path,  /* [IN] 対象ドライブを指定します */
+  DWORD* nclst,       /* [OUT] 空きクラスタ数を格納する変数へのポインタ */
+  FATFS** fatfs       /* [OUT] ファイル システム オブジェクトを指すポインタへのポインタ */
+);
+
+
+ +
+

引数

+
+
path
+
調べる対象の論理ドライブを示すパス名を示すヌル文字'\0'終端の文字列へのポインタを指定します。ヌル文字列はカレント ドライブを意味します。
+
nclst
+
空きクラスタ数を格納するDWORD型変数へのポインタを指定します。
+
fatfs
+
対象ドライブのファイル システム オブジェクトを指すポインタが返されます。
+
+
+ + +
+

戻り値

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_INVALID_DRIVE, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT +

+
+ + +
+

解説

+

論理ドライブ上の空き領域のサイズをクラスタ単位で取得します。返されたファイル システム オブジェクトのcsizeメンバがクラスタあたりのセクタ数を示しているので、これを元にセクタ単位の空きサイズが計算できます。FAT32ボリュームにおいては、FSINFOの情報が実際の空きクラスタ数と同期していない場合、不正確な値を返す可能性があります。この問題を避けるため、_FS_NOFSINFOオプションでマウント後の初回は必ずフルFATスキャンをするように構成することもできます。

+
+ + +
+

対応情報

+

_FS_READONLY == 0で、且つ_FS_MINIMIZE == 0のとき使用可能です。

+
+ + +
+

使用例

+
+    FATFS *fs;
+    DWORD fre_clust, fre_sect, tot_sect;
+
+
+    /* ドライブ1のボリューム情報と空きクラスタ数を得る */
+    res = f_getfree("1:", &fre_clust, &fs);
+    if (res) die(res);
+
+    /* 全セクタ数と空きセクタ数を計算 */
+    tot_sect = (fs->n_fatent - 2) * fs->csize;
+    fre_sect = fre_clust * fs->csize;
+
+    /* ボリュームのサイズと空きサイズを表示 (512バイト/セクタと仮定) */
+    printf("%10lu KiB total drive space.\n%10lu KiB available.\n",
+           tot_sect / 2, fre_sect / 2);
+
+
+ + +
+

参照

+FATFS +
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/getlabel.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/getlabel.html new file mode 100644 index 0000000..160dcf0 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/getlabel.html @@ -0,0 +1,82 @@ + + + + + + + + +FatFs - f_getlabel + + + + +
+

f_getlabel

+

ボリューム ラベルを取得します。

+
+FRESULT f_getlabel (
+  const TCHAR* path,  /* [IN] 対象ドライブ */
+  TCHAR* label,       /* [OUT] ボリューム名を格納するバッファ */
+  DWORD* vsn          /* [OUT] ボリューム シリアル番号を格納する変数 */
+);
+
+
+ +
+

引数

+
+
path
+
対象となる論理ドライブのパス名を示すヌル文字'\0'終端の文字列へのポインタを指定します。ヌル文字列の場合は、デフォルト ドライブを指定したことになります。
+
label
+
ボリューム名を格納する配列へのポインタを指定します。_LFN_UNICODE == 0では少なくとも24要素、_LFN_UNICODE == 1では少なくとも12要素のサイズが必要です。ボリューム名がない場合はヌル文字列が返されます。この情報が不要なときはヌル ポインタを指定してください。
+
vsn
+
ボリューム シリアル番号を格納するDWORD型変数へのポインタを指定します。この情報が不要なときはヌル ポインタを指定してください。
+
+
+ + +
+

戻り値

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_INVALID_DRIVE, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT +

+
+ + +
+

対応情報

+

_USE_LABEL == 1のときに使用可能です。

+
+ + +
+

使用例

+
+    char str[24];
+
+    /* デフォルト ドライブのボリューム名を得る */
+    f_getlabel("", str, 0);
+
+    /* ドライブ2のボリューム名を得る */
+    f_getlabel("2:", str, 0);
+
+
+ + +
+

参照

+f_setlabel +
+ + +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/gets.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/gets.html new file mode 100644 index 0000000..e57f7e8 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/gets.html @@ -0,0 +1,65 @@ + + + + + + + + +FatFs - f_gets + + + + +
+

f_gets

+

ファイルから文字列を読み出します。

+
+TCHAR* f_gets (
+  TCHAR* buff, /* [OUT] バッファ */
+  int len,     /* [IN] バッファのサイズ */
+  FIL* fp      /* [IN] ファイル オブジェクト */
+);
+
+
+ +
+

引数

+
+
buff
+
文字列を読み出すバッファを指すポインタを指定します。
+
len
+
バッファのサイズを要素数で指定します。
+
fp
+
ファイル オブジェクト構造体へのポインタを指定します。
+
+
+ + +
+

戻り値

+

関数が成功するとbuffが返されます。

+
+ + +
+

解説

+

読み出し動作は、最初の'\n'を読み込むか、ファイル終端に達するか、len - 1文字を読み出すまで続きます。読み込まれた文字列の終端には'\0'が付加されます。既にファイル終端で1文字も読み込まれなかったとき、または何らかのエラーが発生したときは関数は失敗しヌル ポインタを返します。ファイル終端かエラーかはf_eof/f_error関数で調べられます。

+

Unicode API構成(_LFN_UNICODE == 1)が選択されているときは、buffはUTF-16文字列になりますが、ファイル上のエンコードは、_STRF_ENCODEオプションで選択できます。それ以外の時は無変換(1バイト/1文字)で読み出します。

+
+ + +
+

対応情報

+

この関数はf_read関数のラッパー関数です。_USE_STRFUNCが1または2のとき使用可能です。2のときは、ファイルに含まれる'\r'が取り除かれてバッファに読み込まれます。

+
+ + +
+

参照

+

f_open, f_read, f_putc, f_puts, f_printf, f_close, FIL

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/lseek.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/lseek.html new file mode 100644 index 0000000..59f801c --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/lseek.html @@ -0,0 +1,130 @@ + + + + + + + + +FatFs - f_lseek + + + + +
+

f_lseek

+

ファイルのリード/ライト ポインタを移動します。また、高速シーク機能使用時にはCLMT(後述)の作成にも使用します。

+
+FRESULT f_lseek (
+  FIL* fp,      /* [IN] ファイル オブジェクト構造体へのポインタ */
+  FSIZE_t ofs   /* [IN] 移動先オフセット */
+);
+
+
+ +
+

引数

+
+
fp
+
対象となるファイル オブジェクト構造体へのポインタを指定します。
+
ofs
+
移動先のオフセット(リード/ライト ポインタ)値。ファイル先頭からのオフセットをバイト単位で指定します。データ型FSIZE_tは、DWORD(32-bit)またはQWORD(64-bit)のエリアスで、exFATサポートの有無により切り替わります。
+
+
+ + +
+

戻り値

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_INVALID_OBJECT, +FR_TIMEOUT, +FR_NOT_ENOUGH_CORE +

+
+ + +
+

解説

+

ファイルのリード/ライト ポインタ(次に読み出し・書き込みされるバイトのオフセット)を移動します。オフセットの原点はファイル先頭です。書き込みモードでファイル サイズより大きな値を指定すると、そこまでファイル サイズが拡張され、拡張された部分のデータは未定義となります。データを遅延無く高速に書き込みたいときは、予めこの関数で必要なサイズまでファイル サイズを拡張しておくと良いでしょう。ファイルに連続したデータ領域を割り当てる必要があるときは、f_expand関数を使用してください。f_lseek関数が正常終了したあとは、リード/ライト ポインタが正しく移動したかチェックするべきです。リード/ライト ポインタが指定より小さいときは、次の原因が考えられます。

+ +

高速シーク モードは、ファイルのクラスタ配置情報(CLMT)をメモリ上に保持しておくことにより、FATにアクセスすることなく後方シークやロング シークを高速に行う機能で、シーク動作のほかf_read/f_wtite関数の動作にも適用されます。ファイルが高速シーク モードの間はf_wtite/f_lseek関数によるファイル サイズの拡張はできません。

+

高速シーク モードは、ファイル オブジェクトのメンバcltbl(f_open関数でNULLになる)にNULL以外を設定したとき有効になるので、まずCLMTを作成しておく必要があります。これを作成するには、まずCLMT格納バッファ(DWORD型配列)を準備し、cltblにそのポインタをセットします。そして、配列の先頭要素にその配列のサイズ(要素数)を入れ、f_lseek関数をofsCREATE_LINKMAPを指定して呼び出します。関数が成功するとCLMTが作成され、以降のf_read/f_write/f_lseek関数ではFATへのアクセスは発生しません。CLMTの先頭要素には実際に使用した(または必要となる)要素数が返されます。使用される要素数は、(ファイルの分割数 + 1) * 2 です。たとえば、ファイルが5つのフラグメントに分断されているときは、12要素が使用されます。FR_NOT_ENOUGH_COREで失敗したときは、配列サイズが不足です。

+
+ + +
+

対応情報

+

_FS_MINIMIZE < 3のとき使用可能です。高速シーク モードを利用するときは、_USE_FASTSEEK == 1である必要があります。

+
+ + +
+

使用例

+
+    /* ファイルを開く */
+    fp = malloc(sizeof (FIL));
+    res = f_open(fp, "file.dat", FA_READ|FA_WRITE);
+    if (res) ...
+
+    /* ファイル オフセット5000へ移動 */
+    res = f_lseek(fp, 5000);
+
+    /* ファイル終端へ移動(ファイル追記の準備) */
+    res = f_lseek(fp, f_size(fp));
+
+    /* 3000バイト進める */
+    res = f_lseek(fp, f_tell(fp) + 3000);
+
+    /* 2000バイト戻す (ラップアラウンドに注意) */
+    res = f_lseek(fp, f_tell(fp) - 2000);
+
+
+/* クラスタ先行割り当て (ストリーミング ライト時のバッファ オーバーラン防止) */
+
+    res = f_open(fp, "record.wav", FA_CREATE_NEW | FA_WRITE);    /* ファイル作成 */
+
+    res = f_lseek(fp, MAX_SIZE);             /* 十分なクラスタの先行割り当て */
+    if (res || f_tell(fp) != PRE_SIZE) ...   /* 正しくファイルが拡張されたかチェック */
+
+    res = f_lseek(fp, DATA_START);           /* データ ストリームの記録(アロケーションディレイ無し) */
+    ...
+
+    res = f_truncate(fp);                    /* 不要領域の切り捨て */
+    res = f_lseek(fp, 0);                    /* ヘッダの記録 */
+    ...
+
+    res = f_close(fp);
+
+
+/* 高速シーク機能を使う */
+
+    DWORD clmt[SZ_TBL];                    /* リンク マップ テーブル格納バッファ */
+
+    res = f_open(fp, fname, FA_READ | FA_WRITE);   /* ファイルを開く */
+
+    res = f_lseek(fp, ofs1);               /* 通常シーク (オープン時、cltblはNULLに初期化される) */
+
+    fp->cltbl = clmt;                      /* 高速シーク機能の有効化 */
+    clmt[0] = SZ_TBL;                      /* 先頭要素に配列要素数をセット */
+    res = f_lseek(fp, CREATE_LINKMAP);     /* CLMTの作成 */
+    ...
+
+    res = f_lseek(fp, ofs2);               /* 以降、f_read/f_write/f_lseekでFATアクセスは発生しない */
+
+
+ + +
+

参照

+

f_open, f_truncate, f_expand, FIL

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/mkdir.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/mkdir.html new file mode 100644 index 0000000..eb301f5 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/mkdir.html @@ -0,0 +1,80 @@ + + + + + + + + +FatFs - f_mkdir + + + + +
+

f_mkdir

+

サブ ディレクトリを作成します。

+
+FRESULT f_mkdir (
+  const TCHAR* path /* [IN] 作成するディレクトリ名へのポインタ */
+);
+
+
+ +
+

引数

+
+
path
+
作成するディレクトリのパス名を示すヌル文字'\0'終端の文字列へのポインタを指定します。
+
+
+ + +
+

戻り値

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_NO_PATH, +FR_INVALID_NAME, +FR_DENIED, +FR_EXIST, +FR_WRITE_PROTECTED, +FR_INVALID_DRIVE, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT, +FR_NOT_ENOUGH_CORE +

+
+ + +
+

解説

+

空のサブ ディレクトリを作成します。ディレクトリを削除するときはf_unlink関数を使用してください。

+
+ + +
+

対応情報

+

_FS_READONLY == 0で、且つ_FS_MINIMIZE == 0のとき使用可能です。

+
+ + +
+

使用例

+
+    res = f_mkdir("sub1");
+    if (res) die(res);
+    res = f_mkdir("sub1/sub2");
+    if (res) die(res);
+    res = f_mkdir("sub1/sub2/sub3");
+    if (res) die(res);
+
+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/mkfs.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/mkfs.html new file mode 100644 index 0000000..7aacdd8 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/mkfs.html @@ -0,0 +1,114 @@ + + + + + + + + +FatFs - f_mkfs + + + + +
+

f_mkfs

+

論理ドライブ上にFAT/exFATボリュームを作成(フォーマット)します。

+
+FRESULT f_mkfs (
+  const TCHAR* path,  /* [IN] 論理ドライブ番号 */
+  BYTE  opt,          /* [IN] フォーマット オプション */
+  DWORD au,           /* [IN] クラスタ サイズ */
+  void* work,         /* [-]  ワーク エリア */
+  UINT len            /* [IN] ワーク エリアのサイズ */
+);
+
+
+ +
+

引数

+
+
path
+
フォーマット対象の論理ドライブを示すパス名を示すヌル文字'\0'終端の文字列へのポインタを指定します。ドライブ番号を含まない場合は、デフォルト ドライブを意味します。論理ドライブにはf_mount関数でワークエリアが与えられている必要はありません。
+
opt
+
フォーマット オプション。FM_FAT, FM_FAT32, FM_EXFATの各フラグの組み合わせ(FM_ANYは、これらのOR値)で作成するFATボリュームのタイプを指定します。複数のタイプが指定された場合、その中のいずれかが自動選択されます。exFATが無効のときは、FM_EXFATは無視されます。FM_SFDフラグを指定すると、SFD形式(後述)でボリュームを配置します。
+
au
+
クラスタ サイズをバイト単位で指定します。有効値は、セクタ サイズのN倍となります。Nは2の累乗で、FAT/FAT32ボリュームでは1~128、exFATボリュームでは1~32768です。0を指定した場合は、ボリュームのサイズと選択されたFATタイプに応じたデフォルトのクラスタ サイズが選択されます。
+
work
+
ワークエリアへのポインタを指定します。
+
len
+
ワークエリアのサイズをバイト単位で指定します。ワークエリアのサイズは少なくとも関連するドライブのセクタサイズは必要です。また、十分に大きなサイズを与えることにより、書き込みトランザクションの回数が減ってフォーマット時間を短縮できます。
+
+
+ +
+

戻り値

+

+FR_OK, +FR_DISK_ERR, +FR_NOT_READY, +FR_MKFS_ABORTED, +FR_INVALID_PARAMETER +

+
+ +
+

説明

+

exFAT以外のボリュームのFATタイプ(FAT12/FAT16/FAT32)は、そのボリューム上のクラスタ数によってのみ決定される決まり[FAT仕様書より]になっていて、それ以外の要因はありません。したがって、どのFATタイプになるかはボリューム サイズとクラスタ サイズに依存します。そのボリュームのサイズにおいて、指定されたFATタイプとクラスタ サイズの組み合わせが成立し得ないときは、関数はFR_MKFS_ABORTEDで失敗します。

+

クラスタとは、データ格納領域の管理の単位のことで、これを単位にファイルにデータ領域が割り当てられます。たとえば、クラスタ サイズが32768のときは、100バイトのファイルも32768バイトのスペースを消費することになります。このように、クラスタ サイズを大きくするほどボリュームの利用効率が悪くなりますが、その一方で読み書きの性能は上がります。クラスタ サイズによる利用効率と性能はトレード オフの関係にあります。GBクラスのストレージでは、極端に多くのファイルを扱わない限り32768バイト以上に(デフォルト指定ではそのようになる)しておくとよいでしょう。

+

パーテーション形式には、FDISK形式とSFD形式の二通りあります。FDISK形式は、ハードディスク、マルチメディアカード、SDカード、CFカード、USBメモリなどで標準的に使用されます。FDISK形式では一台の物理ドライブ上に一つまたは複数の区画を作成することができ、区画管理情報はMBR(物理ドライブの先頭セクタ)に記録されます。SFD形式は単に何の分割も行わない形式で、ボリュームは物理ドライブの先頭セクタから開始します。SFD形式は、フロッピー ディスク、マイクロドライブ、光学ディスク、およびその他スーパー フロッピー メディアで標準的に使用されています。システムによっては、FDISK形式またはSFD形式のどちらか一方のみをサポートし他方をサポートしません。

+

FM_SFDが指定されないときはFDISK形式となり、その物理ドライブ全体を占める1個の基本区画(パーテーション)が作成され、その中にFATボリュームが作成されます。FM_SFDが指定されたときはSFD形式となり、FATボリュームがその物理ドライブの先頭セクタからベタで作成されます。

+

マルチ パーテーション機能(_MULTI_PARTITION)により、その論理ドライブが特定の区画(1~4)に結び付けられている場合は、その区画の中にFATボリュームが作成されます。FM_SFDの指定は無視され、その物理ドライブはこれに先立ち、f_fdisk関数または他のツールで適切に区画設定されている必要があります。

+
+ +
+

対応情報

+

_FS_READONLY == 0で、且つ_USE_MKFS == 1のとき使用可能です。

+
+ + +
+

使用例

+
+/* Format default drive and create a file */
+int main (void)
+{
+    FATFS fs;           /* File system object */
+    FIL fil;            /* File object */
+    FRESULT res;        /* API result code */
+    UINT bw;            /* Bytes written */
+    BYTE work[_MAX_SS]; /* Work area (larger is better for process time) */
+
+
+    /* Create FAT volume */
+    res = f_mkfs("", FM_ANY, 0, work, sizeof work);
+    if (res) ...
+
+    /* Register work area */
+    f_mount(&fs, "", 0);
+
+    /* Create a file as new */
+    res = f_open(&fil, "hello.txt", FA_CREATE_NEW | FA_WRITE);
+    if (res) ...
+
+    /* Write a message */
+    f_write(&fil, "Hello, World!\r\n", 15, &bw);
+    if (bw != 15) ...
+
+    /* Close the file */
+    f_close(&fil);
+
+    ...
+
+
+ + +
+

参照

+

ボリューム サイズとフォーマット パラメータ, ボリューム管理, f_fdisk

+
+ + +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/mount.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/mount.html new file mode 100644 index 0000000..2ce701f --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/mount.html @@ -0,0 +1,82 @@ + + + + + + + + +FatFs - f_mount + + + + +
+

f_mount

+

論理ドライブにファイル システム オブジェクトを登録・抹消します。

+
+FRESULT f_mount (
+  FATFS*       fs,     /* [IN] ファイル システム オブジェクト */
+  const TCHAR* path,   /* [IN] 論理ドライブ番号 */
+  BYTE         opt     /* [IN] 動作オプション */
+);
+
+
+ +
+

引数

+
+
fs
+
登録するファイル システム オブジェクトへのポインタ、またはヌル ポインタ
+
path
+
対象となる論理ドライブのパス名を示すヌル文字'\0'終端の文字列へのポインタを指定します。パス名にドライブ番号が含まれない場合は、デフォルト ドライブを指定したことになります。
+
opt
+
ファイル システム オブジェクトの登録と同時にマウント動作を行うかどうかを指定するフラグ。登録抹消のときは意味を持ちません。
+
+
+ +
+

戻り値

+

+FR_OK, +FR_INVALID_DRIVE, +FR_DISK_ERR, +FR_NOT_READY, +FR_NO_FILESYSTEM +

+
+ + +
+

解説

+

FatFsモジュールでは、それぞれの論理ドライブにファイル システム オブジェクトというワーク エリアが必要です。この関数は論理ドライブにファイル システム オブジェクトを登録したり抹消したりします。何らかのファイル関数を使用する前に、この関数でその論理ドライブのファイル システム オブジェクトを与えておかなければなりません。fsにヌル ポインタを指定すると、その論理ドライブのファイル システム オブジェクトの登録は抹消されるだけです。登録抹消されたファイル システム オブジェクトのメモリは解放できます。操作の対象の論理ドライブ上に開かれたままのファイルやディレクトリがあった場合、それらに対して作成された構造体は全て無効になります。この関数の内部処理は次のような順に行われます。

+
    +
  1. 対象の論理ドライブをpathから得る。
  2. +
  3. 登録されているファイル システム オブジェクトがあるときは、それをクリア(無効化)し、登録を解除する。
  4. +
  5. fsが有効なポインタのときは、そのファイル システム オブジェクトをクリアし、登録する。
  6. +
  7. マウント動作が指定されているときは、それを実行する。
  8. +
+

optに0を指定すると、マウント動作(物理ドライブの初期化、FATボリュームの検索、BPBを解析しファイル システム オブジェクトを初期化)は行われず、関数は物理ドライブの状態に関わらず常に成功します。関数内では下位レイヤへのアクセスは発生せず、指定されたファイル システム オブジェクトをクリア(無効化)し、そのアドレスを内部配列に登録するだけです。単に登録済みのファイル システム オブジェクトをクリアする目的にも使えます。実際のマウント動作は、ボリュームへのアクセス(パス名を渡すもの全て)が行われたときに、次のうちいずれかの条件が真の場合に行われます。

+ +

optに1を指定すると、ファイル システムオブジェクトの登録に続きマウント動作が行われます。メディアが無いなどの理由でマウント動作に失敗すると対応するエラーを返しファイル システム オブジェクトはクリア状態のままになりますが、登録自体は有効なので続いてボリュームへのアクセスがあれば再びマウント動作が実行されます。

+

下位レイヤの実装上メディア交換の検出がサポートされない(disk_status関数に反映されない)ときは、アプリケーションはメディア交換の後この関数でファイル システム オブジェクトを明示的にクリアし、マウント動作が正常に行えるようにする必要があります。

+
+ + +
+

対応情報

+

全ての構成で使用可能です。

+
+ + +
+

参照

+

f_open, FATFS

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/open.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/open.html new file mode 100644 index 0000000..1213074 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/open.html @@ -0,0 +1,172 @@ + + + + + + + + +FatFs - f_open + + + + +
+

f_open

+

ファイルをオープンまたは作成します。

+
+FRESULT f_open (
+  FIL* fp,           /* [OUT] 空のファイル オブジェクト構造体へのポインタ */
+  const TCHAR* path, /* [IN] ファイル名へのポインタ */
+  BYTE mode          /* [IN] モードフラグ */
+);
+
+
+ +
+

引数

+
+
fp
+
新しく作成するファイル オブジェクト構造体へのポインタを指定します。以降、そのファイルを閉じるまでこのファイル オブジェクトを使用してファイル操作をします。
+
path
+
開くファイルのファイル名を示すヌル文字'\0'終端の文字列へのポインタを指定します。
+
mode
+
ファイルのアクセス方法やオープン方法を決めるフラグです。このパラメータには次の組み合わせを指定します。
+ + + + + + + + + +
意味
FA_READ読み出しモードで開きます。読み書きする場合はFA_WRITEと共に指定します。
FA_WRITE書き込みモードで開きます。読み書きする場合はFA_READと共に指定します。
FA_OPEN_EXISTING既存のファイルを開きます。ファイルが無いときはエラーになります。(デフォルト)
FA_CREATE_NEWファイルを作成します。同名のファイルがある場合は、FR_EXISTで失敗します。
FA_CREATE_ALWAYSファイルを作成します。同名のファイルがある場合は、サイズを0にしてから開きます。
FA_OPEN_ALWAYS既存のファイルを開きます。ファイルが無いときはファイルを作成します。
FA_OPEN_APPENDFA_OPEN_ALWAYSと同じですが、リード/ライト ポインタはファイルの最後尾にセットされます。
+
+
+
+ + +
+

戻り値

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_NO_FILE, +FR_NO_PATH, +FR_INVALID_NAME, +FR_DENIED, +FR_EXIST, +FR_INVALID_OBJECT, +FR_WRITE_PROTECTED, +FR_INVALID_DRIVE, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT, +FR_LOCKED, +FR_NOT_ENOUGH_CORE, +FR_TOO_MANY_OPEN_FILES +

+
+ + +
+

解説

+

既存のファイルを開いたり、新しいファイルを作成します。関数が成功するとファイル オブジェクトが作成され、以降そのファイルに対するアクセスに使用します。ファイルを閉じるときは、f_close関数を使用します。何らかの変更が行われたファイルがその後正しく閉じられなかった場合、そのファイルが破損する場合があります。

+

既に開かれているファイルを開く必要がある場合は、多重アクセス制御を参照してください。しかし、一つのファイルに対する書き込みモードを含む重複オープンは常に禁止です。

+

ファイル アクセスを開始する前に、f_mount関数を使ってそれぞれの論理ドライブにワーク エリア(ファイル システム オブジェクト)を与える必要があります。この初期化の後、その論理ドライブに対して全てのファイル関数が使えるようになります。f_mkfs関数とf_fdsk関数は、ワークエリア無しでも使えます。

+
+ + +
+

対応情報

+

全ての構成で使用可能です。_FS_READONLY == 1のときは、FA_READFA_OPEN_EXISTING以外の各フラグはサポートされません。

+
+ + +
+

使用例

+
+/* テキストファイルを読み出して表示 */
+
+FATFS FatFs;   /* 論理ドライブのワーク エリア(ファイル システム オブジェクト) */
+
+int main (void)
+{
+    FIL fil;       /* ファイル オブジェクト */
+    char line[82]; /* 行バッファ */
+    FRESULT fr;    /* 戻り値 */
+
+
+    /* デフォルト ドライブにワークエリアを与える */
+    f_mount(&FatFs, "", 0);
+
+    /* テキスト ファイルを開く */
+    fr = f_open(&fil, "message.txt", FA_READ);
+    if (fr) return (int)fr;
+
+    /* 1行ずつ読み出して表示 */
+    while (f_gets(line, sizeof line, &fil))
+        printf(line);
+
+    /* ファイルを閉じる */
+    f_close(&fil);
+
+    return 0;
+}
+
+
+/* ドライブ1のファイル "file.bin" をドライブ0へコピー */
+
+int main (void)
+{
+    FATFS fs[2];         /* 論理ドライブのワークエリア(ファイル システム オブジェクト) */
+    FIL fsrc, fdst;      /* ファイル オブジェクト */
+    BYTE buffer[4096];   /* File copy buffer */
+    FRESULT fr;          /* FatFs function common result code */
+    UINT br, bw;         /* File R/W count */
+
+    /* ドライブ0,1にワーク エリアを与える */
+    f_mount(&fs[0], "0:", 0);
+    f_mount(&fs[1], "1:", 0);
+
+    /* ドライブ1のコピー元ファイルを開く */
+    res = f_open(&fsrc, "1:file.dat", FA_OPEN_EXISTING | FA_READ);
+    if (fr) return (int)fr;
+
+    /* ドライブ0にコピー先ファイルを作成する */
+    res = f_open(&fdst, "0:file.dat", FA_CREATE_ALWAYS | FA_WRITE);
+    if (fr) return (int)fr;
+
+    /* コピー元からコピー先にデータ転送する */
+    for (;;) {
+        res = f_read(&fsrc, buffer, sizeof buffer, &br); /* コピー元からから読み出す */
+        if (res || br == 0) break;   /* エラーかファイル終端 */
+        res = f_write(&fdst, buffer, br, &bw);           /* それをコピー先に書き込む */
+        if (res || bw < br) break;   /* エラーかディスク満杯 */
+    }
+
+    /* 全てのファイルを閉じる */
+    f_close(&fsrc);
+    f_close(&fdst);
+
+    /* ワーク エリアを開放する */
+    f_mount(NULL, "0:", 0);
+    f_mount(NULL, "1:", 0);
+
+    return (int)fr;
+}
+
+
+ + +
+

参照

+

f_read, f_write, f_close, FIL, FATFS

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/opendir.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/opendir.html new file mode 100644 index 0000000..166ee7d --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/opendir.html @@ -0,0 +1,75 @@ + + + + + + + + +FatFs - f_opendir + + + + +
+

f_opendir

+

ディレクトリを開きます。

+
+FRESULT f_opendir (
+  DIR* dp,           /* [OUT] ディレクトリ ブジェクト構造体へのポインタ */
+  const TCHAR* path  /* [IN] ディレクトリ名へのポインタ */
+);
+
+
+ +
+

引数

+
+
dp
+
空のディレクトリ オブジェクト構造体へのポインタを指定します。
+
path
+
開くディレクトリのパス名を示すヌル文字'\0'終端の文字列へのポインタを指定します。
+
+
+ + +
+

戻り値

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_NO_PATH, +FR_INVALID_NAME, +FR_INVALID_OBJECT, +FR_INVALID_DRIVE, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT, +FR_NOT_ENOUGH_CORE, +FR_TOO_MANY_OPEN_FILES +

+
+ + +
+

解説

+

ディレクトリを開きます。正常終了したら、作成されたディレクトリ オブジェクト構造体を使ってこのディレクトリの項目を順次読み出せます。

+
+ + +
+

対応情報

+

_FS_MINIMIZE <= 1のとき使用可能になります。

+
+ + +
+

参照

+

f_readdir, f_closedir, DIR

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/printf.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/printf.html new file mode 100644 index 0000000..6534c84 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/printf.html @@ -0,0 +1,93 @@ + + + + + + + + +FatFs - f_printf + + + + +
+

f_printf

+

ファイルに書式化文字列を書き込みます。

+
+int f_printf (
+  FIL* fp,           /* [IN] ファイル オブジェクト */
+  const TCHAR* fmt,  /* [IN] 書式制御文字列 */
+  ...
+);
+
+
+ +
+

引数

+
+
fp
+
ファイル オブジェクト構造体へのポインタを指定します。
+
fmt
+
ヌル文字'\0'終端の書式制御文字列を指すポインタを指定します。ヌル文字は書き込まれません。
+
...
+
オプションの引数。
+ +
+
+ + +
+

戻り値

+

文字列が正常に書き込まれると、書き込まれた文字数が返されます。ディスクが満杯またはその他エラーにより正常に書き込まれなかったときは、関数は失敗しEOF (-1)が返されます。

+
+ + +
+

解説

+

書式制御機能はC標準ライブラリのサブセットとなっていて、書式制御文字は次に示すものが使用可能です。

+ +
+ + +
+

対応情報

+

この関数は、f_putc関数およびf_puts関数のラッパー関数です。_FS_READONLY == 0で、且つ_USE_STRFUNCが1または2のとき使用可能になります。2の時は、出力に含まれる'\n''\r'+'\n'に展開されてファイルに書き込まれます。

+

APIにUnicodeが選択(_LFN_UNICODEが1)されているときは、fmtはUnicode文字列になりますが、ファイル上のエンコードは、_STRF_ENCODEオプションで選択できます。それ以外の時は無変換(1バイト/1文字)で書き込みます。

+
+ + +
+

使用例

+
+    f_printf(&fil, "%d", 1234);            /* "1234" */
+    f_printf(&fil, "%6d,%3d%%", -200, 5);  /* "  -200,  5%" */
+    f_printf(&fil, "%ld", 12345L);         /* "12345" */
+    f_printf(&fil, "%06d", 25);            /* "000025" */
+    f_printf(&fil, "%06d", -25);           /* "000-25" */
+    f_printf(&fil, "%-6d", 25);            /* "25    " */
+    f_printf(&fil, "%u", -1);              /* "65535" or "4294967295" */
+    f_printf(&fil, "%04x", 0xAB3);         /* "0ab3" */
+    f_printf(&fil, "%08LX", 0x123ABCL);    /* "00123ABC" */
+    f_printf(&fil, "%016b", 0x550F);       /* "0101010100001111" */
+    f_printf(&fil, "%s", "String");        /* "String" */
+    f_printf(&fil, "%8s", "abc");          /* "     abc" */
+    f_printf(&fil, "%-8s", "abc");         /* "abc     " */
+    f_printf(&fil, "%c", 'a');             /* "a" */
+    f_printf(&fil, "%f", 10.0);            /* 浮動小数点は未サポート */
+
+
+ + +
+

参照

+

f_open, f_putc, f_puts, f_gets, f_close, FIL

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/putc.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/putc.html new file mode 100644 index 0000000..57af633 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/putc.html @@ -0,0 +1,62 @@ + + + + + + + + +FatFs - f_putc + + + + +
+

f_putc

+

ファイルに文字を書き込みます。

+
+int f_putc (
+  TCHAR chr,  /* [IN] 書き込む文字 */
+  FIL* fp     /* [IN] ファイル オブジェクト */
+);
+
+
+ +
+

引数

+
+
chr
+
書き込む文字を指定します。
+
fp
+
ファイル オブジェクト構造体へのポインタを指定します。
+
+
+ + +
+

戻り値

+

文字が正常に書き込まれると書き込んだ文字数が返されます。ディスクが満杯またはエラーにより書き込まれなかったときはEOF (-1)が返されます。

+

APIにUnicodeが選択(_LFN_UNICODEが1)されているときは、chrはUTF-16文字になりますが、ファイル上のエンコードは、_STRF_ENCODEオプションで選択できます。それ以外の時は無変換(1バイト/1文字)で書き込みます。

+
+ + +
+

解説

+

1文字をファイルに書き込みます。

+
+ + +
+

対応情報

+

この関数はf_write関数のラッパー関数です。_FS_READONLY == 0で、且つ_USE_STRFUNCが 1または 2のとき使用可能です。2を指定すると、'\n''\r'+'\n'に展開されてファイルに書き込まれます。

+
+ + +
+

参照

+

f_open, f_puts, f_printf, f_gets, f_close, FIL

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/puts.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/puts.html new file mode 100644 index 0000000..4e4ed9e --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/puts.html @@ -0,0 +1,62 @@ + + + + + + + + +FatFs - f_puts + + + + +
+

f_puts

+

ファイルに文字列を書き込みます。

+
+int f_puts (
+  const TCHAR* str,  /* [IN] 書き込む文字列 */
+  FIL* fp            /* [IN] ファイル オブジェクト */
+);
+
+
+ +
+

引数

+
+
str
+
書き込むヌル文字'\0'終端の文字列を指すポインタを指定します。ヌル文字は書き込まれません。
+
fp
+
ファイル オブジェクト構造体へのポインタを指定します。
+
+
+ + +
+

戻り値

+

文字列が正常に書き込まれると、書き込まれた文字数が返されます。ディスクが満杯またはエラーにより書き込みが中断されたときはEOF (-1)が返されます。

+

APIにUnicodeが選択(_LFN_UNICODEが1)されているときは、strはUTF-16文字列になりますが、ファイル上のエンコードは、_STRF_ENCODEオプションで選択できます。それ以外の時は無変換(1バイト/1文字)で書き込みます。

+
+ + +
+

解説

+

文字列をファイルに書き込みます。

+
+ + +
+

対応情報

+

この関数はf_write関数のラッパー関数です。_FS_READONLY == 0で、且つ_USE_STRFUNCが1または2のとき使用可能です。2を指定すると、文字列に含まれる'\n''\r'+'\n'に展開されてファイルに書き込まれます。

+
+ + + + +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/rc.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/rc.html new file mode 100644 index 0000000..82da6f2 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/rc.html @@ -0,0 +1,95 @@ + + + + + + + + +FatFs - 戻り値 + + + +

ファイル関数の戻り値

+

FatFsのAPIでは、一部の関数を除き結果に応じた共通のリザルト コード(FRESULT型(enum))を返します。関数が成功した場合は0 (FR_OK)を返します。失敗した場合は0以外の値を返し、値はエラーの種類を示します。

+ +
+
FR_OK (0)
+
関数は成功した。
+
FR_DISK_ERR
+
下位レイヤ(disk_read/disk_write/disk_ioctl関数)で回復不能なエラーが発生した。
※開かれたファイルの操作においてこのエラーが発生すると、そのファイル オブジェクトはアボート状態となり、クローズ以外の操作ができなくなります。
+
FR_INT_ERR
+
内部処理の健全性チェックで何らかの異常が検出された。原因としては次のようなことが考えられます。 +
    +
  • スタック不足や不正なメモリ操作等によるワーク エリアの破壊。多くはこれが原因。
  • +
  • ボリューム上のFAT構造にエラーがある。
  • +
  • FatFsモジュール自体のバグ。
  • +
+※開かれたファイルの操作においてこのエラーが発生すると、そのファイル オブジェクトはアボート状態となり、クローズ以外の操作ができなくなります。
+
FR_NOT_READY
+
下位レイヤ(disk_initialize関数)の失敗。つまり、物理ドライブが動作可能な状態にない。
+
FR_NO_FILE
+
指定されたファイルが見つからなかった。
+
FR_NO_PATH
+
指定されたパスが見つからなかった。
+
FR_INVALID_NAME
+
指定された文字列がパス名のフォーマットとして無効。
+
FR_DENIED
+
そのオブジェクトに対する操作の拒否。原因としては次のようなことが考えられます。 +
    +
  • 書き込み禁止属性(AM_RDO)を持つファイルを書き込みモードで開こうとした。
  • +
  • 書き込み禁止属性を持つオブジェクトを削除しようとした。
  • +
  • 空でないディレクトリまたはカレント ディレクトリを削除しようとした。
  • +
  • FA_READフラグを付けずに開いたファイルに対して読み出しを行った。
  • +
  • FA_WRITEフラグを付けずに開いたファイルに対して変更を加えようとした。
  • +
  • ボリュームまたは静的ディレクトリ(FAT12/16のルート)が満杯でディレクトリ エントリの新規作成ができなかった。
  • +
  • ファイルに割り当てる連続領域が見つからなかった。
  • +
+
+
FR_EXIST
+
新しく作成しようとしたオブジェクトと同じ名前のオブジェクトが既に存在する。
+
FR_INVALID_OBJECT
+
指定されたファイル オブジェクトやディレクトリ オブジェクトが無効、またはヌル ポインタが渡された。無効になる理由は次のことが考えられます。 +
    +
  • オープンされていない、既に閉じられた、破損しているなど。
  • +
  • そのボリュームでマウント動作があり、ボリューム上の開かれたオブジェクトが全て無効化された。
  • +
  • 物理ドライブがメディアの取り外しで動作不可能になっている。
  • +
+
+
FR_WRITE_PROTECTED
+
物理ドライブが書き込み禁止状態のとき、書き込みを伴う操作を行おうとした。
+
FR_INVALID_DRIVE
+
パス名中に指定されたドライブ番号が無効、またはパス名にヌル ポインタが渡された。(関連オプション: _VOLUMES)
+
FR_NOT_ENABLED
+
そのボリュームの操作に必要なワーク エリア(ファイル システム オブジェクト構造体)が与えられていない。
+
FR_NO_FILESYSTEM
+
物理ドライブ上に有効なFATボリュームが見つからなかった。
+
FR_MKFS_ABORTED
+
f_mkfs関数の処理が開始前に中断された。原因としては次のようなことが考えられます。 +
    +
  • 指定されたパラメータでのフォーマットが不可能。
  • +
  • ボリュームのサイズが小さすぎる。
  • +
  • 与えられたワークエリアが小さすぎる。
  • +
  • その論理ドライブに対応する区画が見つからなかった。(関連オプション: _MULTI_PARTITION)
  • +
+
+
FR_TIMEOUT
+
再入制御による待ち時間が定義された時間を越えたため、関数は実行されなかった。(関連オプション: _TIMEOUT)
+
FR_LOCKED
+
多重アクセス排他機能により、そのファイルやディレクトリに対して行おうとしたアクセスが拒否された。(関連オプション: _FS_LOCK)
+
FR_NOT_ENOUGH_CORE
+
メモリ不足による失敗。原因としては次のようなことが考えられます。 +
    +
  • LFN操作バッファの動的確保に失敗した。(関連オプション: _USE_LFN)
  • +
  • 与えられた配列のサイズが実際に必要なサイズに対して不足している。
  • +
+
+
FR_TOO_MANY_OPEN_FILES
+
同時オープン可能なファイル数を越えてファイルを開こうとした。(関連オプション: _FS_LOCK)
+
FR_INVALID_PARAMETER
+
与えられたパラメータが無効または矛盾している。
+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/read.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/read.html new file mode 100644 index 0000000..b73a5d9 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/read.html @@ -0,0 +1,74 @@ + + + + + + + + +FatFs - f_read + + + + +
+

f_read

+

ファイルからデータを読み出します。

+
+FRESULT f_read (
+  FIL* fp,     /* [IN] ファイル オブジェクト構造体 */
+  void* buff,  /* [OUT] 読み出したデータを格納するバッファ */
+  UINT btr,    /* [IN] 読み出すバイト数 */
+  UINT* br     /* [OUT] 読み出されたバイト数 */
+);
+
+
+ +
+

引数

+
+
fp
+
ファイル オブジェクト構造体へのポインタを指定します。
+
buff
+
読み出したデータを格納するバッファを指すポインタを指定します。
+
btr
+
読み出すバイト数(0~UINT型の最大値)を指定します。
+
br
+
実際に読み出されたバイト数を格納する変数を指すポインタを指定します。戻り値は関数の成否にかかわらず常に有効です。
+
+
+ + + + + +
+

解説

+

読み込み開始位置は、現在のリード/ライト ポインタからになります。リード/ライト ポインタは読み込まれたバイト数だけ進みます。関数が正常終了した後は、*brの値をチェックすべきです。*brbtrよりも小さいときは、読み込み中にファイルの終端に達したことを示しています。

+
+ + +
+

対応情報

+

全ての構成で使用可能です。

+
+ + +
+

参照

+

f_open, fgets, f_write, f_close, FIL

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/readdir.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/readdir.html new file mode 100644 index 0000000..c80ce39 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/readdir.html @@ -0,0 +1,129 @@ + + + + + + + + +FatFs - f_readdir + + + + +
+

f_readdir

+

ディレクトリ項目を読み出します。

+
+FRESULT f_readdir (
+  DIR* dp,      /* [IN] ディレクトリ ブジェクト構造体へのポインタ */
+  FILINFO* fno  /* [OUT] ファイル情報構造体へのポインタ */
+);
+
+
+ +
+

引数

+
+
dp
+
f_opendir関数で作成された有効なディレクトリ オブジェクトへのポインタを指定します。
+
fno
+
読み出したディレクトリ項目を格納するファイル情報構造体へのポインタ、またはヌル ポインタを指定します。
+
+
+ + + + + +
+

解説

+

ディレクトリの項目(ファイルおよびサブ ディレクトリ)の情報を順次読み出します。この関数を繰り返し実行することによりそのディレクトリの全ての項目を読み出すことができます。得られるファイル情報の詳細については FILINFO構造体を参照してください。全ての項目が読み出され、読み出す項目がもう無いときは、fno->fname[]にヌル文字列が返されます。fnoにヌル ポインタを指定すると、そのディレクトリのリード インデックスを先頭に巻き戻します。サブ ディレクトリのドット エントリ(".""..")は、出力に現れません。

+

LFN構成では、altname[]が新たに定義され、そのオブジェクトの短いファイル名がストアされます。次の条件のときは長いファイル名を返せないのでfname[]に短いファイル名がストアされ、altname[]はヌル文字列になります。

+
    +
  • オブジェクトが長いファイル名を持っていない。(exFATボリュームでは該当せず)
  • +
  • _MAX_LFNの設定がその長いファイル名の長さに対して不十分 (_MAX_LFN == 255では該当せず)
  • +
  • 長いファイル名にANSI/OEMコードに無い文字が含まれている。(_LFN_UNICODE == 1では該当せず)
  • +
+

exFATボリュームのディレクトリを読み出すとき、構成によっては問題が発生します。exFATでは短いファイル名がサポートされません。つまり、上記の条件のとき代わりに返すファイル名が無いということです。このような場合はfname[]に"?"が返され、そのオブジェクトにアクセスできないことを示します。この問題を避けるには、FatFsの構成を_LFN_UNICODE = 1および_MAX_LFN = 255として長いファイル名に完全対応とする必要があります。

+
+ +
+

対応情報

+

_FS_MINIMIZE <= 1のときに使用可能です。

+
+ + +
+

使用例

+
+FATFS fs;
+char buff[256];
+
+FRESULT scan_files (
+    char* path        /* 開始ノード (ワークエリアとしても使用) */
+)
+{
+    FRESULT res;
+    DIR dir;
+    UINT i;
+    static FILINFO fno;
+
+
+    res = f_opendir(&dir, path);                       /* ディレクトリを開く */
+    if (res == FR_OK) {
+        for (;;) {
+            res = f_readdir(&dir, &fno);                   /* ディレクトリ項目を1個読み出す */
+            if (res != FR_OK || fno.fname[0] == 0) break;  /* エラーまたは項目無しのときは抜ける */
+            if (fno.fattrib & AM_DIR) {                    /* ディレクトリ */
+                i = strlen(path);
+                sprintf(&path[i], "/%s", fno.fname);
+                res = scan_files(path);                    /* 一つ下へ */
+                if (res != FR_OK) break;
+                path[i] = 0;
+            } else {                                       /* ファイル */
+                printf("%s/%s\n", path, fno.fname);
+            }
+        }
+        f_closedir(&dir)
+    }
+
+    return res;
+}
+
+
+int main (void)
+{
+    FRESULT res;
+
+
+    res = f_mount(&fs, "", 1);
+    if (res == FR_OK) {
+        strcpy(buff, "/");
+        res = scan_files(buff);
+    }
+
+    return res;
+}
+
+
+ + + + +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/rename.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/rename.html new file mode 100644 index 0000000..fe1aa90 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/rename.html @@ -0,0 +1,85 @@ + + + + + + + + +FatFs - f_rename + + + + +
+

f_rename

+

ファイルまたはサブ ディレクトリの名前の変更または移動します。

+
+FRESULT f_rename (
+  const TCHAR* old_name, /* [IN] 古いオブジェクト名 */
+  const TCHAR* new_name  /* [IN] 新しいオブジェクト名 */
+);
+
+
+ +
+

引数

+
+
old_name
+
変更対象のファイルまたはサブ ディレクトリのパス名を示すヌル文字'\0'終端の文字列へのポインタを指定します。
+
new_name
+
新しいパス名を示すヌル文字'\0'終端の文字列へのポインタを指定します。また、ドライブ番号は指定しても無視され、old_nameで決められたボリューム上のオブジェクトとして扱われます。これと同じパス名(old_nameは除く)のオブジェクトが存在すると、関数はFR_EXISTで失敗します。
+
+
+ + + + + +
+

解説

+

ファイルまたはサブ ディレクトリの名前を変更します。また、同時に別のディレクトリへの移動も可能ですが、異なるドライブ間の移動はできません。開かれているオブジェクトに対する使用は不正な操作となり、FAT構造が破壊される可能性があります。多重アクセス制御が有効のときは安全に拒否されます。

+
+ + +
+

対応情報

+

_FS_READONLY == 0で、且つ_FS_MINIMIZE == 0のときに使用可能です。

+
+ + +
+

使用例

+
+    /* デフォルト ドライブにあるオブジェクトの名前を変更 */
+    f_rename("oldname.txt", "newname.txt");
+
+    /* ドライブ2にあるオブジェクトの名前を変更 */
+    f_rename("2:oldname.txt", "newname.txt");
+
+    /* 名前の変更と同時に別のディレクトリに移動 */
+    f_rename("log.txt", "old/log0001.txt");
+
+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/sdir.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/sdir.html new file mode 100644 index 0000000..a189819 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/sdir.html @@ -0,0 +1,38 @@ + + + + + + + + +FatFs - DIR + + + + +
+

DIR

+

DIR構造体は、f_opendir/f_readdir/f_findfirst/f_findnext関数のワーク エリアとして使用されます。アプリケーションは、この構造体のメンバを書き換えてはなりません。

+
+typedef struct {
+    _FDID   obj;       /* オブジェクトID */
+    DOWRD   dptr;      /* 現在のread/writeオフセット */
+    DWORD   clust;     /* 現在のクラスタ番号 */
+    DWORD   sect;      /* 現在のセクタ番号 */
+    BYTE*   dir;       /* 現在のSFNエントリ(Win[]内)へのポインタ */
+    BYTE*   fn;        /* SFNバッファへのポインタ (in/out) {file[8],ext[3],status[1]} */
+#if _USE_LFN
+    DWORD   blk_ofs;   /* 現在のエントリブロックの先頭 (0xFFFFFFFF:無効) */
+    WCHAR*  lfn;       /* LFNバッファへのポインタ (in/out) */
+#endif
+#if _USE_FIND
+    const TCHAR*  pat; /* マッチング パターンへのポインタ */
+#endif
+} DIR;
+
+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/setlabel.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/setlabel.html new file mode 100644 index 0000000..c121719 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/setlabel.html @@ -0,0 +1,91 @@ + + + + + + + + +FatFs - f_setlabel + + + + +
+

f_setlabel

+

ボリュームにボリューム ラベルを設定します。

+
+FRESULT f_setlabel (
+  const TCHAR* label  /* [IN] 設定するボリューム ラベルへのポインタ */
+);
+
+
+ +
+

引数

+
+
label
+
設定するボリューム ラベルを示すヌル文字'\0'終端の文字列へのポインタを指定します。
+
+
+ + + + + +
+

解説

+

文字列の先頭にドライブ番号を含む場合は、その論理ドライブに対して設定されます。含まない場合は、デフォルト ドライブに設定されます。ボリューム ラベルを削除するときは、ヌル文字列を指定します。FATボリューム上では、ボリューム ラベルのフォーマットは、ファイル名とほぼ同じですが、次の点が異なります。

+
    +
  • 任意の位置にスペースを置くことができる。ただし、FATボリュームではトレーリング スペースは除去される。
  • +
  • ピリオドを含むことはできない。
  • +
  • FATボリュームでは、OEMコード換算で11バイト以下。
  • +
  • exFATボリュームでは、11文字以下で、大文字小文字は保持される。
  • +
+

【補足】 標準システム(Windows)では\xE5で始まるボーリューム ラベル(CP932なら「薔薇」など)の扱いに問題があります。このため、この関数ではそのような名前は無効として処理しています。

+
+ +
+

対応情報

+

_FS_READONLY == 0で、且つ_USE_LABEL == 1のときに使用可能です。

+
+ + +
+

使用例

+
+    /* デフォルト ドライブにボリューム ラベルを設定 */
+    f_setlabel("DATA DISK");
+
+    /* ドライブ2にボリューム ラベルを設定 */
+    f_setlabel("2:DISK 3 OF 4");
+
+    /* ドライブ2のボリューム ラベルを削除 */
+    f_setlabel("2:");
+
+
+ + +
+

参照

+f_getlabel +
+ + +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/sfatfs.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/sfatfs.html new file mode 100644 index 0000000..fd356db --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/sfatfs.html @@ -0,0 +1,63 @@ + + + + + + + + +FatFs - FATFS + + + + +
+

FATFS

+

FATFS構造体(ファイル システム オブジェクト)は、個々の論理ドライブのダイナミック ワーク エリアを保持し、f_mount関数でFatFsモジュールに登録されます。初期化が行われるタイミングは、f_mount関数(強制マウント指定)の実行またはメディア交換の後の最初のファイル アクセスの時です。アプリケーションは、この構造体のメンバを書き換えてはなりません。

+ +
+typedef struct {
+    BYTE    fs_type;      /* ファイル システム (0, FS_FAT12, FS_FAT16, FS_FAT32 or FS_EXFAT) */
+    BYTE    drv;          /* 物理ドライブ番号 */
+    BYTE    n_fats;       /* FATの多重化数 (1,2) */
+    BYTE    wflag;        /* win[]ダーティ フラグ */
+    BYTE    fsi_flag;     /* FSINFOフラグ (b7:Disabled, b0:Dirty) */
+    WORD    id;           /* ファイル システム マウントID */
+    WORD    n_rootdir;    /* ルート ディレクトリのエントリ数 (FAT12/16) */
+    WORD    csize;        /* クラスタ当たりのセクタ数 */
+#if _MAX_SS != _MIN_SS
+    WORD    ssize;        /* セクタ サイズ (512, 1024, 2048 or 4096) */
+#endif
+#if _FS_EXFAT
+    BYTE*   dirbuf;       /* ディレクトリ エントリ ブロック操作バッファへのポインタ */
+#endif
+#if _FS_REENTRANT
+    _SYNC_t sobj;         /* 同期オブジェクトID */
+#endif
+#if !_FS_READONLY
+    DWORD   last_clust;   /* FSINFO: 最後に割り当てられたクラスタ番号 */
+    DWORD   free_clust;   /* FSINFO: 空きクラスタ数 */
+#endif
+#if _FS_RPATH
+    DWORD   cdir;         /* カレント ディレクトリのクラスタ番号 (0:ルート) */
+#if _FS_EXFAT
+    DWORD   cdc_scl;      /* カレント ディレクトリを含むディレクトリの開始クラスタ番号 (cdir == 0では無効) */
+    DWORD   cdc_size;     /* b31-b8:カレント ディレクトリを含むディレクトリのサイズ, b7-b0: チェーン ステータス */
+    DWORD   cdc_ofs;      /* カレント ディレクトリを含むディレクトリ内の位置 (cdir == 0では無効) */
+#endif
+#endif
+    DWORD   n_fatent;     /* FATエントリ数 (総クラスタ数 + 2) */
+    DWORD   fsize;        /* FAT 1個のセクタ数 */
+    DWORD   volbase;      /* ボリューム開始セクタ */
+    DWORD   fatbase;      /* FAT領域開始セクタ */
+    DWORD   dirbase;      /* ルート ディレクトリ領域開始(セクタ|クラスタ) */
+    DWORD   database;     /* データ領域開始セクタ */
+    DWORD   winsect;      /* win[]に現れているセクタ番号 */
+    BYTE    win[_MAX_SS]; /* ディスク アクセス ウィンドウ */
+} FATFS;
+
+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/sfile.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/sfile.html new file mode 100644 index 0000000..9521f70 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/sfile.html @@ -0,0 +1,45 @@ + + + + + + + + +FatFs - FIL + + + + +
+

FIL

+

FIL構造体(ファイル オブジェクト)は、f_open関数で初期化され、以後そのファイルの状態を保持します。また、f_close関数でファイルが閉じられると無効化されます。アプリケーションは、この構造体のメンバを書き換えてはなりません(cltblは例外)。非タイニー構成(_FS_TINY == 0)では、内部に_MAX_SSバイトのセクタ バッファが確保されるので、そのサイズには注意が必要です。

+ +
+typedef struct {
+    _FDID   obj;          /* オブジェクトID */
+    BYTE    flag;         /* ファイル ステータス フラグ */
+    BYTE    err;          /* エラー中断フラグ */
+    FSIZE_t fptr;         /* ファイル読み書きポインタ (ファイル先頭からのバイト オフセット) */
+    DWORD   clust;        /* 現在のクラスタ (fptrがクラスタ境界上のときは前のクラスタ、fptrが0のときは無効) */
+    DWORD   dsect;        /* 現在のデータ セクタ */
+#if !_FS_READONLY
+    DWORD   dir_sect;     /* このファイルのディレクトリ エントリのあるセクタ */
+    BYTE*   dir_ptr;      /* このファイルのディレクトリへのポインタ */
+#endif
+#if _USE_FASTSEEK
+    DWORD*  cltbl;        /* ファイルのクラスタ リンク情報へのポインタ (オープン時にNULLがセットされる) */
+#endif
+#if _FS_LOCK
+    UINT    lockid;       /* ファイル ロックID */
+#endif
+#if !_FS_TINY
+    BYTE    buf[_MAX_SS]; /* ファイル プライベート データ転送バッファ (fptrがセクタ境界上にない時は常に有効だが、fptrがセクタ境界上のときは無効な場合がある) */
+#endif
+} FIL;
+
+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/sfileinfo.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/sfileinfo.html new file mode 100644 index 0000000..505f4b0 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/sfileinfo.html @@ -0,0 +1,69 @@ + + + + + + + + +FatFs - FILINFO + + + + +
+

FILINFO

+

FILINFO構造体は、f_stat/f_readdir/f_findfirst/f_findnext関数で返されるオブジェクトに関する情報を保持します。

+
+typedef struct {
+    FSIZE_t fsize;               /* ファイル サイズ */
+    WORD    fdate;               /* 最後に更新された日付 */
+    WORD    ftime;               /* 最後に更新された時刻  */
+    BYTE    fattrib;             /* アトリビュート */
+#if _USE_LFN != 0
+    TCHAR   altname[13];         /* 代替ファイル名 */
+    TCHAR   fname[_MAX_LFN + 1]; /* 主ファイル名 */
+#else
+    TCHAR   fname[13];           /* ファイル名 */
+#endif
+} FILINFO;
+
+
+ +

メンバ

+
+
fsize
+
ファイルのバイト単位のサイズが格納されます。ディレクトリの場合は常に0です。データ型FSIZE_tは、DWORD(32-bit)またはQWORD(64-bit)のエリアスで、exFATサポートの有無により切り替わります。
+
fdate
+
ファイルの変更された日付、またはディレクトリの作成された日付が格納されます。
+
+
bit15:9
+
1980年を起点とした年が 0..127 で入ります。
+
bit8:5
+
月が 1..12 の値で入ります。
+
bit4:0
+
日が 1..31 の値で入ります。
+
+
+
ftime
+
ファイルの変更された時刻、またはディレクトリの作成された時刻が格納されます。
+
+
bit15:11
+
時が 0..23 の値で入ります。
+
bit10:5
+
分が 0..59 の値で入ります。
+
bit4:0
+
秒/2が 0..29 の値で入ります。
+
+
+
fattrib
+
属性フラグが格納されます。フラグはAM_DIR, AM_RDO, AM_HID, AM_SYS, AM_ARCの組み合わせとなります。
+
fname[]
+
オブジェクト名が'\0'で終わる文字列として格納されます。読み出すべき項目が無いときは、ヌル文字列が返され、この構造体が無効であることを示します。
+
altname[]
+
代替ファイル名があるときは、それが'\0'で終わる文字列として格納されます。非LFN構成のときは、このメンバはありません。
+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/size.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/size.html new file mode 100644 index 0000000..d5ede8d --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/size.html @@ -0,0 +1,62 @@ + + + + + + + + +FatFs - f_size + + + + +
+

f_size

+

ファイルのサイズを取得します。

+
+FSIZE_t f_size (
+  FIL* fp   /* [IN] ファイル オブジェクト */
+);
+
+
+ + +
+

引数

+
+
fp
+
ファイル オブジェクト構造体へのポインタを指定します。
+
+
+ + +
+

戻り値

+

バイト単位のファイル サイズが返ります。

+
+ + +
+

解説

+

この関数は、現リビジョンではマクロとして実装されています。ファイル オブジェクトの正当性チェックや排他制御は行いません。

+
+#define f_size(fp) ((fp)->obj.objsize)
+
+
+ + +
+

対応情報

+

常に使用可能。

+
+ + +
+

参照

+

f_open, f_lseek, FIL

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/stat.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/stat.html new file mode 100644 index 0000000..a6d5567 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/stat.html @@ -0,0 +1,110 @@ + + + + + + + + +FatFs - f_stat + + + + +
+

f_stat

+

ファイルまたはサブ ディレクトリの存在を調べ、またその情報を取得します。

+
+FRESULT f_stat (
+  const TCHAR* path,  /* [IN] オブジェクト名へのポインタ */
+  FILINFO* fno        /* [OUT] ファイル情報構造体へのポインタ */
+);
+
+
+ +
+

引数

+
+
path
+
チェックするオブジェクト名を示すヌル文字'\0'終端の文字列を指すポインタを指定します。
+
fno
+
オブジェクトが存在したときにその情報を格納するファイル情報構造体へのポインタを指定します。この情報が不要なときはヌル ポインタを指定してください。
+
+
+ + + + + +
+

解説

+

指定されたファイルまたはサブ ディレクトリの存在を調べます。存在しない場合は、FR_NO_FILEが帰ります。存在する場合はFR_OKが帰り、それ関する情報(サイズ、タイムスタンプおよび属性)がファイル情報構造体にストアされます。

+
+ + +
+

対応情報

+

_FS_MINIMIZE == 0のときに使用可能です。

+
+ + +
+

使用例

+
+    FRESULT fr;
+    FILINFO fno;
+
+
+    printf("Test for 'file.txt'...\n");
+
+    fr = f_stat("file.txt", &fno);
+    switch (fr) {
+
+    case FR_OK:
+        printf("Size: %lu\n", fno.fsize);
+        printf("Timestamp: %u/%02u/%02u, %02u:%02u\n",
+               (fno.fdate >> 9) + 1980, fno.fdate >> 5 & 15, fno.fdate & 31,
+               fno.ftime >> 11, fno.ftime >> 5 & 63);
+        printf("Attributes: %c%c%c%c%c\n",
+               (fno.fattrib & AM_DIR) ? 'D' : '-',
+               (fno.fattrib & AM_RDO) ? 'R' : '-',
+               (fno.fattrib & AM_HID) ? 'H' : '-',
+               (fno.fattrib & AM_SYS) ? 'S' : '-',
+               (fno.fattrib & AM_ARC) ? 'A' : '-');
+        break;
+
+    case FR_NO_FILE:
+        printf("It is not exist.\n");
+        break;
+
+    default:
+        printf("An error occured. (%d)\n", fr);
+    }
+
+
+ + + + +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/sync.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/sync.html new file mode 100644 index 0000000..fb6f336 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/sync.html @@ -0,0 +1,65 @@ + + + + + + + + +FatFs - f_sync + + + + +
+

f_sync

+

書き込み中のファイルのキャッシュされた情報をフラッシュします。

+
+FRESULT f_sync (
+  FIL* fp     /* [IN] ファイル オブジェクト構造体へのポインタ */
+);
+
+
+ +
+

引数

+
+
fp
+
syncするファイルのファイル オブジェクト構造体へのポインタを指定します。
+
+
+ + + + + +
+

解説

+

この関数はf_close関数と同じ処理を実行しますが、ファイルは引き続き開かれたままになり、読み書きを続行できます。ロギングなど、書き込みモードで長時間ファイルが開かれているアプリケーションにおいて、定期的または区切りの良いところでこの関数を使用することにより、不意の電源断やメディアの取り外しにより失われるデータを最小にすることができます。この背景については、アプリケーション ノートも参照してください。

+

実際のところ、f_close関数内ではこの関数を呼び出した後ファイル オブジェクトを無効化しているだけなので、f_close関数の直前にf_sync関数を置くことは無意味です。

+
+ + +
+

対応情報

+

_FS_READONLY == 0のときに使用可能です。

+
+ + +
+

参照

+

f_close

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/tell.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/tell.html new file mode 100644 index 0000000..39973e8 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/tell.html @@ -0,0 +1,62 @@ + + + + + + + + +FatFs - f_tell + + + + +
+

f_tell

+

現在のリード/ライト ポインタを取得します。

+
+FSIZE_t f_tell (
+  FIL* fp   /* [IN] ファイル オブジェクト */
+);
+
+
+ + +
+

引数

+
+
fp
+
ファイル オブジェクト構造体へのポインタを指定します。
+
+
+ + +
+

戻り値

+

現在のリード/ライト ポインタ(ファイル先頭からのバイト単位のオフセット)が返ります。

+
+ + +
+

解説

+

f_tell関数は、現リビジョンではマクロとして実装されています。ファイル オブジェクトの正当性チェックや排他制御は行いません。

+
+#define f_tell(fp) ((fp)->fptr)
+
+
+ + +
+

対応情報

+

常に使用可能。

+
+ + +
+

参照

+

f_open, f_lseek, FIL

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/truncate.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/truncate.html new file mode 100644 index 0000000..6302ee5 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/truncate.html @@ -0,0 +1,66 @@ + + + + + + + + +FatFs - f_truncate + + + + +
+

f_truncate

+

ファイル長を切り詰めます。

+
+FRESULT f_truncate (
+  FIL* fp     /* [IN] ファイル オブジェクトへのポインタ */
+);
+
+
+ +
+

引数

+
+
fp
+
切り詰め対象ファイルのファイル オブジェクトへのポインタ
+
+
+ + + + + +
+

解説

+

ファイルの長さが現在のリード/ライト ポインタに切り詰められます。リード/ライト ポインタが既にファイルの終端を指しているときは、この関数は何の効果も持ちません。

+
+ + +
+

対応情報

+

_FS_READONLY == 0で、且つ_FS_MINIMIZE == 0のときに使用可能です。

+
+ + +
+

参照

+

f_open, f_lseek, FIL

+
+ + +

Return

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/unlink.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/unlink.html new file mode 100644 index 0000000..f75f3fc --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/unlink.html @@ -0,0 +1,73 @@ + + + + + + + + +FatFs - f_unlink + + + + +
+

f_unlink

+

ファイルまたはサブ ディレクトリを削除します。

+
+FRESULT f_unlink (
+  const TCHAR* path  /* [IN] オブジェクト名へのポインタ */
+);
+
+
+ +
+

引数

+
+
path
+
削除対象のパス名を示すヌル文字'\0'終端の文字列へのポインタを指定します。
+
+
+ + + + + +
+

解説

+

削除対象のオブジェクトが次の条件に当てはまる場合、そのアクセスは拒否(FR_DENIED)され関数は失敗します。

+
    +
  • リード オンリー属性(AM_RDO)を持っている場合。
  • +
  • 空でないサブ ディレクトリまたはカレント ディレクトリである場合。
  • +
  • 開かれているオブジェクトである場合。多重アクセス制御が有効のときは安全に拒否されるが、そうでないときは不正な操作となりFAT構造が破壊される可能性がある。
  • +
+
+ +
+

対応情報

+

_FS_READONLY == 0で、且つ_FS_MINIMIZE == 0のときに使用可能です。

+
+ + +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/utime.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/utime.html new file mode 100644 index 0000000..8d16778 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/utime.html @@ -0,0 +1,99 @@ + + + + + + + + +FatFs - f_utime + + + + +
+

f_utime

+

ファイルまたはサブ ディレクトリのタイムスタンプを変更します。

+
+FRESULT f_utime (
+  const TCHAR* path,  /* [IN] オブジェクト名へのポインタ */
+  const FILINFO* fno  /* [IN] 設定する日付 */
+);
+
+
+ +
+

引数

+
+
path
+
変更対象のオブジェクトのパス名を示すヌル文字'\0'終端の文字列を指定します。
+
fno
+
設定する日付と時間をfdateftimeメンバに設定されたFILINFO構造体へのポインタ。他のメンバはこの関数では意味を持ちません。
+
+
+ + + + + +
+

解説

+

オブジェクトのタイムスタンプを変更します。

+
+ + +
+

使用例

+
+FRESULT set_timestamp (
+    char *obj,     /* ファイル名へのポインタ */
+    int year,
+    int month,
+    int mday,
+    int hour,
+    int min,
+    int sec
+)
+{
+    FILINFO fno;
+
+    fno.fdate = (WORD)(((year - 1980) * 512U) | month * 32U | mday);
+    fno.ftime = (WORD)(hour * 2048U | min * 32U | sec / 2U);
+
+    return f_utime(obj, &fno);
+}
+
+
+ + +
+

対応情報

+

_FS_READONLY == 0で、且つ_FS_MINIMIZE == 0のときに使用可能です。

+
+ + +
+

参照

+

f_stat, FILINFO

+
+ +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/write.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/write.html new file mode 100644 index 0000000..7783e95 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/ja/write.html @@ -0,0 +1,74 @@ + + + + + + + + +FatFs - f_write + + + + +
+

f_write

+

ファイルにデータを書き込みます。

+
+FRESULT f_write (
+  FIL* fp,           /* [IN] ファイル オブジェクト */
+  const void* buff,  /* [IN] 書き込みデータ */
+  UINT btw,          /* [IN] 書き込むバイト数 */
+  UINT* bw           /* [OUT] 書き込まれたバイト数 */
+);
+
+
+ +
+

引数

+
+
fp
+
ファイル オブジェクト構造体へのポインタを指定します。
+
buff
+
書き込むデータを格納したバッファを指すポインタを指定します。
+
btw
+
書き込むバイト数(0~UINT型の最大値)を指定します。
+
bw
+
書き込まれたバイト数を格納する変数を指すポインタを指定します。戻り値は関数の成否にかかわらず常に有効です。
+
+
+ + + + + +
+

解説

+

書き込み開始位置は、リード/ライト ポインタの位置からになります。リード/ライト ポインタは実際に書き込まれたバイト数だけ進みます。関数が正常終了した後、要求したバイト数が書き込まれたかどうか*bwをチェックすべきです。*bwbtwより小さいときは、ディスク フルを意味します。ディスク フルが発生しているときまたはそれに近いときは、制御が帰るまで時間がかかる場合があります。

+
+ + +
+

対応情報

+

_FS_READONLY == 0のときに使用可能です。

+
+ + + + +

戻る

+ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/app1.c b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/app1.c new file mode 100644 index 0000000..1da30d4 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/app1.c @@ -0,0 +1,44 @@ +/*------------------------------------------------------------/ +/ Open or create a file in append mode +/ (This function was sperseded by FA_OPEN_APPEND at FatFs R0.12a) +/------------------------------------------------------------*/ + +FRESULT open_append ( + FIL* fp, /* [OUT] File object to create */ + const char* path /* [IN] File name to be opened */ +) +{ + FRESULT fr; + + /* Opens an existing file. If not exist, creates a new file. */ + fr = f_open(fp, path, FA_WRITE | FA_OPEN_ALWAYS); + if (fr == FR_OK) { + /* Seek to end of the file to append data */ + fr = f_lseek(fp, f_size(fp)); + if (fr != FR_OK) + f_close(fp); + } + return fr; +} + + +int main (void) +{ + FRESULT fr; + FATFS fs; + FIL fil; + + /* Open or create a log file and ready to append */ + f_mount(&fs, "", 0); + fr = open_append(&fil, "logfile.txt"); + if (fr != FR_OK) return 1; + + /* Append a line */ + f_printf(&fil, "%02u/%02u/%u, %2u:%02u\n", Mday, Mon, Year, Hour, Min); + + /* Close the file */ + f_close(&fil); + + return 0; +} + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/app2.c b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/app2.c new file mode 100644 index 0000000..b1ecd78 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/app2.c @@ -0,0 +1,70 @@ +/*------------------------------------------------------------/ +/ Remove all contents of a directory +/ This function works regardless of _FS_RPATH. +/------------------------------------------------------------*/ + + +FRESULT empty_directory ( + char* path /* Working buffer filled with start directory */ +) +{ + UINT i, j; + FRESULT fr; + DIR dir; + FILINFO fno; + +#if _USE_LFN + fno.lfname = 0; /* Disable LFN output */ +#endif + fr = f_opendir(&dir, path); + if (fr == FR_OK) { + for (i = 0; path[i]; i++) ; + path[i++] = '/'; + for (;;) { + fr = f_readdir(&dir, &fno); + if (fr != FR_OK || !fno.fname[0]) break; + if (_FS_RPATH && fno.fname[0] == '.') continue; + j = 0; + do + path[i+j] = fno.fname[j]; + while (fno.fname[j++]); + if (fno.fattrib & AM_DIR) { + fr = empty_directory(path); + if (fr != FR_OK) break; + } + fr = f_unlink(path); + if (fr != FR_OK) break; + } + path[--i] = '\0'; + closedir(&dir); + } + + return fr; +} + + + +int main (void) +{ + FRESULT fr; + FATFS fs; + char buff[64]; /* Working buffer */ + + + + f_mount(&fs, "", 0); + + strcpy(buff, "/"); /* Directory to be emptied */ + fr = empty_directory(buff); + + if (fr) { + printf("Function failed. (%u)\n", fr); + return fr; + } else { + printf("All contents in the %s are successfully removed.\n", buff); + return 0; + } +} + + + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/app3.c b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/app3.c new file mode 100644 index 0000000..b1a64e7 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/app3.c @@ -0,0 +1,109 @@ +/*----------------------------------------------------------------------/ +/ Allocate a contiguous area to the file +/-----------------------------------------------------------------------/ +/ This function checks if the file is contiguous with desired size. +/ If not, a block of contiguous sectors is allocated to the file. +/ If the file has been opened without FA_WRITE flag, it only checks if +/ the file is contiguous and returns the resulut. +/-----------------------------------------------------------------------/ +/ This function can work with FatFs R0.09 - R0.11a. +/ It is incompatible with R0.12+. Use f_expand function instead. +/----------------------------------------------------------------------*/ + +/* Declarations of FatFs internal functions accessible from applications. +/ This is intended to be used for disk checking/fixing or dirty hacks :-) */ +DWORD clust2sect (FATFS* fs, DWORD clst); +DWORD get_fat (FATFS* fs, DWORD clst); +FRESULT put_fat (FATFS* fs, DWORD clst, DWORD val); + + +DWORD allocate_contiguous_clusters ( /* Returns the first sector in LBA (0:error or not contiguous) */ + FIL* fp, /* Pointer to the open file object */ + DWORD len /* Number of bytes to allocate */ +) +{ + DWORD csz, tcl, ncl, ccl, cl; + + + if (f_lseek(fp, 0) || !len) /* Check if the given parameters are valid */ + return 0; + csz = 512UL * fp->fs->csize; /* Cluster size in unit of byte (assuming 512 bytes/sector) */ + tcl = (len + csz - 1) / csz; /* Total number of clusters required */ + len = tcl * csz; /* Round-up file size to the cluster boundary */ + + /* Check if the existing cluster chain is contiguous */ + if (len == fp->fsize) { + ncl = 0; ccl = fp->sclust; + do { + cl = get_fat(fp->fs, ccl); /* Get the cluster status */ + if (cl + 1 < 3) return 0; /* Hard error? */ + if (cl != ccl + 1 && cl < fp->fs->n_fatent) break; /* Not contiguous? */ + ccl = cl; + } while (++ncl < tcl); + if (ncl == tcl) /* Is the file contiguous? */ + return clust2sect(fp->fs, fp->sclust); /* File is contiguous. Return the start sector */ + } + + /* File is not contiguous */ +#if _FS_READONLY + return 0; /* Exit if in read-only cfg. */ +#else + if (!(fp->flag & FA_WRITE)) return 0; /* Exit if the file object is for read-only */ + + if (f_truncate(fp)) return 0; /* Remove the non-contiguous chain */ + + /* Find a free contiguous area */ + ccl = cl = 2; ncl = 0; + do { + if (cl >= fp->fs->n_fatent) return 0; /* No contiguous area is found. */ + if (get_fat(fp->fs, cl)) { /* Encounterd a cluster in use */ + do { /* Skip the block of used clusters */ + cl++; + if (cl >= fp->fs->n_fatent) return 0; /* No contiguous area is found. */ + } while (get_fat(fp->fs, cl)); + ccl = cl; ncl = 0; + } + cl++; ncl++; + } while (ncl < tcl); + + /* Create a contiguous cluster chain */ + fp->fs->last_clust = ccl - 1; + if (f_lseek(fp, len)) return 0; + + return clust2sect(fp->fs, fp->sclust); /* Return file start sector */ +#endif +} + + +int main (void) +{ + FRESULT fr; + DRESULT dr; + FATFS fs; + FIL fil; + DWORD org; + + + /* Open or create a file to write */ + f_mount(&fs, "", 0); + fr = f_open(&fil, "fastrec.log", FA_READ | FA_WRITE | FA_OPEN_ALWAYS); + if (fr) return 1; + + /* Check if the file is 256MB in size and occupies a contiguous area. + / If not, a contiguous area will be re-allocated to the file. */ + org = allocate_contiguous_clusters(&fil, 0x10000000); + if (!org) { + printf("Function failed due to any error or insufficient contiguous area.\n"); + f_close(&fil); + return 1; + } + + /* Now you can read/write the file without file system layer. */ + ... + dr = disk_write(fil.fs->drv, Buff, org, 1024); /* Write 512KiB from top of the file */ + ... + + f_close(&fil); + return 0; +} + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/app4.c b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/app4.c new file mode 100644 index 0000000..1b3223c --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/app4.c @@ -0,0 +1,317 @@ +/*----------------------------------------------------------------------/ +/ Low level disk I/O module function checker +/-----------------------------------------------------------------------/ +/ WARNING: The data on the target drive will be lost! +*/ + +#include +#include +#include "ff.h" +#include "diskio.h" + + +static +DWORD pn ( + DWORD pns +) +{ + static DWORD lfsr; + UINT n; + + + if (pns) { + lfsr = pns; + for (n = 0; n < 32; n++) pn(0); + } + if (lfsr & 1) { + lfsr >>= 1; + lfsr ^= 0x80200003; + } else { + lfsr >>= 1; + } + return lfsr; +} + + +int test_diskio ( + BYTE pdrv, /* Physical drive number to be checked (all data on the drive will be lost) */ + UINT ncyc, /* Number of test cycles */ + DWORD* buff, /* Pointer to the working buffer */ + UINT sz_buff /* Size of the working buffer in unit of byte */ +) +{ + UINT n, cc, ns; + DWORD sz_drv, lba, lba2, pns = 1; + WORD sz_sect, sz_eblk; + BYTE *pbuff = (BYTE*)buff; + DSTATUS ds; + DRESULT dr; + + + printf("test_diskio(%u, %u, 0x%08X, 0x%08X)\n", pdrv, ncyc, (UINT)buff, sz_buff); + + if (sz_buff < _MAX_SS + 4) { + printf("Insufficient work area to test.\n"); + return 1; + } + + for (cc = 1; cc <= ncyc; cc++) { + printf("**** Test cycle %u of %u start ****\n", cc, ncyc); + + /* Initialization */ + printf(" disk_initalize(%u)", pdrv); + ds = disk_initialize(pdrv); + if (ds & STA_NOINIT) { + printf(" - failed.\n"); + return 2; + } else { + printf(" - ok.\n"); + } + + /* Get drive size */ + printf("**** Get drive size ****\n"); + printf(" disk_ioctl(%u, GET_SECTOR_COUNT, 0x%08X)", pdrv, (UINT)&sz_drv); + sz_drv = 0; + dr = disk_ioctl(pdrv, GET_SECTOR_COUNT, &sz_drv); + if (dr == RES_OK) { + printf(" - ok.\n"); + } else { + printf(" - failed.\n"); + return 3; + } + if (sz_drv < 128) { + printf("Failed: Insufficient drive size to test.\n"); + return 4; + } + printf(" Number of sectors on the drive %u is %lu.\n", pdrv, sz_drv); + +#if _MAX_SS != _MIN_SS + /* Get sector size */ + printf("**** Get sector size ****\n"); + printf(" disk_ioctl(%u, GET_SECTOR_SIZE, 0x%X)", pdrv, (UINT)&sz_sect); + sz_sect = 0; + dr = disk_ioctl(pdrv, GET_SECTOR_SIZE, &sz_sect); + if (dr == RES_OK) { + printf(" - ok.\n"); + } else { + printf(" - failed.\n"); + return 5; + } + printf(" Size of sector is %u bytes.\n", sz_sect); +#else + sz_sect = _MAX_SS; +#endif + + /* Get erase block size */ + printf("**** Get block size ****\n"); + printf(" disk_ioctl(%u, GET_BLOCK_SIZE, 0x%X)", pdrv, (UINT)&sz_eblk); + sz_eblk = 0; + dr = disk_ioctl(pdrv, GET_BLOCK_SIZE, &sz_eblk); + if (dr == RES_OK) { + printf(" - ok.\n"); + } else { + printf(" - failed.\n"); + } + if (dr == RES_OK || sz_eblk >= 2) { + printf(" Size of the erase block is %u sectors.\n", sz_eblk); + } else { + printf(" Size of the erase block is unknown.\n"); + } + + /* Single sector write test */ + printf("**** Single sector write test 1 ****\n"); + lba = 0; + for (n = 0, pn(pns); n < sz_sect; n++) pbuff[n] = (BYTE)pn(0); + printf(" disk_write(%u, 0x%X, %lu, 1)", pdrv, (UINT)pbuff, lba); + dr = disk_write(pdrv, pbuff, lba, 1); + if (dr == RES_OK) { + printf(" - ok.\n"); + } else { + printf(" - failed.\n"); + return 6; + } + printf(" disk_ioctl(%u, CTRL_SYNC, NULL)", pdrv); + dr = disk_ioctl(pdrv, CTRL_SYNC, 0); + if (dr == RES_OK) { + printf(" - ok.\n"); + } else { + printf(" - failed.\n"); + return 7; + } + memset(pbuff, 0, sz_sect); + printf(" disk_read(%u, 0x%X, %lu, 1)", pdrv, (UINT)pbuff, lba); + dr = disk_read(pdrv, pbuff, lba, 1); + if (dr == RES_OK) { + printf(" - ok.\n"); + } else { + printf(" - failed.\n"); + return 8; + } + for (n = 0, pn(pns); n < sz_sect && pbuff[n] == (BYTE)pn(0); n++) ; + if (n == sz_sect) { + printf(" Data matched.\n"); + } else { + printf("Failed: Read data differs from the data written.\n"); + return 10; + } + pns++; + + /* Multiple sector write test */ + printf("**** Multiple sector write test ****\n"); + lba = 1; ns = sz_buff / sz_sect; + if (ns > 4) ns = 4; + for (n = 0, pn(pns); n < (UINT)(sz_sect * ns); n++) pbuff[n] = (BYTE)pn(0); + printf(" disk_write(%u, 0x%X, %lu, %u)", pdrv, (UINT)pbuff, lba, ns); + dr = disk_write(pdrv, pbuff, lba, ns); + if (dr == RES_OK) { + printf(" - ok.\n"); + } else { + printf(" - failed.\n"); + return 11; + } + printf(" disk_ioctl(%u, CTRL_SYNC, NULL)", pdrv); + dr = disk_ioctl(pdrv, CTRL_SYNC, 0); + if (dr == RES_OK) { + printf(" - ok.\n"); + } else { + printf(" - failed.\n"); + return 12; + } + memset(pbuff, 0, sz_sect * ns); + printf(" disk_read(%u, 0x%X, %lu, %u)", pdrv, (UINT)pbuff, lba, ns); + dr = disk_read(pdrv, pbuff, lba, ns); + if (dr == RES_OK) { + printf(" - ok.\n"); + } else { + printf(" - failed.\n"); + return 13; + } + for (n = 0, pn(pns); n < (UINT)(sz_sect * ns) && pbuff[n] == (BYTE)pn(0); n++) ; + if (n == (UINT)(sz_sect * ns)) { + printf(" Data matched.\n"); + } else { + printf("Failed: Read data differs from the data written.\n"); + return 14; + } + pns++; + + /* Single sector write test (misaligned memory address) */ + printf("**** Single sector write test 2 ****\n"); + lba = 5; + for (n = 0, pn(pns); n < sz_sect; n++) pbuff[n+3] = (BYTE)pn(0); + printf(" disk_write(%u, 0x%X, %lu, 1)", pdrv, (UINT)(pbuff+3), lba); + dr = disk_write(pdrv, pbuff+3, lba, 1); + if (dr == RES_OK) { + printf(" - ok.\n"); + } else { + printf(" - failed.\n"); + return 15; + } + printf(" disk_ioctl(%u, CTRL_SYNC, NULL)", pdrv); + dr = disk_ioctl(pdrv, CTRL_SYNC, 0); + if (dr == RES_OK) { + printf(" - ok.\n"); + } else { + printf(" - failed.\n"); + return 16; + } + memset(pbuff+5, 0, sz_sect); + printf(" disk_read(%u, 0x%X, %lu, 1)", pdrv, (UINT)(pbuff+5), lba); + dr = disk_read(pdrv, pbuff+5, lba, 1); + if (dr == RES_OK) { + printf(" - ok.\n"); + } else { + printf(" - failed.\n"); + return 17; + } + for (n = 0, pn(pns); n < sz_sect && pbuff[n+5] == (BYTE)pn(0); n++) ; + if (n == sz_sect) { + printf(" Data matched.\n"); + } else { + printf("Failed: Read data differs from the data written.\n"); + return 18; + } + pns++; + + /* 4GB barrier test */ + printf("**** 4GB barrier test ****\n"); + if (sz_drv >= 128 + 0x80000000 / (sz_sect / 2)) { + lba = 6; lba2 = lba + 0x80000000 / (sz_sect / 2); + for (n = 0, pn(pns); n < (UINT)(sz_sect * 2); n++) pbuff[n] = (BYTE)pn(0); + printf(" disk_write(%u, 0x%X, %lu, 1)", pdrv, (UINT)pbuff, lba); + dr = disk_write(pdrv, pbuff, lba, 1); + if (dr == RES_OK) { + printf(" - ok.\n"); + } else { + printf(" - failed.\n"); + return 19; + } + printf(" disk_write(%u, 0x%X, %lu, 1)", pdrv, (UINT)(pbuff+sz_sect), lba2); + dr = disk_write(pdrv, pbuff+sz_sect, lba2, 1); + if (dr == RES_OK) { + printf(" - ok.\n"); + } else { + printf(" - failed.\n"); + return 20; + } + printf(" disk_ioctl(%u, CTRL_SYNC, NULL)", pdrv); + dr = disk_ioctl(pdrv, CTRL_SYNC, 0); + if (dr == RES_OK) { + printf(" - ok.\n"); + } else { + printf(" - failed.\n"); + return 21; + } + memset(pbuff, 0, sz_sect * 2); + printf(" disk_read(%u, 0x%X, %lu, 1)", pdrv, (UINT)pbuff, lba); + dr = disk_read(pdrv, pbuff, lba, 1); + if (dr == RES_OK) { + printf(" - ok.\n"); + } else { + printf(" - failed.\n"); + return 22; + } + printf(" disk_read(%u, 0x%X, %lu, 1)", pdrv, (UINT)(pbuff+sz_sect), lba2); + dr = disk_read(pdrv, pbuff+sz_sect, lba2, 1); + if (dr == RES_OK) { + printf(" - ok.\n"); + } else { + printf(" - failed.\n"); + return 23; + } + for (n = 0, pn(pns); pbuff[n] == (BYTE)pn(0) && n < (UINT)(sz_sect * 2); n++) ; + if (n == (UINT)(sz_sect * 2)) { + printf(" Data matched.\n"); + } else { + printf("Failed: Read data differs from the data written.\n"); + return 24; + } + } else { + printf(" Test skipped.\n"); + } + pns++; + + printf("**** Test cycle %u of %u completed ****\n\n", cc, ncyc); + } + + return 0; +} + + + +int main (int argc, char* argv[]) +{ + int rc; + DWORD buff[512]; /* 2048 byte working buffer */ + + /* Check function/compatibility of the physical drive #0 */ + rc = test_diskio(0, 3, buff, sizeof buff); + if (rc) { + printf("Sorry the function/compatibility test failed. (rc=%d)\nFatFs will not work on this disk driver.\n", rc); + } else { + printf("Congratulations! The disk driver works well.\n"); + } + + return rc; +} + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f1.png b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f1.png new file mode 100644 index 0000000..5191700 Binary files /dev/null and b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f1.png differ diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f2.png b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f2.png new file mode 100644 index 0000000..8ef0ec2 Binary files /dev/null and b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f2.png differ diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f3.png b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f3.png new file mode 100644 index 0000000..9111bfc Binary files /dev/null and b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f3.png differ diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f4.png b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f4.png new file mode 100644 index 0000000..f9a6b46 Binary files /dev/null and b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f4.png differ diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f5.png b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f5.png new file mode 100644 index 0000000..b110b29 Binary files /dev/null and b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f5.png differ diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f6.png b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f6.png new file mode 100644 index 0000000..ec6eb21 Binary files /dev/null and b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f6.png differ diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f7.png b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f7.png new file mode 100644 index 0000000..dee7386 Binary files /dev/null and b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/f7.png differ diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/fd.mp4 b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/fd.mp4 new file mode 100644 index 0000000..cc572b9 Binary files /dev/null and b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/fd.mp4 differ diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/funcs.png b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/funcs.png new file mode 100644 index 0000000..022cd74 Binary files /dev/null and b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/funcs.png differ diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/layers.png b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/layers.png new file mode 100644 index 0000000..f988092 Binary files /dev/null and b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/layers.png differ diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/layers1.png b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/layers1.png new file mode 100644 index 0000000..1b54f86 Binary files /dev/null and b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/layers1.png differ diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/layers2.png b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/layers2.png new file mode 100644 index 0000000..406c453 Binary files /dev/null and b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/layers2.png differ diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/layers3.png b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/layers3.png new file mode 100644 index 0000000..ac439b0 Binary files /dev/null and b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/layers3.png differ diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/mkfatimg.zip b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/mkfatimg.zip new file mode 100644 index 0000000..d0728b4 Binary files /dev/null and b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/mkfatimg.zip differ diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/mkfs.xls b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/mkfs.xls new file mode 100644 index 0000000..f01ddcc Binary files /dev/null and b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/mkfs.xls differ diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/modules.png b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/modules.png new file mode 100644 index 0000000..b1ab987 Binary files /dev/null and b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/modules.png differ diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/rwtest1.png b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/rwtest1.png new file mode 100644 index 0000000..bc03302 Binary files /dev/null and b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/rwtest1.png differ diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/rwtest2.png b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/rwtest2.png new file mode 100644 index 0000000..41a8c1f Binary files /dev/null and b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/rwtest2.png differ diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/rwtest3.png b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/rwtest3.png new file mode 100644 index 0000000..cbaa3d1 Binary files /dev/null and b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/res/rwtest3.png differ diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/updates.txt b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/updates.txt new file mode 100644 index 0000000..2de0651 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/updates.txt @@ -0,0 +1,189 @@ +R0.12b (September 4, 2016) + Improved f_rename() to be able to rename objects with the same name but case. + Fixed an error in the case conversion teble of code page 866. (ff.c) + Fixed writing data is truncated at the file offset 4GiB on the exFAT volume. (appeared at R0.12) + Fixed creating a file in the root directory of exFAT volume can fail. (appeared at R0.12) + Fixed f_mkfs() creating exFAT volume with too small cluster size can collapse unallocated memory. (appeared at R0.12) + Fixed wrong object name can be returned when read directory at Unicode cfg. (appeared at R0.12) + Fixed large file allocation/removing on the exFAT volume collapses allocation bitmap. (appeared at R0.12) + Fixed some internal errors in f_expand() and f_lseek(). (appeared at R0.12) + +R0.12a (July 10, 2016) + Added support for creating exFAT volume with some changes of f_mkfs(). + Added a file open method FA_OPEN_APPEND. An f_lseek() following f_open() is no longer needed. + f_forward() is available regardless of _FS_TINY. + Fixed f_mkfs() creates wrong volume. (appeared at R0.12) + Fixed wrong memory read in create_name(). (appeared at R0.12) + Fixed compilation fails at some configurations, _USE_FASTSEEK and _USE_FORWARD. + +R0.12 (April 12, 2016) + Added support for exFAT file system. (_FS_EXFAT) + Added f_expand(). (_USE_EXPAND) + Changed some members in FINFO structure and behavior of f_readdir(). + Added an option _USE_CHMOD and removed an option _WORD_ACCESS. + Fixed errors in the case conversion teble of Unicode (cc*.c). + +R0.11a (September 5, 2015) + Fixed wrong media change can lead a deadlock at thread-safe configuration. + Added code page 771, 860, 861, 863, 864, 865 and 869. (_CODE_PAGE) + Removed some code pages actually not exist on the standard systems. (_CODE_PAGE) + Fixed errors in the case conversion teble of code page 437 and 850 (ff.c). + Fixed errors in the case conversion teble of Unicode (cc*.c). + +R0.11 (February 9, 2015) + Added f_findfirst() and f_findnext(). (_USE_FIND) + Fixed f_unlink() does not remove cluster chain of the file. (appeared at R0.10c) + Fixed _FS_NORTC option does not work properly. (appeared at R0.10c) + +R0.10c (November 9, 2014) + Added a configuration option for the platforms without RTC. (_FS_NORTC) + Fixed volume label created by Mac OS X cannot be retrieved with f_getlabel(). (appeared at R0.09b) + Fixed a potential problem of FAT access that can appear on disk error. + Fixed null pointer dereference on attempting to delete the root direcotry. (appeared at R0.08) + +R0.10b (May 19, 2014) + Fixed a hard error in the disk I/O layer can collapse the directory entry. + Fixed LFN entry is not deleted on delete/rename an object with its lossy converted SFN. (appeared at R0.07) + +R0.10a (January 15, 2014) + Added arbitrary strings as drive number in the path name. (_STR_VOLUME_ID) + Added an option for minimum sector size. (_MIN_SS) + 2nd argument of f_rename() can have a drive number and it will be ignored. + Fixed f_mount() with forced mount fails when drive number is larger than 0. (appeared at R0.10) + Fixed f_close() invalidates the file object without volume lock. + Fixed volume lock is left acquired after return from f_closedir(). (appeared at R0.10) + Fixed creation of a directory entry with LFN fails on too many SFN collisions. (appeared at R0.07) + +R0.10 (October 2, 2013) + Added an option for character encoding on the file. (_STRF_ENCODE) + Added f_closedir(). + Added forced full FAT scan option for f_getfree(). (_FS_NOFSINFO) + Added forced mount option with changes of f_mount(). + Improved behavior of volume auto detection. + Improved write throughput of f_puts() and f_printf(). + Changed argument of f_chdrive(), f_mkfs(), disk_read() and disk_write(). + Fixed f_write() can be truncated when the file size is close to 4GB. + Fixed f_open(), f_mkdir() and f_setlabel() can return incorrect result code on error. + +R0.09b (January 24, 2013) + Added f_getlabel() and f_setlabel(). (_USE_LABEL = 1) + +R0.09a (August 27, 2012) + Fixed assertion failure due to OS/2 EA on FAT12/16 volume. + Changed file functions reject null object pointer to avoid crash. + Changed option name _FS_SHARE to _FS_LOCK. + +R0.09 (September 6, 2011) + f_mkfs() supports multiple partition on a physical drive. + Added f_fdisk(). (_MULTI_PARTITION = 2) + +R0.08b (January 15, 2011) + Fast seek function is also applied to f_read() and f_write(). + f_lseek() reports required table size on creating CLMP. + Extended format syntax of f_printf(). + Ignores duplicated directory separators in given path names. + +R0.08a (August 16, 2010) + Added f_getcwd(). (_FS_RPATH = 2) + Added sector erase function. (_USE_ERASE) + Moved file lock semaphore table from fs object to the bss. + Fixed a wrong directory entry is created on non-LFN cfg when the given name contains ';'. + Fixed f_mkfs() creates wrong FAT32 volume. + +R0.08 (May 15, 2010) + Added a memory configuration option. (_USE_LFN) + Added support of file lock. (_FS_SHARE) + Added fast seek function. (_USE_FASTSEEK) + Changed some types on the API, XCHAR->TCHAR. + Changed fname member in the FILINFO structure on Unicode cfg. + String functions support UTF-8 encoding files on Unicode cfg. + +R0.07e (November 3, 2009) + Separated out configuration options from ff.h to ffconf.h. + Added a configuration option, _LFN_UNICODE. + Fixed f_unlink() fails to remove a sub-dir on _FS_RPATH. + Fixed name matching error on the 13 char boundary. + Changed f_readdir() to return the SFN with always upper case on non-LFN cfg. + +R0.07c (Junuary 21, 2009) + Fixed f_unlink() may return FR_OK on error. + Fixed wrong cache control in f_lseek(). + Added support of relative path. + Added f_chdir(). + Added f_chdrive(). + Added proper case conversion to extended characters. + +R0.07a (April 14, 2009) + Separated out OS dependent code on re-entrant configuration. + Added multiple sector size support. + +R0.07 (April 1, 2009) + Merged Tiny-FatFs into FatFs as a buffer configuration option. + Added long file name support. + Added multiple code page support. + Added re-entrancy for multitask operation. + Added auto cluster size selection to f_mkfs(). + Added rewind option to f_readdir(). + Changed result code of critical errors. + Renamed string functions to avoid name collision. + +R0.06 (April 1, 2008) + Added f_forward. (Tiny-FatFs) + Added string functions: fgets, fputc, fputs and fprintf. + Improved performance of f_lseek on moving to the same or following cluster. + +R0.05a (February 3, 2008) + Added f_truncate. + Added f_utime. + Fixed off by one error at FAT sub-type determination. + Fixed btr in f_read can be mistruncated. + Fixed cached sector is left not flushed when create and close without write. + +R0.05 (August 26, 2007) + Changed arguments of f_read, f_write. + Changed arguments of f_mkfs. (FatFs) + Fixed f_mkfs on FAT32 creates incorrect FSInfo. (FatFs) + Fixed f_mkdir on FAT32 creates incorrect directory. (FatFs) + +R0.04b (May 5, 2007) + Added _USE_NTFLAG option. + Added FSInfo support. + Fixed some problems corresponds to FAT32. (Tiny-FatFs) + Fixed DBCS name can result FR_INVALID_NAME. + Fixed short seek (<= csize) collapses the file object. + +R0.04a (April 1, 2007) + Supported multiple partitions on a plysical drive. (FatFs) + Added minimization level 3. + Added a capability of extending file size to f_lseek. + Fixed an endian sensitive code in f_mkfs. (FatFs) + Fixed a problem corresponds to FAT32 support. (Tiny-FatFs) + +R0.04 (February 4, 2007) + Supported multiple drive system. (FatFs) + Changed some APIs for multiple drive system. + Added f_mkfs. (FatFs) + Added _USE_FAT32 option. (Tiny-FatFs) + +R0.03a (December 11, 2006) + Improved cluster scan algolithm to write files fast. + Fixed f_mkdir creates incorrect directory on FAT32. + +R0.03 (September 22, 2006) + Added f_rename. + Changed option _FS_MINIMUM to _FS_MINIMIZE. + +R0.02a (June 10, 2006) + Added a configuration option _FS_MINIMUM. + +R0.02 (Jun 01, 2006) + Added FAT12. + Removed unbuffered mode. + Fixed a problem on small (<32M) patition. + +R0.01 (April 29, 2006) + First release + +R0.00 (February 26, 2006) + Prototype (not released) + -- cgit v1.2.3