aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-08-15 02:22:02 +1000
committerinmarket <andrewh@inmarket.com.au>2014-08-15 02:22:02 +1000
commit75e1e7a5e26491e942fb2b25f518d8e2e3112721 (patch)
tree970754edda05d38bce1f85492868eca717820b99 /3rdparty
parent9b570be049bf656489bdce823f6f04beb80f053d (diff)
downloaduGFX-75e1e7a5e26491e942fb2b25f518d8e2e3112721.tar.gz
uGFX-75e1e7a5e26491e942fb2b25f518d8e2e3112721.tar.bz2
uGFX-75e1e7a5e26491e942fb2b25f518d8e2e3112721.zip
Add GFILE support for PetitFS (a very tiny FAT implementation)
Diffstat (limited to '3rdparty')
-rw-r--r--3rdparty/petitfs-0.03/doc/00index_p.html77
-rw-r--r--3rdparty/petitfs-0.03/doc/css_e.css65
-rw-r--r--3rdparty/petitfs-0.03/doc/css_p.css1
-rw-r--r--3rdparty/petitfs-0.03/doc/img/layers3.pngbin0 -> 2379 bytes
-rw-r--r--3rdparty/petitfs-0.03/doc/img/rwtest3.pngbin0 -> 3011 bytes
-rw-r--r--3rdparty/petitfs-0.03/doc/pf/appnote.html91
-rw-r--r--3rdparty/petitfs-0.03/doc/pf/dinit.html40
-rw-r--r--3rdparty/petitfs-0.03/doc/pf/dreadp.html59
-rw-r--r--3rdparty/petitfs-0.03/doc/pf/dwritep.html73
-rw-r--r--3rdparty/petitfs-0.03/doc/pf/filename.html22
-rw-r--r--3rdparty/petitfs-0.03/doc/pf/lseek.html79
-rw-r--r--3rdparty/petitfs-0.03/doc/pf/mount.html65
-rw-r--r--3rdparty/petitfs-0.03/doc/pf/open.html103
-rw-r--r--3rdparty/petitfs-0.03/doc/pf/opendir.html72
-rw-r--r--3rdparty/petitfs-0.03/doc/pf/read.html73
-rw-r--r--3rdparty/petitfs-0.03/doc/pf/readdir.html100
-rw-r--r--3rdparty/petitfs-0.03/doc/pf/sdir.html30
-rw-r--r--3rdparty/petitfs-0.03/doc/pf/sfatfs.html39
-rw-r--r--3rdparty/petitfs-0.03/doc/pf/sfileinfo.html62
-rw-r--r--3rdparty/petitfs-0.03/doc/pf/write.html86
-rw-r--r--3rdparty/petitfs-0.03/src/00readme.txt46
-rw-r--r--3rdparty/petitfs-0.03/src/diskio.c73
-rw-r--r--3rdparty/petitfs-0.03/src/diskio.h42
-rw-r--r--3rdparty/petitfs-0.03/src/integer.h33
-rw-r--r--3rdparty/petitfs-0.03/src/pff.c1108
-rw-r--r--3rdparty/petitfs-0.03/src/pff.h159
-rw-r--r--3rdparty/petitfs-0.03/src/pffconf.h89
27 files changed, 2687 insertions, 0 deletions
diff --git a/3rdparty/petitfs-0.03/doc/00index_p.html b/3rdparty/petitfs-0.03/doc/00index_p.html
new file mode 100644
index 00000000..fe5ada00
--- /dev/null
+++ b/3rdparty/petitfs-0.03/doc/00index_p.html
@@ -0,0 +1,77 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<meta http-equiv="cache-control" content="no-cache">
+<meta name="description" content="A tiny FAT file system for embedded projects">
+<link rel="start" title="Site Top" href="../../">
+<link rel="up" title="Freewares" href="../../fsw_e.html">
+<link rel="stylesheet" href="css_e.css" type="text/css" media="screen" title="ELM Default">
+<link rel="stylesheet" href="css_p.css" type="text/css" media="screen" title="ELM Default">
+<title>Petit FAT File System Module</title>
+</head>
+
+<body>
+<h1>Petit FAT File System Module</h1>
+<hr>
+
+<div class="abst">
+<img src="img/layers3.png" class="rset" width="245" height="255" alt="layer">
+<p>Petit FatFs is a sub-set of FatFs module for tiny 8-bit microcontrollers. It is written in compliance with ANSI C and completely separated from the disk I/O layer. It can be incorporated into the tiny microcontrollers with limited memory even if the RAM size is less than sector size. Also full featured FAT file system module is available <a href="http://elm-chan.org/fsw/ff/00index_e.html">here</a>↗.</p>
+
+<h4>Features</h4>
+<ul>
+ <li>Very small RAM consumption (44 bytes work area + certain stack).</li>
+ <li>Very small code size (2K-4K bytes).</li>
+ <li>FAT12, FAT16 and FAT32.</li>
+ <li>Single volume and Single file.</li>
+ <li>File write function with some restrictions.</li>
+</ul>
+</div>
+
+
+<div class="para">
+<h3>Application Interface</h3>
+<p>Petit FatFs module provides following functions.</p>
+<ul>
+<li><a href="pf/mount.html">pf_mount</a> - Mount a Volume</li>
+<li><a href="pf/open.html">pf_open</a> - Open a File</li>
+<li><a href="pf/read.html">pf_read</a> - Read File</li>
+<li><a href="pf/write.html">pf_write</a> - Write File</li>
+<li><a href="pf/lseek.html">pf_lseek</a> - Move read/write Pointer</li>
+<li><a href="pf/opendir.html">pf_opendir</a> - Open a Directory</li>
+<li><a href="pf/readdir.html">pf_readdir</a> - Read a Directory Item</li>
+</ul>
+</div>
+
+
+<div class="para">
+<h3>Disk I/O Interface</h3>
+<p>Since the Petit FatFs module is completely separated from disk I/O layer, it requires following functions to lower layer to read data from storage device. The low level disk I/O module is not a part of Petit FatFs module and it must be provided by user. The sample drivers are also available in the resources.</p>
+<ul>
+<li><a href="pf/dinit.html">disk_initialize</a> - Initialize storage device</li>
+<li><a href="pf/dreadp.html">disk_readp</a> - Read a partial sector</li>
+<li><a href="pf/dwritep.html">disk_writep</a> - Divided write to a sector</li>
+</ul>
+</div>
+
+
+<div class="para">
+<h3>Resources</h3>
+<p>The Petit FatFs module is a free software and is opened for education, research and development. You can use, modify and/or redistribute it for personal, non-profit or commercial use without any restriction under your responsibility. For further information, refer to the application note.</p>
+<ul>
+<li><a href="http://elm-chan.org/fsw/ff/bd/"><em>FatFs User Forum</em></a>↗</li>
+<li>Read first: <a href="pf/appnote.html">Petit FatFs module application note</a> <span class="mfd">June 10, 2014</span></li>
+ <li>Latest Information: <a href="http://elm-chan.org/fsw/ff/00index_p.html">http://elm-chan.org/fsw/ff/00index_p.html</a>↗</li>
+<li><a href="http://www.microsoft.com/whdc/system/platform/firmware/fatgen.mspx">FAT32 Specification by Microsoft</a>↗ (The reference document on FAT file system)</li>
+<li><a href="http://elm-chan.org/docs/mmc/mmc_e.html">How to Use MMC/SDC</a>↗</li>
+<li><a href="img/rwtest3.png">Benchmark 3</a> (ATtiny85/8MHz with MMC via USI)</li>
+</ul>
+</div>
+
+
+<hr>
+<p class="foot"><a href="../../fsw_e.html">Return</a></p>
+</body>
+</html>
diff --git a/3rdparty/petitfs-0.03/doc/css_e.css b/3rdparty/petitfs-0.03/doc/css_e.css
new file mode 100644
index 00000000..1b544eb6
--- /dev/null
+++ b/3rdparty/petitfs-0.03/doc/css_e.css
@@ -0,0 +1,65 @@
+* {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;}
+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;}
+p.hdd {float: right; text-align: right; margin-top: 0.5em;}
+hr.hds {clear: both; margin-bottom: 1em;}
+
+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;}
+h4 {font-size: 1.2em; font-family: sans-serif; margin: 1em 0 0.2em;}
+h5 {font-size: 1em; font-family: sans-serif; margin: 0.5em 0 0em;}
+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/3rdparty/petitfs-0.03/doc/css_p.css b/3rdparty/petitfs-0.03/doc/css_p.css
new file mode 100644
index 00000000..bc7b5b09
--- /dev/null
+++ b/3rdparty/petitfs-0.03/doc/css_p.css
@@ -0,0 +1 @@
+body {margin: 8px; background-color: #ffecf0; font-color: black; font-family: serif; line-height: 133%; max-width: 1024px;}
diff --git a/3rdparty/petitfs-0.03/doc/img/layers3.png b/3rdparty/petitfs-0.03/doc/img/layers3.png
new file mode 100644
index 00000000..ac439b0b
--- /dev/null
+++ b/3rdparty/petitfs-0.03/doc/img/layers3.png
Binary files differ
diff --git a/3rdparty/petitfs-0.03/doc/img/rwtest3.png b/3rdparty/petitfs-0.03/doc/img/rwtest3.png
new file mode 100644
index 00000000..cbaa3d11
--- /dev/null
+++ b/3rdparty/petitfs-0.03/doc/img/rwtest3.png
Binary files differ
diff --git a/3rdparty/petitfs-0.03/doc/pf/appnote.html b/3rdparty/petitfs-0.03/doc/pf/appnote.html
new file mode 100644
index 00000000..68df279d
--- /dev/null
+++ b/3rdparty/petitfs-0.03/doc/pf/appnote.html
@@ -0,0 +1,91 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="Petit FatFs" href="../00index_p.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<link rel="stylesheet" href="../css_p.css" type="text/css" media="screen" title="ELM Default">
+<title>FatFs Module Application Note</title>
+</head>
+
+<body>
+<h1>Petit FatFs Module Application Note</h1>
+<hr>
+
+<h3>Basic Considerations</h3>
+<p>The FatFs module is assuming following conditions on portability.</p>
+<ul>
+<li>ANSI C<br>
+The FatFs module is a middleware written in ANSI C (C89). There is no platform dependence, so long as the compiler is in compliance with ANSI C.</li>
+<li>Size of integer types<br>
+The FatFs module assumes that size of char/short/long are 8/16/32 bit and int is 16 or 32 bit. These correspondence are defined in <tt>integer.h</tt>. This will not be a problem on most compilers. When any conflict with existing definitions is occured, you must resolve it with care.</li>
+</ul>
+</div>
+
+<div class="para">
+<h3>Memory Usage (R0.03)</h3>
+<table class="lst2">
+<tr><th></th><th>AVR</th><th>x86</th></tr>
+<tr><td>Compiler</td><td>gcc(WinAVR)</td><td>VC6</td></tr>
+<tr><td>_WORD_ACCESS</td><td>1</td><td>1</td></tr>
+<tr class="lst3"><td>Code (default)</td><td>2100</td><td>1720</td></tr>
+<tr><td>Code (!_USE_READ)</td><td>-444</td><td>-246</td></tr>
+<tr><td>Code (_USE_DIR)</td><td>+1002</td><td>+420</td></tr>
+<tr><td>Code (_USE_LSEEK)</td><td>+490</td><td>+228</td></tr>
+<tr><td>Code (_USE_WRITE)</td><td>+518</td><td>+351</td></tr>
+<tr><td>RAM (bss)</td><td>2</td><td>4</td></tr>
+<tr><td>RAM (work)</td><td>42</td><td>44</td></tr>
+</table>
+<p>This is the size of the Petit FatFs module itself. In addition to this, a low level disk I/O module will be required for a complete function. The size of MMC/SDC module on AVR becomes approximate 620 bytes without write function and 840 bytes with write function.</p>
+</div>
+
+<div class="para">
+<h3>Module Size Reduction</h3>
+<p>Follwing table shows which function is removed by configuration options for the module size reduction.</p>
+<table class="lst2">
+<tr><td rowspan="2">Function</td><td>_USE_READ</td><td>_USE_DIR</td><td>_USE_LSEEK</td><td>_USE_WRITE</td></tr>
+<tr><td>0</td><td>0</td><td>0</td><td>0</td></tr>
+<tr class="lst3"><td>pf_mount</td><td></td><td></td><td></td><td></td></tr>
+<tr><td>pf_open</td><td></td><td></td><td></td><td></td></tr>
+<tr><td>pf_read</td><td>x</td><td></td><td></td><td></td></tr>
+<tr><td>pf_lseek</td><td></td><td></td><td>x</td><td></td></tr>
+<tr><td>pf_opendir</td><td></td><td>x</td><td></td><td></td></tr>
+<tr><td>pf_readdir</td><td></td><td>x</td><td></td><td></td></tr>
+<tr><td>pf_write</td><td></td><td></td><td></td><td>x</td></tr>
+</table>
+</div>
+
+<div class="para">
+<h3>Performance effective file access</h3>
+<p>For good performance on reading a file on the small embedded system, application programmer should consider what process is done in the file system module.</p>
+<p>The Petit FatFs reads the disk sectors without a sector buffer. This means the file system reads a part of the sector contains the required data every reference point even if they are in the same sector. However the generic storage device are not byte addressable so that the disk I/O layer will read the entire sector and pick up the data bytes from the read data steram.</p>
+<p>When read 512 byte data from a file at a time, the data sector will be read only a time. When read that data in byte-by-byte, the data sector will be read 512 times. Therefore the byte-by-byte read request will <a href="../img/rwtest3.png">drastically decrease</a> the read performance. To avoid this stupid read controls, the file data should be read in long block as possible. Sector alignment access is not impotant on the Petit FatFs.</p>
+<p>The tiny microcontrollers targeted by Petit FatFs has a limited size of RAM. It may not able to allocate a certain size of read buffer and most type of text processing will require byte-by-byte read operation. The Petit FatFs supports data forwarding feature for such purpose.</p>
+
+</div>
+
+<div class="para">
+<h3>About FatFs License</h3>
+<p>Petit FatFs has being developped as a personal project of author, ChaN. It is free from the code anyone else wrote. Following code block shows a copy of the license document that included in the source files.</p>
+<pre>/*----------------------------------------------------------------------------/
+/ Petit FatFs - FAT file system module R0.03 (C)ChaN, 2014
+/-----------------------------------------------------------------------------/
+/ Petit FatFs module is a generic FAT file system module for small embedded
+/ systems. This is a free software that opened for education, research and
+/ commercial developments under license policy of following trems.
+/
+/ Copyright (C) 2014, ChaN, all right reserved.
+/
+/ * The Petit FatFs module is a free software and there is NO WARRANTY.
+/ * No restriction on use. You can use, modify and redistribute it for
+/ personal, non-profit or commercial products UNDER YOUR RESPONSIBILITY.
+/ * Redistributions of source code must retain the above copyright notice.
+/
+/-----------------------------------------------------------------------------/</pre>
+<p>Therefore FatFs license is one of the BSD-style licenses but there is a significant feature. Because FatFs is for embedded projects, the conditions of redistributions in binary form, such as embedded code, hex file, binary library and any form without source code, are not specified in order to extend usability to commercial use. The documentation of the distributions need not include about Petit FatFs and its license document, and it may also. This is equivalent to the BSD 1-Clause License. Of course Petit FatFs is compatible with the projects under GNU GPL. When redistribute the Petit FatFs with any modification, the license can also be changed to GNU GPL or BSD-style license.</p>
+</div>
+
+<p class="foot"><a href="../00index_p.html">Return</a></p>
+</body>
+</html>
diff --git a/3rdparty/petitfs-0.03/doc/pf/dinit.html b/3rdparty/petitfs-0.03/doc/pf/dinit.html
new file mode 100644
index 00000000..b7a5f418
--- /dev/null
+++ b/3rdparty/petitfs-0.03/doc/pf/dinit.html
@@ -0,0 +1,40 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="Petit FatFs" href="../00index_p.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<link rel="stylesheet" href="../css_p.css" type="text/css" media="screen" title="ELM Default">
+<title>Petit FatFs - disk_initialize</title>
+</head>
+
+<body>
+
+<div class="para">
+<h2>disk_initialize</h2>
+<p>The disk_initialize function initializes the disk drive.</p>
+<pre>
+DSTATUS disk_initialize (void)
+</pre>
+</div>
+
+<div class="para">
+<h4>Return Values</h4>
+<p>The disk status is returned in combination of following flags.</p>
+<dl class="ret">
+<dt>STA_NOINIT</dt>
+<dd>Indicates that the disk drive has not been initialized. This flag is set on: system reset, disk removal and disk_initialize function failed, and cleared on: disk_initialize function succeeded.</dd>
+<dt>STA_NODISK</dt>
+<dd>Indicates that no medium in the drive. This is always cleared on fixed disk drive. This flag is not referred by Petit FatFs.</dd>
+</dl>
+</div>
+
+<div class="para">
+<h4>Description</h4>
+<p>The disk_initialize function initializes the storage device. If the function succeeded, <tt>STA_NOINIT</tt> flag in the return value is cleared.</p>
+</div>
+
+<p class="foot"><a href="../00index_p.html">Return</a></p>
+</body>
+</html>
diff --git a/3rdparty/petitfs-0.03/doc/pf/dreadp.html b/3rdparty/petitfs-0.03/doc/pf/dreadp.html
new file mode 100644
index 00000000..dd97561e
--- /dev/null
+++ b/3rdparty/petitfs-0.03/doc/pf/dreadp.html
@@ -0,0 +1,59 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="Petit FatFs" href="../00index_p.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<link rel="stylesheet" href="../css_p.css" type="text/css" media="screen" title="ELM Default">
+<title>Petit FatFs - disk_readp</title>
+</head>
+
+<body>
+
+<div class="para">
+<h2>disk_readp</h2>
+<p>The disk_readp function reads a partial sector of the device.</p>
+<pre>
+DRESULT disk_readp (
+ BYTE* <span class="arg">buff</span>, <span class="c">/* [OUT] Pointer to the read buffer */</span>
+ DWORD <span class="arg">sector</span>, <span class="c">/* [IN] Sector number */</span>
+ UINT <span class="arg">offset</span>, <span class="c">/* [IN] Byte offset in the sector to start to read */</span>
+ UINT <span class="arg">count</span> <span class="c">/* [IN] Number of bytes to read */</span>
+);
+</pre>
+</div>
+
+<div class="para">
+<h4>Parameters</h4>
+<dl class="par">
+<dt>buff</dt>
+<dd>Pointer to the read buffer to store the read data. If a NULL is given, read bytes will be forwarded to the outgoing stream instead of the memory.</dd>
+<dt>sector</dt>
+<dd>Specifies the sector number to be read in logical block address (LBA).</dd>
+<dt>offset</dt>
+<dd>Specifies the byte offset in the sector to start to read. The value can be 0 to 511.</dd>
+<dt>count</dt>
+<dd>Specifies number of bytes to read. The value can be 0 to 512 and <tt class="arg">offset</tt> + <tt class="arg">count</tt> must not exceed 512.</dd>
+</dl>
+</div>
+
+
+<div class="para">
+<h4>Return Value</h4>
+<dl class="ret">
+<dt>RES_OK (0)</dt>
+<dd>The function succeeded.</dd>
+<dt>RES_ERROR</dt>
+<dd>Any hard error occured during the disk read operation and could not recover it.</dd>
+<dt>RES_PARERR</dt>
+<dd>Invalid parameter.</dd>
+<dt>RES_NOTRDY</dt>
+<dd>The device has not been initialized.</dd>
+</dl>
+</div>
+
+
+<p class="foot"><a href="../00index_p.html">Return</a></p>
+</body>
+</html>
diff --git a/3rdparty/petitfs-0.03/doc/pf/dwritep.html b/3rdparty/petitfs-0.03/doc/pf/dwritep.html
new file mode 100644
index 00000000..d3342ce1
--- /dev/null
+++ b/3rdparty/petitfs-0.03/doc/pf/dwritep.html
@@ -0,0 +1,73 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="Petit FatFs" href="../00index_p.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<link rel="stylesheet" href="../css_p.css" type="text/css" media="screen" title="ELM Default">
+<title>Petit FatFs - disk_writep</title>
+</head>
+
+<body>
+
+<div class="para">
+<h2>disk_writep</h2>
+<p>The disk_writep function writes data to the sector.</p>
+<pre>
+DRESULT disk_writep (
+ BYTE* <span class="arg">buff</span>, <span class="c">/* [IN] Pointer to the data to be written */</span>
+ DWORD <span class="arg">sc</span>, <span class="c">/* [IN] Sector number or Number of bytes to wtite */</span>
+);
+</pre>
+</div>
+
+<div class="para">
+<h4>Parameters</h4>
+<dl class="par">
+<dt>buff</dt>
+<dd>Pointer to the data to be written to the sector. If a NULL is given, the function initiate/finalize a write transaction to the sector.</dd>
+<dt>sc</dt>
+<dd>Specifies nubmer of bytes to write if <tt class="arg">buff</tt> is not a NULL. If <tt class="arg">buff</tt> is a NULL and <tt class="arg">sc</tt> is not a zero, the function initiates a write transactin to the sector. If <tt class="arg">buff</tt> and <tt class="arg">sc</tt> are zero, the function finalize the current sector write transactin.</dd>
+</dl>
+</div>
+
+
+<div class="para">
+<h4>Return Value</h4>
+<dl class="ret">
+<dt>RES_OK (0)</dt>
+<dd>The function succeeded.</dd>
+<dt>RES_ERROR</dt>
+<dd>Any hard error occured during the write operation and could not recover it or the medium is write protected.</dd>
+<dt>RES_PARERR</dt>
+<dd>Invalid parameter.</dd>
+<dt>RES_NOTRDY</dt>
+<dd>The device has not been initialized.</dd>
+</dl>
+</div>
+
+
+<div class="para">
+<h4>Description</h4>
+<p>A sector write operation is done in following sequence.</p>
+<ol>
+<li><tt>disk_writep(0, sector_number);</tt> Initiate a sector write transaction.</li>
+<li><tt>disk_writep(data, byte_to_write);</tt> Start to write data to the sector.</li>
+<li><tt>disk_writep(data, byte_to_write);</tt> And data can be written upto 512 bytes with one or more calls.</li>
+<li><tt>disk_writep(data, byte_to_write);</tt> ...</li>
+<li><tt>disk_writep(0, 0);</tt> Finalize the write transaction. If number of bytes sent is less than 512, left bytes in the sector is filled by zero.</li>
+</ol>
+<p>If a write transaction is in progress, <tt>disk_readp()</tt> function will fail and <tt>disk_initialize()</tt> function finalize the current write transaction.</p>
+</div>
+
+
+<div class="para">
+<h4>Remarks</h4>
+<p>This funciton is needed when <tt>_USE_WRITE == 1</tt>.</p>
+</div>
+
+
+<p class="foot"><a href="../00index_p.html">Return</a></p>
+</body>
+</html>
diff --git a/3rdparty/petitfs-0.03/doc/pf/filename.html b/3rdparty/petitfs-0.03/doc/pf/filename.html
new file mode 100644
index 00000000..58e42453
--- /dev/null
+++ b/3rdparty/petitfs-0.03/doc/pf/filename.html
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="Petit FatFs" href="../00index_p.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<link rel="stylesheet" href="../css_p.css" type="text/css" media="screen" title="ELM Default">
+<title>Petit FatFs - Path Names</title>
+</head>
+
+<body>
+
+<div class="para">
+<h2>Format of the path names</h2>
+<p>The path name format on the Petit FatFs module is similer to MS-DOS as follows.</p>
+<pre>"[/]<em>directory</em>/<em>file</em>"</pre>
+<p>The Petit FatFs module supports only 8.3 format file name. The sub-directories are separated with a /. The path name is terminated with a nul character, control character or white space. Heading spaces are ignored and skipped. When <tt>_USE_LCC == 1</tt>, lower case characters are allowed for the path name.</p>
+<p>The Petit FatFs module 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 following from the root directory. Heading separator is ignored and it can be exist or omitted.</p>
+</div>
+</body>
+</html>
diff --git a/3rdparty/petitfs-0.03/doc/pf/lseek.html b/3rdparty/petitfs-0.03/doc/pf/lseek.html
new file mode 100644
index 00000000..1dbb0dea
--- /dev/null
+++ b/3rdparty/petitfs-0.03/doc/pf/lseek.html
@@ -0,0 +1,79 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="Petit FatFs" href="../00index_p.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<link rel="stylesheet" href="../css_p.css" type="text/css" media="screen" title="ELM Default">
+<title>Petit FatFs - pf_lseek</title>
+</head>
+
+<body>
+
+<div class="para">
+<h2>pf_lseek</h2>
+<p>The pf_lseek function moves the file read/write pointer of the open file.</p>
+
+<pre>
+FRESULT pf_lseek (
+ DWORD <span class="arg">ofs</span> <span class="c">/* [IN] File offset in unit of byte */</span>
+);
+</pre>
+</div>
+
+<div class="para">
+<h4>Parameters</h4>
+<dl class="par">
+<dt>ofs</dt>
+<dd>Number of bytes where from start of the file</dd>
+</dl>
+</div>
+
+
+<div class="para">
+<h4>Return Values</h4>
+<dl class="ret">
+<dt>FR_OK (0)</dt>
+<dd>The function succeeded.</dd>
+<dt>FR_DISK_ERR</dt>
+<dd>The function failed due to an error in the disk function, a wrong FAT structure or an internal error.</dd>
+<dt>FR_NOT_OPENED</dt>
+<dd>The file has not been opened.</dd>
+</dl>
+</div>
+
+
+<div class="para">
+<h4>Description</h4>
+<p>The <tt>pf_lseek()</tt> function moves the file read/write pointer of the open file. The <tt class="arg">offset</tt> can be specified in only origin from top of the file.</p>
+</div>
+
+
+<div class="para">
+<h4>Example</h4>
+<pre>
+ <span class="c">/* Move to offset of 5000 from top of the file */</span>
+ res = pf_lseek(5000);
+
+ <span class="c">/* Forward 3000 bytes */</span>
+ res = pf_lseek(fs.fptr + 3000);
+
+ <span class="c">/* Rewind 2000 bytes (take care on wraparound) */</span>
+ res = pf_lseek(fs.fptr - 2000);
+</pre>
+</div>
+
+<div class="para">
+<h4>QuickInfo</h4>
+<p>Available when <tt>_USE_LSEEK == 1</tt>.</p>
+</div>
+
+<div class="para">
+<h4>References</h4>
+<p><tt><a href="open.html">pf_open</a>, <a href="sfatfs.html">FATFS</a></tt></p>
+</div>
+
+<p class="foot"><a href="../00index_p.html">Return</a></p>
+</body>
+</html>
diff --git a/3rdparty/petitfs-0.03/doc/pf/mount.html b/3rdparty/petitfs-0.03/doc/pf/mount.html
new file mode 100644
index 00000000..4c0f0210
--- /dev/null
+++ b/3rdparty/petitfs-0.03/doc/pf/mount.html
@@ -0,0 +1,65 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="Petit FatFs" href="../00index_p.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<link rel="stylesheet" href="../css_p.css" type="text/css" media="screen" title="ELM Default">
+<title>Petit FatFs - pf_mount</title>
+</head>
+
+<body>
+
+<div class="para">
+<h2>pf_mount</h2>
+<p>The pf_mount fucntion mounts a volume.</p>
+<pre>
+FRESULT pf_mount (
+ FATFS* <span class="arg">fs</span> <span class="c">/* [IN] Pointer to the work area */</span>
+);
+</pre>
+</div>
+
+<div class="para">
+<h4>Parameters</h4>
+<dl class="par">
+<dt>fs</dt>
+<dd>Pointer to the work area (file system object) to be registered.</dd>
+</dl>
+</div>
+
+<div class="para">
+<h4>Return Values</h4>
+<dl class="ret">
+<dt>FR_OK (0)</dt>
+<dd>The function succeeded.</dd>
+<dt>FR_NOT_READY</dt>
+<dd>The drive could not be initialized due to a disk error or no medium.</dd>
+<dt>FR_DISK_ERR</dt>
+<dd>An error occured in the disk function.</dd>
+<dt>FR_NO_FILESYSTEM</dt>
+<dd>There is no valid FAT partition on the disk.</dd>
+</dl>
+</div>
+
+
+<div class="para">
+<h4>Description</h4>
+<p>The <tt>pf_mount()</tt> function registers a work area to the Petit FatFs module. The volume is mounted on registration. The volume must be mounted with this function prior to any other file function and after every media changes.</p>
+</div>
+
+
+<div class="para">
+<h4>QuickInfo</h4>
+<p>Always available.</p>
+</div>
+
+<div class="para">
+<h4>References</h4>
+<p><tt><a href="sfatfs.html">FATFS</a></tt></p>
+</div>
+
+<p class="foot"><a href="../00index_p.html">Return</a></p>
+</body>
+</html>
diff --git a/3rdparty/petitfs-0.03/doc/pf/open.html b/3rdparty/petitfs-0.03/doc/pf/open.html
new file mode 100644
index 00000000..2914467f
--- /dev/null
+++ b/3rdparty/petitfs-0.03/doc/pf/open.html
@@ -0,0 +1,103 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="Petit FatFs" href="../00index_p.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<link rel="stylesheet" href="../css_p.css" type="text/css" media="screen" title="ELM Default">
+<title>Petit FatFs - pf_open</title>
+</head>
+
+<body>
+
+<div class="para">
+<h2>pf_open</h2>
+<p>The pf_open function opens an existing file.</p>
+<pre>
+FRESULT pf_open (
+ const char* <span class="arg">path</span> <span class="c">/* [IN] Pointer to the file neme */</span>
+);
+</pre>
+</div>
+
+<div class="para">
+<h4>Parameters</h4>
+<dl class="par">
+<dt>path</dt>
+<dd>Pointer to a null-terminated string that specifies the <a href="filename.html">file name</a> to open.</dd>
+</dl>
+</div>
+
+
+<div class="para">
+<h4>Return Values</h4>
+<dl class="ret">
+<dt>FR_OK (0)</dt>
+<dd>The function succeeded.</dd>
+<dt>FR_NO_FILE</dt>
+<dd>Could not find the file or path.</dd>
+<dt>FR_DISK_ERR</dt>
+<dd>The function failed due to a hard error in the disk function, a wrong FAT structure or an internal error.</dd>
+<dt>FR_NOT_ENABLED</dt>
+<dd>The volume has not been mounted.</dd>
+</dl>
+</div>
+
+
+<div class="para">
+<h4>Description</h4>
+<p>The file must be opend prior to use <tt>pf_read()</tt> and <tt>pf_lseek()</tt> function. The open file is valid until next open.</p>
+</div>
+
+
+<div class="para">
+<h4>Example</h4>
+<pre>
+int main (void)
+{
+ FATFS fs; <span class="c">/* Work area (file system object) for the volume */</span>
+ BYTE buff[16]; <span class="c">/* File read buffer */</span>
+ UINT br; <span class="c">/* File read count */</span>
+ FRESULT res; <span class="c">/* Petit FatFs function common result code */</span>
+
+
+ <span class="c">/* Mount the volume */</span>
+ pf_mount(&amp;fs);
+ if (res) die(res);
+
+ <span class="c">/* Open a file */</span>
+ res = pf_open("srcfile.dat");
+ if (res) die(res);
+
+ <span class="c">/* Read data to the memory */</span>
+ res = pf_read(buff, 16, &amp;br); <span class="c">/* Read data to the buff[] */</span>
+ if (res) die(res); <span class="c">/* Check error */</span>
+ if (br != 16) die(255); <span class="c">/* Check EOF */</span>
+
+ ....
+
+ <span class="c">/* Forward data to the outgoing stream */</span>
+ do
+ res = pf_read(0, 512, &amp;br); <span class="c">/* Send data to the stream */</span>
+ while (res || br != 512); <span class="c">/* Break on error or eof */</span>
+
+ ....
+
+}
+</pre>
+</div>
+
+<div class="para">
+<h4>QuickInfo</h4>
+<p>Always available.</p>
+</div>
+
+<div class="para">
+<h4>References</h4>
+<p><tt><a href="read.html">pf_read</a>, <a href="sfatfs.html">FATFS</a></tt></p>
+</div>
+
+<p class="foot"><a href="../00index_p.html">Return</a></p>
+</body>
+</html>
diff --git a/3rdparty/petitfs-0.03/doc/pf/opendir.html b/3rdparty/petitfs-0.03/doc/pf/opendir.html
new file mode 100644
index 00000000..6cb71d07
--- /dev/null
+++ b/3rdparty/petitfs-0.03/doc/pf/opendir.html
@@ -0,0 +1,72 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="Petit FatFs" href="../00index_p.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<link rel="stylesheet" href="../css_p.css" type="text/css" media="screen" title="ELM Default">
+<title>Petit FatFs - pf_opendir</title>
+</head>
+
+<body>
+
+<div class="para">
+<h2>pf_opendir</h2>
+<p>The pf_opendir function opens a directory.</p>
+<pre>
+FRESULT pf_opendir (
+ DIR* <span class="arg">dp</span>, <span class="c">/* [OUT] Pointer to the blank directory object structure */</span>
+ const char* <span class="arg">path</span> <span class="c">/* [IN] Pointer to the directory name */</span>
+);
+</pre>
+</div>
+
+<div class="para">
+<h4>Parameters</h4>
+<dl class="par">
+<dt>dp</dt>
+<dd>Pointer to the blank directory object to be created.</dd>
+<dt>path</dt>
+<dd>Pinter to the null-terminated string that specifies the <a href="filename.html">directory name</a> to be opened.</dd>
+</dl>
+</div>
+
+
+<div class="para">
+<h4>Return Values</h4>
+<dl class="ret">
+<dt>FR_OK (0)</dt>
+<dd>The function succeeded and the directory object is created. It is used for subsequent calls to read the directory entries.</dd>
+<dt>FR_NO_FILE</dt>
+<dd>Could not find the path.</dd>
+<dt>FR_NOT_READY</dt>
+<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
+<dt>FR_DISK_ERR</dt>
+<dd>The function failed due to a hard error in the disk function, a wrong FAT structure or an internal error.</dd>
+<dt>FR_NOT_ENABLED</dt>
+<dd>The volume has no work area.</dd>
+</dl>
+</div>
+
+
+<div class="para">
+<h4>Description</h4>
+<p>The <tt>pf_opendir()</tt> function opens an exsisting directory and creates the directory object for subsequent calls. The directory object structure can be discarded at any time without any procedure.</p>
+</div>
+
+
+<div class="para">
+<h4>QuickInfo</h4>
+<p>Available when <tt>_USE_DIR == 1</tt>.</p>
+</div>
+
+
+<div class="para">
+<h4>References</h4>
+<p><tt><a href="readdir.html">f_readdir</a>, <a href="sdir.html">DIR</a></tt></p>
+</div>
+
+<p class="foot"><a href="../00index_p.html">Return</a></p>
+</body>
+</html>
diff --git a/3rdparty/petitfs-0.03/doc/pf/read.html b/3rdparty/petitfs-0.03/doc/pf/read.html
new file mode 100644
index 00000000..a76c8ed3
--- /dev/null
+++ b/3rdparty/petitfs-0.03/doc/pf/read.html
@@ -0,0 +1,73 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="Petit FatFs" href="../00index_p.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<link rel="stylesheet" href="../css_p.css" type="text/css" media="screen" title="ELM Default">
+<title>Petit FatFs - pf_read</title>
+</head>
+
+<body>
+
+<div class="para">
+<h2>pf_read</h2>
+<p>The pf_read function reads data from the file.</p>
+<pre>
+FRESULT pf_read (
+ void* <span class="arg">buff</span>, <span class="c">/* [OUT] Pointer to the read buffer */</span>
+ UINT <span class="arg">btr</span>, <span class="c">/* [IN] Number of bytes to read */</span>
+ UINT* <span class="arg">br</span> <span class="c">/* [OUT] Number of bytes read */</span>
+);
+</pre>
+</div>
+
+<div class="para">
+<h4>Parameters</h4>
+<dl class="par">
+<dt>buff</dt>
+<dd>Pointer to the buffer to store the read data. A NULL specifies the destination is an outgoing stream.</dd>
+<dt>btr</dt>
+<dd>Number of bytes to read.</dd>
+<dt>br</dt>
+<dd>Pointer to the variable to return number of bytes read.</dd>
+</dl>
+</div>
+
+
+<div class="para">
+<h4>Return Values</h4>
+<dl class="ret">
+<dt>FR_OK (0)</dt>
+<dd>The function succeeded.</dd>
+<dt>FR_DISK_ERR</dt>
+<dd>The function failed due to a hard error in the disk function, a wrong FAT structure or an internal error.</dd>
+<dt>FR_NOT_OPENED</dt>
+<dd>The file has not been opened.</dd>
+<dt>FR_NOT_ENABLED</dt>
+<dd>The volume has not been mounted.</dd>
+</dl>
+</div>
+
+
+<div class="para">
+<h4>Description</h4>
+<p>The file read/write pointer in the file system object advances in number of bytes read. After the function succeeded, <tt>*br</tt> should be checked to detect end of file. In case of <tt>*br &lt; btr</tt>, it means the read pointer reached end of file during read operation.</p>
+<p>If a NULL is given to the <tt class="arg">buff</tt>, the read bytes will be forwarded to the outgoing stream instead of the memory. The streaming function will be typically built-in the <tt>disk_readp()</tt> function.</p>
+</div>
+
+<div class="para">
+<h4>QuickInfo</h4>
+<p>Available when <tt>_USE_READ == 1</tt>.</p>
+</div>
+
+
+<div class="para">
+<h4>References</h4>
+<p><tt><a href="open.html">pf_open</a>, <a href="write.html">pf_write</a>, <a href="sfatfs.html">FATFS</a></tt></p>
+</div>
+
+<p class="foot"><a href="../00index_p.html">Return</a></p>
+</body>
+</html>
diff --git a/3rdparty/petitfs-0.03/doc/pf/readdir.html b/3rdparty/petitfs-0.03/doc/pf/readdir.html
new file mode 100644
index 00000000..7f778e1d
--- /dev/null
+++ b/3rdparty/petitfs-0.03/doc/pf/readdir.html
@@ -0,0 +1,100 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="Petit FatFs" href="../00index_p.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<link rel="stylesheet" href="../css_p.css" type="text/css" media="screen" title="ELM Default">
+<title>Petit FatFs - pf_readdir</title>
+</head>
+
+<body>
+
+<div class="para">
+<h2>pf_readdir</h2>
+<p>The pf_readdir function reads directory entries.</p>
+<pre>
+FRESULT pf_readdir (
+ DIR* <span class="arg">dp</span>, <span class="c">/* [IN] Pointer to the open directory object */</span>
+ FILINFO* <span class="arg">fno</span> <span class="c">/* [OUT] Pointer to the file information structure */</span>
+);
+</pre>
+</div>
+
+<div class="para">
+<h4>Parameters</h4>
+<dl class="par">
+<dt>dp</dt>
+<dd>Pointer to the open directory object.</dd>
+<dt>fno</dt>
+<dd>Pointer to the file information structure to store the read item.</dd>
+</dl>
+</div>
+
+
+<div class="para">
+<h4>Return Values</h4>
+<dl class="ret">
+<dt>FR_OK (0)</dt>
+<dd>The function succeeded.</dd>
+<dt>FR_DISK_ERR</dt>
+<dd>The function failed due to an error in the disk function, a wrong FAT structure or an internal error.</dd>
+<dt>FR_NOT_OPENED</dt>
+<dd>The directory object has not been opened.</dd>
+</dl>
+</div>
+
+
+<div class="para">
+<h4>Description</h4>
+<p>The <tt>pf_readdir()</tt> function reads directory entries in sequence. All items in the directory can be read by calling this function repeatedly. When all directory entries have been read and no item to read, the function returns a null string into member <tt>f_name[]</tt> in the file information structure without error. When a null pointer is given to the <tt class="arg">fno</tt>, the read index of the directory object will be rewinded.</p>
+</div>
+
+
+<div class="para">
+<h4>Sample Code</h4>
+<pre>
+FRESULT scan_files (char* path)
+{
+ FRESULT res;
+ FILINFO fno;
+ DIR dir;
+ int i;
+
+
+ res = pf_opendir(&amp;dir, path);
+ if (res == FR_OK) {
+ i = strlen(path);
+ for (;;) {
+ res = pf_readdir(&amp;dir, &amp;fno);
+ if (res != FR_OK || fno.fname[0] == 0) break;
+ if (fno.fattrib &amp; AM_DIR) {
+ sprintf(&amp;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);
+ }
+ }
+ }
+
+ return res;
+}
+</pre>
+</div>
+
+<div class="para">
+<h4>QuickInfo</h4>
+<p>Available when <tt>_USE_DIR == 1</tt>.</p>
+</div>
+
+<div class="para">
+<h4>References</h4>
+<p><tt><a href="opendir.html">pf_opendir</a>, <a href="sfileinfo.html">FILINFO</a>, <a href="sdir.html">DIR</a></tt></p>
+</div>
+
+<p class="foot"><a href="../00index_p.html">Return</a></p>
+</body>
+</html>
diff --git a/3rdparty/petitfs-0.03/doc/pf/sdir.html b/3rdparty/petitfs-0.03/doc/pf/sdir.html
new file mode 100644
index 00000000..e7e7a235
--- /dev/null
+++ b/3rdparty/petitfs-0.03/doc/pf/sdir.html
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="Petit FatFs" href="../00index_p.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<link rel="stylesheet" href="../css_p.css" type="text/css" media="screen" title="ELM Default">
+<title>Petit FatFs - DIR</title>
+</head>
+
+<body>
+
+<div class="para">
+<h2>DIR</h2>
+<p>The <tt>DIR</tt> structure is used for the work area to read a directory by pf_oepndir, pf_readdir function.</p>
+<pre>
+typedef struct {
+ WORD index; <span class="c">/* Current read/write index number */</span>
+ BYTE* fn; <span class="c">/* Pointer to the SFN (in/out) {file[8],ext[3],status[1]} */</span>
+ CLUST sclust; <span class="c">/* Table start cluster (0:Static table) */</span>
+ CLUST clust; <span class="c">/* Current cluster */</span>
+ DWORD sect; <span class="c">/* Current sector */</span>
+} DIR;
+</pre>
+</div>
+
+<p class="foot"><a href="../00index_p.html">Return</a></p>
+</body>
+</html>
diff --git a/3rdparty/petitfs-0.03/doc/pf/sfatfs.html b/3rdparty/petitfs-0.03/doc/pf/sfatfs.html
new file mode 100644
index 00000000..35d385a3
--- /dev/null
+++ b/3rdparty/petitfs-0.03/doc/pf/sfatfs.html
@@ -0,0 +1,39 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="Petit FatFs" href="../00index_p.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<link rel="stylesheet" href="../css_p.css" type="text/css" media="screen" title="ELM Default">
+<title>Petit FatFs - FATFS</title>
+</head>
+
+<body>
+
+<div class="para">
+<h2>FATFS</h2>
+<p>The <tt>FATFS</tt> structure holds dynamic work area of the logical drive and a file. It is given by application program and registerd/unregisterd to the Petit FatFs module with pf_mount function. There is no member that can be changed by application programs.</p>
+<pre>
+typedef struct {
+ BYTE fs_type; <span class="c">/* FAT sub type */</span>
+ BYTE csize; <span class="c">/* Number of sectors per cluster */</span>
+ BYTE flag; <span class="c">/* File status flags */</span>
+ BYTE pad1;
+ WORD n_rootdir; <span class="c">/* Number of root directory entries (0 on FAT32) */</span>
+ CLUST n_fatent; <span class="c">/* Number of FAT entries (= number of clusters + 2) */</span>
+ DWORD fatbase; <span class="c">/* FAT start sector */</span>
+ DWORD dirbase; <span class="c">/* Root directory start sector (Cluster# on FAT32) */</span>
+ DWORD database; <span class="c">/* Data start sector */</span>
+ DWORD fptr; <span class="c">/* File read/write pointer */</span>
+ DWORD fsize; <span class="c">/* File size */</span>
+ CLUST org_clust; <span class="c">/* File start cluster */</span>
+ CLUST curr_clust; <span class="c">/* File current cluster */</span>
+ DWORD dsect; <span class="c">/* File current data sector */</span>
+} FATFS;
+</pre>
+</div>
+
+<p class="foot"><a href="../00index_p.html">Return</a></p>
+</body>
+</html>
diff --git a/3rdparty/petitfs-0.03/doc/pf/sfileinfo.html b/3rdparty/petitfs-0.03/doc/pf/sfileinfo.html
new file mode 100644
index 00000000..cd0ed7f1
--- /dev/null
+++ b/3rdparty/petitfs-0.03/doc/pf/sfileinfo.html
@@ -0,0 +1,62 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="Petit FatFs" href="../00index_p.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<link rel="stylesheet" href="../css_p.css" type="text/css" media="screen" title="ELM Default">
+<title>Petit FatFs - FILINFO</title>
+</head>
+
+<body>
+
+<div class="para">
+<h2>FILINFO</h2>
+<p>The <tt>FILINFO</tt> structure holds a file information returned by pf_readdir function.</p>
+<pre>
+typedef struct {
+ DWORD fsize; <span class="c">/* File size */</span>
+ WORD fdate; <span class="c">/* Last modified date */</span>
+ WORD ftime; <span class="c">/* Last modified time */</span>
+ BYTE fattrib; <span class="c">/* Attribute */</span>
+ char fname[13]; <span class="c">/* File name */</span>
+} FILINFO;
+</pre>
+</div>
+
+<h4>Members</h4>
+<dl>
+<dt>fsize</dt>
+<dd>Indicates size of the file in unit of byte. This is always zero when it is a directory.</dd>
+<dt>fdate</dt>
+<dd>Indicates the date that the file was modified or the directory was created.<br>
+<dl>
+<dt>bit15:9</dt>
+<dd>Year origin from 1980 (0..127)</dd>
+<dt>bit8:5</dt>
+<dd>Month (1..12)</dd>
+<dt>bit4:0</dt>
+<dd>Day (1..31)</dd>
+</dl>
+</dd>
+<dt>ftime</dt>
+<dd>Indicates the time that the file was modified or the directory was created.<br>
+<dl>
+<dt>bit15:11</dt>
+<dd>Hour (0..23)</dd>
+<dt>bit10:5</dt>
+<dd>Minute (0..59)</dd>
+<dt>bit4:0</dt>
+<dd>Second / 2 (0..29)</dd>
+</dl>
+</dd>
+<dt>fattrib</dt>
+<dd>Indicates the file/directory attribute in combination of <tt>AM_DIR</tt>, <tt>AM_RDO</tt>, <tt>AM_HID</tt>, <tt>AM_SYS</tt> and <tt>AM_ARC</tt>.</dd>
+<dt>fname[]</dt>
+<dd>Indicates the file/directory name in 8.3 format null-terminated string.</dd>
+</dl>
+
+<p class="foot"><a href="../00index_p.html">Return</a></p>
+</body>
+</html>
diff --git a/3rdparty/petitfs-0.03/doc/pf/write.html b/3rdparty/petitfs-0.03/doc/pf/write.html
new file mode 100644
index 00000000..573a298b
--- /dev/null
+++ b/3rdparty/petitfs-0.03/doc/pf/write.html
@@ -0,0 +1,86 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="Petit FatFs" href="../00index_p.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<link rel="stylesheet" href="../css_p.css" type="text/css" media="screen" title="ELM Default">
+<title>Petit FatFs - pf_write</title>
+</head>
+
+<body>
+
+<div class="para">
+<h2>pf_write</h2>
+<p>The pf_write function writes data to the file.</p>
+<pre>
+FRESULT pf_write (
+ const void* <span class="arg">buff</span>, <span class="c">/* [IN] Pointer to the data to be written */</span>
+ UINT <span class="arg">btw</span>, <span class="c">/* [IN] Number of bytes to write */</span>
+ UINT* <span class="arg">bw</span> <span class="c">/* [OUT] Pointer to the variable to return number of bytes written */</span>
+);
+</pre>
+</div>
+
+<div class="para">
+<h4>Parameters</h4>
+<dl class="par">
+<dt>buff</dt>
+<dd>Pointer to the data to be wtitten. A NULL specifies to finalize the current write operation.</dd>
+<dt>btw</dt>
+<dd>Number of bytes to write.</dd>
+<dt>bw</dt>
+<dd>Pointer to the variable to return number of bytes read.</dd>
+</dl>
+</div>
+
+
+<div class="para">
+<h4>Return Values</h4>
+<dl class="ret">
+<dt>FR_OK (0)</dt>
+<dd>The function succeeded.</dd>
+<dt>FR_DISK_ERR</dt>
+<dd>The function failed due to a hard error in the disk function, write protected, a wrong FAT structure or an internal error.</dd>
+<dt>FR_NOT_OPENED</dt>
+<dd>The file has not been opened.</dd>
+<dt>FR_NOT_ENABLED</dt>
+<dd>The volume has not been mounted.</dd>
+</dl>
+</div>
+
+
+<div class="para">
+<h4>Description</h4>
+<p>The write function has some restrictions listed below:</p>
+<ul>
+<li>Cannot create file. Only existing file can be written.</li>
+<li>Cannot expand file size.</li>
+<li>Cannot update time stamp of the file.</li>
+<li>Write operation can start/stop on the sector boundary.</li>
+<li>Read-only attribute of the file cannot block write operation.</li>
+</ul>
+<p>File write operation must be done in following sequence.</p>
+<ol>
+<li><tt>pf_lseek(ofs);</tt> read/write pointer must be moved to sector bundary prior to initiate write operation or it will be rounded-down to the sector boundary.</li>
+<li><tt>pf_write(buff, btw, &amp;bw);</tt> Initiate write operation. Write first data to the file.</li>
+<li><tt>pf_write(buff, btw, &amp;bw);</tt> Write next data. Any other file function cannot be used while a write operation is in progress.</li>
+<li><tt>pf_write(0, 0, &amp;bw);</tt> Finalize the write operation. If read/write pointer is not on the sector boundary, left bytes in the sector will be filled with zero.</li>
+</ol>
+<p>The read/write pointer in the file system object advances in number of bytes written. After the function succeeded, <tt>*bw</tt> should be checked to detect end of file. In case of <tt>*bw &lt; btw</tt>, it means the read/write pointer reached end of file during the write operation. Once a write operation is initiated, it must be finalized or the written data can be lost.</p>
+</div>
+
+<div class="para">
+<h4>QuickInfo</h4>
+<p>Available when <tt>_USE_WRITE == 1</tt>.</p>
+</div>
+
+<div class="para">
+<h4>References</h4>
+<p><tt><a href="open.html">pf_open</a>, <a href="sfatfs.html">FATFS</a></tt></p>
+</div>
+
+<p class="foot"><a href="../00index_p.html">Return</a></p>
+</body>
+</html>
diff --git a/3rdparty/petitfs-0.03/src/00readme.txt b/3rdparty/petitfs-0.03/src/00readme.txt
new file mode 100644
index 00000000..3cdb4b98
--- /dev/null
+++ b/3rdparty/petitfs-0.03/src/00readme.txt
@@ -0,0 +1,46 @@
+Petit FatFs Module Source Files R0.03 (C)ChaN, 2014
+
+
+FILES
+
+ pff.h Common include file for Petit FatFs and application module.
+ pff.c Petit FatFs module.
+ diskio.h Common include file for Petit FatFs and disk I/O module.
+ diskio.c Skeleton of low level disk I/O module.
+ integer.h Alternative type definitions for integer variables.
+
+ Low level disk I/O module is not included in this archive because the Petit
+ FatFs module is only a generic file system layer and not depend on any
+ specific storage device. You have to provide a low level disk I/O module that
+ written to control your storage device.
+
+
+
+AGREEMENTS
+
+ Petit FatFs module is an open source software to implement FAT file system to
+ small embedded systems. This is a free software and is opened for education,
+ research and commercial developments under license policy of following trems.
+
+ Copyright (C) 2014, ChaN, all right reserved.
+
+ * The Petit FatFs module is a free software and there is NO WARRANTY.
+ * No restriction on use. You can use, modify and redistribute it for
+ personal, non-profit or commercial use UNDER YOUR RESPONSIBILITY.
+ * Redistributions of source code must retain the above copyright notice.
+
+
+
+REVISION HISTORY
+
+ Jun 15, 2009 R0.01a First release (Branched from FatFs R0.07b)
+
+ Dec 14, 2009 R0.02 Added multiple code page support.
+ Added write funciton.
+ Changed stream read mode interface.
+ Dec 07,'2010 R0.02a Added some configuration options.
+ Fixed fails to open objects with DBCS character.
+
+ Jun 10, 2014 R0.03 Separated out configuration options to pffconf.h.
+ Added _USE_LCC option.
+ Added _FS_FAT16 option.
diff --git a/3rdparty/petitfs-0.03/src/diskio.c b/3rdparty/petitfs-0.03/src/diskio.c
new file mode 100644
index 00000000..8328b44d
--- /dev/null
+++ b/3rdparty/petitfs-0.03/src/diskio.c
@@ -0,0 +1,73 @@
+/*-----------------------------------------------------------------------*/
+/* Low level disk I/O module skeleton for Petit FatFs (C)ChaN, 2014 */
+/*-----------------------------------------------------------------------*/
+
+#include "diskio.h"
+
+
+/*-----------------------------------------------------------------------*/
+/* Initialize Disk Drive */
+/*-----------------------------------------------------------------------*/
+
+DSTATUS disk_initialize (void)
+{
+ DSTATUS stat;
+
+ // Put your code here
+
+ return stat;
+}
+
+
+
+/*-----------------------------------------------------------------------*/
+/* Read Partial Sector */
+/*-----------------------------------------------------------------------*/
+
+DRESULT disk_readp (
+ BYTE* buff, /* Pointer to the destination object */
+ DWORD sector, /* Sector number (LBA) */
+ UINT offset, /* Offset in the sector */
+ UINT count /* Byte count (bit15:destination) */
+)
+{
+ DRESULT res;
+
+ // Put your code here
+
+ return res;
+}
+
+
+
+/*-----------------------------------------------------------------------*/
+/* Write Partial Sector */
+/*-----------------------------------------------------------------------*/
+
+DRESULT disk_writep (
+ BYTE* buff, /* Pointer to the data to be written, NULL:Initiate/Finalize write operation */
+ DWORD sc /* Sector number (LBA) or Number of bytes to send */
+)
+{
+ DRESULT res;
+
+
+ if (!buff) {
+ if (sc) {
+
+ // Initiate write process
+
+ } else {
+
+ // Finalize write process
+
+ }
+ } else {
+
+ // Send data to the disk
+
+ }
+
+ return res;
+}
+
diff --git a/3rdparty/petitfs-0.03/src/diskio.h b/3rdparty/petitfs-0.03/src/diskio.h
new file mode 100644
index 00000000..2599dee3
--- /dev/null
+++ b/3rdparty/petitfs-0.03/src/diskio.h
@@ -0,0 +1,42 @@
+/*-----------------------------------------------------------------------
+/ PFF - Low level disk interface modlue include file (C)ChaN, 2014
+/-----------------------------------------------------------------------*/
+
+#ifndef _DISKIO_DEFINED
+#define _DISKIO_DEFINED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "integer.h"
+
+
+/* Status of Disk Functions */
+typedef BYTE DSTATUS;
+
+
+/* Results of Disk Functions */
+typedef enum {
+ RES_OK = 0, /* 0: Function succeeded */
+ RES_ERROR, /* 1: Disk error */
+ RES_NOTRDY, /* 2: Not ready */
+ RES_PARERR /* 3: Invalid parameter */
+} DRESULT;
+
+
+/*---------------------------------------*/
+/* Prototypes for disk control functions */
+
+DSTATUS disk_initialize (void);
+DRESULT disk_readp (BYTE* buff, DWORD sector, UINT offser, UINT count);
+DRESULT disk_writep (const BYTE* buff, DWORD sc);
+
+#define STA_NOINIT 0x01 /* Drive not initialized */
+#define STA_NODISK 0x02 /* No medium in the drive */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _DISKIO_DEFINED */
diff --git a/3rdparty/petitfs-0.03/src/integer.h b/3rdparty/petitfs-0.03/src/integer.h
new file mode 100644
index 00000000..f254b2a0
--- /dev/null
+++ b/3rdparty/petitfs-0.03/src/integer.h
@@ -0,0 +1,33 @@
+/*-------------------------------------------*/
+/* Integer type definitions for FatFs module */
+/*-------------------------------------------*/
+
+#ifndef _FF_INTEGER
+#define _FF_INTEGER
+
+#ifdef _WIN32 /* FatFs development platform */
+
+#include <windows.h>
+#include <tchar.h>
+
+#else /* Embedded platform */
+
+/* This type MUST be 8 bit */
+typedef unsigned char BYTE;
+
+/* These types MUST be 16 bit */
+typedef short SHORT;
+typedef unsigned short WORD;
+typedef unsigned short WCHAR;
+
+/* These types MUST be 16 bit or 32 bit */
+typedef int INT;
+typedef unsigned int UINT;
+
+/* These types MUST be 32 bit */
+typedef long LONG;
+typedef unsigned long DWORD;
+
+#endif
+
+#endif
diff --git a/3rdparty/petitfs-0.03/src/pff.c b/3rdparty/petitfs-0.03/src/pff.c
new file mode 100644
index 00000000..674a9175
--- /dev/null
+++ b/3rdparty/petitfs-0.03/src/pff.c
@@ -0,0 +1,1108 @@
+/*----------------------------------------------------------------------------/
+/ Petit FatFs - FAT file system module R0.03 (C)ChaN, 2014
+/-----------------------------------------------------------------------------/
+/ Petit FatFs module is a generic FAT file system module for small embedded
+/ systems. This is a free software that opened for education, research and
+/ commercial developments under license policy of following trems.
+/
+/ Copyright (C) 2014, ChaN, all right reserved.
+/
+/ * The Petit FatFs module is a free software and there is NO WARRANTY.
+/ * No restriction on use. You can use, modify and redistribute it for
+/ personal, non-profit or commercial products UNDER YOUR RESPONSIBILITY.
+/ * Redistributions of source code must retain the above copyright notice.
+/
+/-----------------------------------------------------------------------------/
+/ Jun 15,'09 R0.01a First release.
+/
+/ Dec 14,'09 R0.02 Added multiple code page support.
+/ Added write funciton.
+/ Changed stream read mode interface.
+/ Dec 07,'10 R0.02a Added some configuration options.
+/ Fixed fails to open objects with DBCS character.
+
+/ Jun 10,'14 R0.03 Separated out configuration options to pffconf.h.
+/ Added _USE_LCC option.
+/ Added _FS_FAT16 option.
+/----------------------------------------------------------------------------*/
+
+#include "pff.h" /* Petit FatFs configurations and declarations */
+#include "diskio.h" /* Declarations of low level disk I/O functions */
+
+
+
+/*--------------------------------------------------------------------------
+
+ Module Private Definitions
+
+---------------------------------------------------------------------------*/
+
+
+#if _PFATFS != 4004 /* Revision ID */
+#error Wrong include file (pff.h).
+#endif
+
+#if _FS_FAT32
+#if !_FS_FAT16 && !_FS_FAT12
+#define _FS_32ONLY 1
+#else
+#define _FS_32ONLY 0
+#endif
+#else
+#if !_FS_FAT16 && !_FS_FAT12
+#error Wrong _FS_FATxx setting.
+#endif
+#define _FS_32ONLY 0
+#endif
+
+#define ABORT(err) {fs->flag = 0; return err;}
+
+
+
+/*--------------------------------------------------------*/
+/* DBCS code ranges and SBCS extend char conversion table */
+/*--------------------------------------------------------*/
+
+#if _CODE_PAGE == 932 /* Japanese Shift-JIS */
+#define _DF1S 0x81 /* DBC 1st byte range 1 start */
+#define _DF1E 0x9F /* DBC 1st byte range 1 end */
+#define _DF2S 0xE0 /* DBC 1st byte range 2 start */
+#define _DF2E 0xFC /* DBC 1st byte range 2 end */
+#define _DS1S 0x40 /* DBC 2nd byte range 1 start */
+#define _DS1E 0x7E /* DBC 2nd byte range 1 end */
+#define _DS2S 0x80 /* DBC 2nd byte range 2 start */
+#define _DS2E 0xFC /* DBC 2nd byte range 2 end */
+
+#elif _CODE_PAGE == 936 /* Simplified Chinese GBK */
+#define _DF1S 0x81
+#define _DF1E 0xFE
+#define _DS1S 0x40
+#define _DS1E 0x7E
+#define _DS2S 0x80
+#define _DS2E 0xFE
+
+#elif _CODE_PAGE == 949 /* Korean */
+#define _DF1S 0x81
+#define _DF1E 0xFE
+#define _DS1S 0x41
+#define _DS1E 0x5A
+#define _DS2S 0x61
+#define _DS2E 0x7A
+#define _DS3S 0x81
+#define _DS3E 0xFE
+
+#elif _CODE_PAGE == 950 /* Traditional Chinese Big5 */
+#define _DF1S 0x81
+#define _DF1E 0xFE
+#define _DS1S 0x40
+#define _DS1E 0x7E
+#define _DS2S 0xA1
+#define _DS2E 0xFE
+
+#elif _CODE_PAGE == 437 /* U.S. (OEM) */
+#define _EXCVT {0x80,0x9A,0x90,0x41,0x8E,0x41,0x8F,0x80,0x45,0x45,0x45,0x49,0x49,0x49,0x8E,0x8F,0x90,0x92,0x92,0x4F,0x99,0x4F,0x55,0x55,0x59,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
+ 0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
+ 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
+ 0xE0,0xE1,0xE2,0xE3,0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6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
+
+#elif _CODE_PAGE == 866 /* Russian (OEM) */
+#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
+ 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
+ 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
+ 0x90,0x91,0x92,0x93,0x9d,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
+
+#elif _CODE_PAGE == 874 /* Thai (OEM, Windows) */
+#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
+ 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9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xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
+ 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
+ 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xEC,0xCD,0xCE,0xCF,0xD0,0xD1,0xF2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xFE,0x9F}
+
+#else
+#error Unknown code page.
+
+#endif
+
+
+
+/* Character code support macros */
+
+#define IsUpper(c) (((c)>='A')&&((c)<='Z'))
+#define IsLower(c) (((c)>='a')&&((c)<='z'))
+
+#ifndef _EXCVT /* DBCS configuration */
+
+#ifdef _DF2S /* Two 1st byte areas */
+#define IsDBCS1(c) (((BYTE)(c) >= _DF1S && (BYTE)(c) <= _DF1E) || ((BYTE)(c) >= _DF2S && (BYTE)(c) <= _DF2E))
+#else /* One 1st byte area */
+#define IsDBCS1(c) ((BYTE)(c) >= _DF1S && (BYTE)(c) <= _DF1E)
+#endif
+
+#ifdef _DS3S /* Three 2nd byte areas */
+#define IsDBCS2(c) (((BYTE)(c) >= _DS1S && (BYTE)(c) <= _DS1E) || ((BYTE)(c) >= _DS2S && (BYTE)(c) <= _DS2E) || ((BYTE)(c) >= _DS3S && (BYTE)(c) <= _DS3E))
+#else /* Two 2nd byte areas */
+#define IsDBCS2(c) (((BYTE)(c) >= _DS1S && (BYTE)(c) <= _DS1E) || ((BYTE)(c) >= _DS2S && (BYTE)(c) <= _DS2E))
+#endif
+
+#else /* SBCS configuration */
+
+#define IsDBCS1(c) 0
+#define IsDBCS2(c) 0
+
+#endif /* _EXCVT */
+
+
+/* FatFs refers the members in the FAT structures with byte offset instead
+/ of structure member because there are incompatibility of the packing option
+/ between various compilers. */
+
+#define BS_jmpBoot 0
+#define BS_OEMName 3
+#define BPB_BytsPerSec 11
+#define BPB_SecPerClus 13
+#define BPB_RsvdSecCnt 14
+#define BPB_NumFATs 16
+#define BPB_RootEntCnt 17
+#define BPB_TotSec16 19
+#define BPB_Media 21
+#define BPB_FATSz16 22
+#define BPB_SecPerTrk 24
+#define BPB_NumHeads 26
+#define BPB_HiddSec 28
+#define BPB_TotSec32 32
+#define BS_55AA 510
+
+#define BS_DrvNum 36
+#define BS_BootSig 38
+#define BS_VolID 39
+#define BS_VolLab 43
+#define BS_FilSysType 54
+
+#define BPB_FATSz32 36
+#define BPB_ExtFlags 40
+#define BPB_FSVer 42
+#define BPB_RootClus 44
+#define BPB_FSInfo 48
+#define BPB_BkBootSec 50
+#define BS_DrvNum32 64
+#define BS_BootSig32 66
+#define BS_VolID32 67
+#define BS_VolLab32 71
+#define BS_FilSysType32 82
+
+#define MBR_Table 446
+
+#define DIR_Name 0
+#define DIR_Attr 11
+#define DIR_NTres 12
+#define DIR_CrtTime 14
+#define DIR_CrtDate 16
+#define DIR_FstClusHI 20
+#define DIR_WrtTime 22
+#define DIR_WrtDate 24
+#define DIR_FstClusLO 26
+#define DIR_FileSize 28
+
+
+
+/*--------------------------------------------------------------------------
+
+ Private Functions
+
+---------------------------------------------------------------------------*/
+
+
+static
+FATFS *FatFs; /* Pointer to the file system object (logical drive) */
+
+
+/* Fill memory */
+static
+void mem_set (void* dst, int val, int cnt) {
+ char *d = (char*)dst;
+ while (cnt--) *d++ = (char)val;
+}
+
+/* Compare memory to memory */
+static
+int mem_cmp (const void* dst, const void* src, int cnt) {
+ const char *d = (const char *)dst, *s = (const char *)src;
+ int r = 0;
+ while (cnt-- && (r = *d++ - *s++) == 0) ;
+ return r;
+}
+
+
+
+/*-----------------------------------------------------------------------*/
+/* FAT access - Read value of a FAT entry */
+/*-----------------------------------------------------------------------*/
+
+static
+CLUST get_fat ( /* 1:IO error, Else:Cluster status */
+ CLUST clst /* Cluster# to get the link information */
+)
+{
+ BYTE buf[4];
+ FATFS *fs = FatFs;
+
+ if (clst < 2 || clst >= fs->n_fatent) /* Range check */
+ return 1;
+
+ switch (fs->fs_type) {
+#if _FS_FAT12
+ case FS_FAT12 : {
+ UINT wc, bc, ofs;
+
+ bc = (UINT)clst; bc += bc / 2;
+ ofs = bc % 512; bc /= 512;
+ if (ofs != 511) {
+ if (disk_readp(buf, fs->fatbase + bc, ofs, 2)) break;
+ } else {
+ if (disk_readp(buf, fs->fatbase + bc, 511, 1)) break;
+ if (disk_readp(buf+1, fs->fatbase + bc + 1, 0, 1)) break;
+ }
+ wc = LD_WORD(buf);
+ return (clst & 1) ? (wc >> 4) : (wc & 0xFFF);
+ }
+#endif
+#if _FS_FAT16
+ case FS_FAT16 :
+ if (disk_readp(buf, fs->fatbase + clst / 256, ((UINT)clst % 256) * 2, 2)) break;
+ return LD_WORD(buf);
+#endif
+#if _FS_FAT32
+ case FS_FAT32 :
+ if (disk_readp(buf, fs->fatbase + clst / 128, ((UINT)clst % 128) * 4, 4)) break;
+ return LD_DWORD(buf) & 0x0FFFFFFF;
+#endif
+ }
+
+ return 1; /* An error occured at the disk I/O layer */
+}
+
+
+
+
+/*-----------------------------------------------------------------------*/
+/* Get sector# from cluster# / Get cluster field from directory entry */
+/*-----------------------------------------------------------------------*/
+
+static
+DWORD clust2sect ( /* !=0: Sector number, 0: Failed - invalid cluster# */
+ CLUST clst /* Cluster# to be converted */
+)
+{
+ FATFS *fs = FatFs;
+
+
+ clst -= 2;
+ if (clst >= (fs->n_fatent - 2)) return 0; /* Invalid cluster# */
+ return (DWORD)clst * fs->csize + fs->database;
+}
+
+
+static
+CLUST get_clust (
+ BYTE* dir /* Pointer to directory entry */
+)
+{
+ FATFS *fs = FatFs;
+ CLUST clst = 0;
+
+
+ if (_FS_32ONLY || (_FS_FAT32 && fs->fs_type == FS_FAT32)) {
+ clst = LD_WORD(dir+DIR_FstClusHI);
+ clst <<= 16;
+ }
+ clst |= LD_WORD(dir+DIR_FstClusLO);
+
+ return clst;
+}
+
+
+/*-----------------------------------------------------------------------*/
+/* Directory handling - Rewind directory index */
+/*-----------------------------------------------------------------------*/
+
+static
+FRESULT dir_rewind (
+ DIR *dj /* Pointer to directory object */
+)
+{
+ CLUST clst;
+ FATFS *fs = FatFs;
+
+
+ dj->index = 0;
+ clst = dj->sclust;
+ if (clst == 1 || clst >= fs->n_fatent) /* Check start cluster range */
+ return FR_DISK_ERR;
+ if (_FS_FAT32 && !clst && (_FS_32ONLY || fs->fs_type == FS_FAT32)) /* Replace cluster# 0 with root cluster# if in FAT32 */
+ clst = (CLUST)fs->dirbase;
+ dj->clust = clst; /* Current cluster */
+ dj->sect = (_FS_32ONLY || clst) ? clust2sect(clst) : fs->dirbase; /* Current sector */
+
+ return FR_OK; /* Seek succeeded */
+}
+
+
+
+
+/*-----------------------------------------------------------------------*/
+/* Directory handling - Move directory index next */
+/*-----------------------------------------------------------------------*/
+
+static
+FRESULT dir_next ( /* FR_OK:Succeeded, FR_NO_FILE:End of table */
+ DIR *dj /* Pointer to directory object */
+)
+{
+ CLUST clst;
+ WORD i;
+ FATFS *fs = FatFs;
+
+
+ i = dj->index + 1;
+ if (!i || !dj->sect) /* Report EOT when index has reached 65535 */
+ return FR_NO_FILE;
+
+ if (!(i % 16)) { /* Sector changed? */
+ dj->sect++; /* Next sector */
+
+ if (dj->clust == 0) { /* Static table */
+ if (i >= fs->n_rootdir) /* Report EOT when end of table */
+ return FR_NO_FILE;
+ }
+ else { /* Dynamic table */
+ if (((i / 16) & (fs->csize - 1)) == 0) { /* Cluster changed? */
+ clst = get_fat(dj->clust); /* Get next cluster */
+ if (clst <= 1) return FR_DISK_ERR;
+ if (clst >= fs->n_fatent) /* When it reached end of dynamic table */
+ return FR_NO_FILE; /* Report EOT */
+ dj->clust = clst; /* Initialize data for new cluster */
+ dj->sect = clust2sect(clst);
+ }
+ }
+ }
+
+ dj->index = i;
+
+ return FR_OK;
+}
+
+
+
+
+/*-----------------------------------------------------------------------*/
+/* Directory handling - Find an object in the directory */
+/*-----------------------------------------------------------------------*/
+
+static
+FRESULT dir_find (
+ DIR *dj, /* Pointer to the directory object linked to the file name */
+ BYTE *dir /* 32-byte working buffer */
+)
+{
+ FRESULT res;
+ BYTE c;
+
+
+ res = dir_rewind(dj); /* Rewind directory object */
+ if (res != FR_OK) return res;
+
+ do {
+ res = disk_readp(dir, dj->sect, (dj->index % 16) * 32, 32) /* Read an entry */
+ ? FR_DISK_ERR : FR_OK;
+ if (res != FR_OK) break;
+ c = dir[DIR_Name]; /* First character */
+ if (c == 0) { res = FR_NO_FILE; break; } /* Reached to end of table */
+ if (!(dir[DIR_Attr] & AM_VOL) && !mem_cmp(dir, dj->fn, 11)) /* Is it a valid entry? */
+ break;
+ res = dir_next(dj); /* Next entry */
+ } while (res == FR_OK);
+
+ return res;
+}
+
+
+
+
+/*-----------------------------------------------------------------------*/
+/* Read an object from the directory */
+/*-----------------------------------------------------------------------*/
+#if _USE_DIR
+static
+FRESULT dir_read (
+ DIR *dj, /* Pointer to the directory object to store read object name */
+ BYTE *dir /* 32-byte working buffer */
+)
+{
+ FRESULT res;
+ BYTE a, c;
+
+
+ res = FR_NO_FILE;
+ while (dj->sect) {
+ res = disk_readp(dir, dj->sect, (dj->index % 16) * 32, 32) /* Read an entry */
+ ? FR_DISK_ERR : FR_OK;
+ if (res != FR_OK) break;
+ c = dir[DIR_Name];
+ if (c == 0) { res = FR_NO_FILE; break; } /* Reached to end of table */
+ a = dir[DIR_Attr] & AM_MASK;
+ if (c != 0xE5 && c != '.' && !(a & AM_VOL)) /* Is it a valid entry? */
+ break;
+ res = dir_next(dj); /* Next entry */
+ if (res != FR_OK) break;
+ }
+
+ if (res != FR_OK) dj->sect = 0;
+
+ return res;
+}
+#endif
+
+
+
+/*-----------------------------------------------------------------------*/
+/* Pick a segment and create the object name in directory form */
+/*-----------------------------------------------------------------------*/
+
+
+static
+FRESULT create_name (
+ DIR *dj, /* Pointer to the directory object */
+ const char **path /* Pointer to pointer to the segment in the path string */
+)
+{
+ BYTE c, ni, si, i, *sfn;
+ const char *p;
+#if _USE_LCC
+#ifdef _EXCVT
+ static const BYTE cvt[] = _EXCVT;
+#endif
+#endif
+
+ /* Create file name in directory form */
+ sfn = dj->fn;
+ mem_set(sfn, ' ', 11);
+ si = i = 0; ni = 8;
+ p = *path;
+ for (;;) {
+ c = p[si++];
+ if (c <= ' ' || c == '/') break; /* Break on end of segment */
+ if (c == '.' || i >= ni) {
+ if (ni != 8 || c != '.') break;
+ i = 8; ni = 11;
+ continue;
+ }
+#if _USE_LCC
+#ifdef _EXCVT
+ if (c >= 0x80) /* To upper extended char (SBCS) */
+ c = cvt[c - 0x80];
+#endif
+ if (IsDBCS1(c) && i < ni - 1) { /* DBC 1st byte? */
+ BYTE d = p[si++]; /* Get 2nd byte */
+ sfn[i++] = c;
+ sfn[i++] = d;
+ } else
+#endif
+ { /* Single byte code */
+ if (_USE_LCC && IsLower(c)) c -= 0x20; /* toupper */
+ sfn[i++] = c;
+ }
+ }
+ *path = &p[si]; /* Rerurn pointer to the next segment */
+
+ sfn[11] = (c <= ' ') ? 1 : 0; /* Set last segment flag if end of path */
+
+ return FR_OK;
+}
+
+
+
+
+/*-----------------------------------------------------------------------*/
+/* Get file information from directory entry */
+/*-----------------------------------------------------------------------*/
+#if _USE_DIR
+static
+void get_fileinfo ( /* No return code */
+ DIR *dj, /* Pointer to the directory object */
+ BYTE *dir, /* 32-byte working buffer */
+ FILINFO *fno /* Pointer to store the file information */
+)
+{
+ BYTE i, c;
+ char *p;
+
+
+ p = fno->fname;
+ if (dj->sect) {
+ for (i = 0; i < 8; i++) { /* Copy file name body */
+ c = dir[i];
+ if (c == ' ') break;
+ if (c == 0x05) c = 0xE5;
+ *p++ = c;
+ }
+ if (dir[8] != ' ') { /* Copy file name extension */
+ *p++ = '.';
+ for (i = 8; i < 11; i++) {
+ c = dir[i];
+ if (c == ' ') break;
+ *p++ = c;
+ }
+ }
+ fno->fattrib = dir[DIR_Attr]; /* Attribute */
+ fno->fsize = LD_DWORD(dir+DIR_FileSize); /* Size */
+ fno->fdate = LD_WORD(dir+DIR_WrtDate); /* Date */
+ fno->ftime = LD_WORD(dir+DIR_WrtTime); /* Time */
+ }
+ *p = 0;
+}
+#endif /* _USE_DIR */
+
+
+
+/*-----------------------------------------------------------------------*/
+/* Follow a file path */
+/*-----------------------------------------------------------------------*/
+
+static
+FRESULT follow_path ( /* FR_OK(0): successful, !=0: error code */
+ DIR *dj, /* Directory object to return last directory and found object */
+ BYTE *dir, /* 32-byte working buffer */
+ const char *path /* Full-path string to find a file or directory */
+)
+{
+ FRESULT res;
+
+
+ while (*path == ' ') path++; /* Strip leading spaces */
+ if (*path == '/') path++; /* Strip heading separator if exist */
+ dj->sclust = 0; /* Set start directory (always root dir) */
+
+ if ((BYTE)*path < ' ') { /* Null path means the root directory */
+ res = dir_rewind(dj);
+ dir[0] = 0;
+
+ } else { /* Follow path */
+ for (;;) {
+ res = create_name(dj, &path); /* Get a segment */
+ if (res != FR_OK) break;
+ res = dir_find(dj, dir); /* Find it */
+ if (res != FR_OK) break; /* Could not find the object */
+ if (dj->fn[11]) break; /* Last segment match. Function completed. */
+ if (!(dir[DIR_Attr] & AM_DIR)) { /* Cannot follow path because it is a file */
+ res = FR_NO_FILE; break;
+ }
+ dj->sclust = get_clust(dir); /* Follow next */
+ }
+ }
+
+ return res;
+}
+
+
+
+
+/*-----------------------------------------------------------------------*/
+/* Check a sector if it is an FAT boot record */
+/*-----------------------------------------------------------------------*/
+
+static
+BYTE check_fs ( /* 0:The FAT boot record, 1:Valid boot record but not an FAT, 2:Not a boot record, 3:Error */
+ BYTE *buf, /* Working buffer */
+ DWORD sect /* Sector# (lba) to check if it is an FAT boot record or not */
+)
+{
+ if (disk_readp(buf, sect, 510, 2)) /* Read the boot record */
+ return 3;
+ if (LD_WORD(buf) != 0xAA55) /* Check record signature */
+ return 2;
+
+ if (!_FS_32ONLY && !disk_readp(buf, sect, BS_FilSysType, 2) && LD_WORD(buf) == 0x4146) /* Check FAT12/16 */
+ return 0;
+ if (_FS_FAT32 && !disk_readp(buf, sect, BS_FilSysType32, 2) && LD_WORD(buf) == 0x4146) /* Check FAT32 */
+ return 0;
+ return 1;
+}
+
+
+
+
+/*--------------------------------------------------------------------------
+
+ Public Functions
+
+--------------------------------------------------------------------------*/
+
+
+
+/*-----------------------------------------------------------------------*/
+/* Mount/Unmount a Locical Drive */
+/*-----------------------------------------------------------------------*/
+
+FRESULT pf_mount (
+ FATFS *fs /* Pointer to new file system object */
+)
+{
+ BYTE fmt, buf[36];
+ DWORD bsect, fsize, tsect, mclst;
+
+
+ FatFs = 0;
+
+ if (disk_initialize() & STA_NOINIT) /* Check if the drive is ready or not */
+ return FR_NOT_READY;
+
+ /* Search FAT partition on the drive */
+ bsect = 0;
+ fmt = check_fs(buf, bsect); /* Check sector 0 as an SFD format */
+ if (fmt == 1) { /* Not an FAT boot record, it may be FDISK format */
+ /* Check a partition listed in top of the partition table */
+ if (disk_readp(buf, bsect, MBR_Table, 16)) { /* 1st partition entry */
+ fmt = 3;
+ } else {
+ if (buf[4]) { /* Is the partition existing? */
+ bsect = LD_DWORD(&buf[8]); /* Partition offset in LBA */
+ fmt = check_fs(buf, bsect); /* Check the partition */
+ }
+ }
+ }
+ if (fmt == 3) return FR_DISK_ERR;
+ if (fmt) return FR_NO_FILESYSTEM; /* No valid FAT patition is found */
+
+ /* Initialize the file system object */
+ if (disk_readp(buf, bsect, 13, sizeof (buf))) return FR_DISK_ERR;
+
+ fsize = LD_WORD(buf+BPB_FATSz16-13); /* Number of sectors per FAT */
+ if (!fsize) fsize = LD_DWORD(buf+BPB_FATSz32-13);
+
+ fsize *= buf[BPB_NumFATs-13]; /* Number of sectors in FAT area */
+ fs->fatbase = bsect + LD_WORD(buf+BPB_RsvdSecCnt-13); /* FAT start sector (lba) */
+ fs->csize = buf[BPB_SecPerClus-13]; /* Number of sectors per cluster */
+ fs->n_rootdir = LD_WORD(buf+BPB_RootEntCnt-13); /* Nmuber of root directory entries */
+ tsect = LD_WORD(buf+BPB_TotSec16-13); /* Number of sectors on the file system */
+ if (!tsect) tsect = LD_DWORD(buf+BPB_TotSec32-13);
+ mclst = (tsect /* Last cluster# + 1 */
+ - LD_WORD(buf+BPB_RsvdSecCnt-13) - fsize - fs->n_rootdir / 16
+ ) / fs->csize + 2;
+ fs->n_fatent = (CLUST)mclst;
+
+ fmt = 0; /* Determine the FAT sub type */
+ if (_FS_FAT12 && mclst < 0xFF7)
+ fmt = FS_FAT12;
+ if (_FS_FAT16 && mclst >= 0xFF8 && mclst < 0xFFF7)
+ fmt = FS_FAT16;
+ if (_FS_FAT32 && mclst >= 0xFFF7)
+ fmt = FS_FAT32;
+ if (!fmt) return FR_NO_FILESYSTEM;
+ fs->fs_type = fmt;
+
+ if (_FS_32ONLY || (_FS_FAT32 && fmt == FS_FAT32))
+ fs->dirbase = LD_DWORD(buf+(BPB_RootClus-13)); /* Root directory start cluster */
+ else
+ fs->dirbase = fs->fatbase + fsize; /* Root directory start sector (lba) */
+ fs->database = fs->fatbase + fsize + fs->n_rootdir / 16; /* Data start sector (lba) */
+
+ fs->flag = 0;
+ FatFs = fs;
+
+ return FR_OK;
+}
+
+
+
+
+/*-----------------------------------------------------------------------*/
+/* Open or Create a File */
+/*-----------------------------------------------------------------------*/
+
+FRESULT pf_open (
+ const char *path /* Pointer to the file name */
+)
+{
+ FRESULT res;
+ DIR dj;
+ BYTE sp[12], dir[32];
+ FATFS *fs = FatFs;
+
+
+ if (!fs) return FR_NOT_ENABLED; /* Check file system */
+
+ fs->flag = 0;
+ dj.fn = sp;
+ res = follow_path(&dj, dir, path); /* Follow the file path */
+ if (res != FR_OK) return res; /* Follow failed */
+ if (!dir[0] || (dir[DIR_Attr] & AM_DIR)) /* It is a directory */
+ return FR_NO_FILE;
+
+ fs->org_clust = get_clust(dir); /* File start cluster */
+ fs->fsize = LD_DWORD(dir+DIR_FileSize); /* File size */
+ fs->fptr = 0; /* File pointer */
+ fs->flag = FA_OPENED;
+
+ return FR_OK;
+}
+
+
+
+
+/*-----------------------------------------------------------------------*/
+/* Read File */
+/*-----------------------------------------------------------------------*/
+#if _USE_READ
+
+FRESULT pf_read (
+ void* buff, /* Pointer to the read buffer (NULL:Forward data to the stream)*/
+ UINT btr, /* Number of bytes to read */
+ UINT* br /* Pointer to number of bytes read */
+)
+{
+ DRESULT dr;
+ CLUST clst;
+ DWORD sect, remain;
+ UINT rcnt;
+ BYTE cs, *rbuff = buff;
+ FATFS *fs = FatFs;
+
+
+ *br = 0;
+ if (!fs) return FR_NOT_ENABLED; /* Check file system */
+ if (!(fs->flag & FA_OPENED)) /* Check if opened */
+ return FR_NOT_OPENED;
+
+ remain = fs->fsize - fs->fptr;
+ if (btr > remain) btr = (UINT)remain; /* Truncate btr by remaining bytes */
+
+ while (btr) { /* Repeat until all data transferred */
+ if ((fs->fptr % 512) == 0) { /* On the sector boundary? */
+ cs = (BYTE)(fs->fptr / 512 & (fs->csize - 1)); /* Sector offset in the cluster */
+ if (!cs) { /* On the cluster boundary? */
+ if (fs->fptr == 0) /* On the top of the file? */
+ clst = fs->org_clust;
+ else
+ clst = get_fat(fs->curr_clust);
+ if (clst <= 1) ABORT(FR_DISK_ERR);
+ fs->curr_clust = clst; /* Update current cluster */
+ }
+ sect = clust2sect(fs->curr_clust); /* Get current sector */
+ if (!sect) ABORT(FR_DISK_ERR);
+ fs->dsect = sect + cs;
+ }
+ rcnt = 512 - (UINT)fs->fptr % 512; /* Get partial sector data from sector buffer */
+ if (rcnt > btr) rcnt = btr;
+ dr = disk_readp(!buff ? 0 : rbuff, fs->dsect, (UINT)fs->fptr % 512, rcnt);
+ if (dr) ABORT(FR_DISK_ERR);
+ fs->fptr += rcnt; rbuff += rcnt; /* Update pointers and counters */
+ btr -= rcnt; *br += rcnt;
+ }
+
+ return FR_OK;
+}
+#endif
+
+
+
+/*-----------------------------------------------------------------------*/
+/* Write File */
+/*-----------------------------------------------------------------------*/
+#if _USE_WRITE
+
+FRESULT pf_write (
+ const void* buff, /* Pointer to the data to be written */
+ UINT btw, /* Number of bytes to write (0:Finalize the current write operation) */
+ UINT* bw /* Pointer to number of bytes written */
+)
+{
+ CLUST clst;
+ DWORD sect, remain;
+ const BYTE *p = buff;
+ BYTE cs;
+ UINT wcnt;
+ FATFS *fs = FatFs;
+
+
+ *bw = 0;
+ if (!fs) return FR_NOT_ENABLED; /* Check file system */
+ if (!(fs->flag & FA_OPENED)) /* Check if opened */
+ return FR_NOT_OPENED;
+
+ if (!btw) { /* Finalize request */
+ if ((fs->flag & FA__WIP) && disk_writep(0, 0)) ABORT(FR_DISK_ERR);
+ fs->flag &= ~FA__WIP;
+ return FR_OK;
+ } else { /* Write data request */
+ if (!(fs->flag & FA__WIP)) /* Round-down fptr to the sector boundary */
+ fs->fptr &= 0xFFFFFE00;
+ }
+ remain = fs->fsize - fs->fptr;
+ if (btw > remain) btw = (UINT)remain; /* Truncate btw by remaining bytes */
+
+ while (btw) { /* Repeat until all data transferred */
+ if ((UINT)fs->fptr % 512 == 0) { /* On the sector boundary? */
+ cs = (BYTE)(fs->fptr / 512 & (fs->csize - 1)); /* Sector offset in the cluster */
+ if (!cs) { /* On the cluster boundary? */
+ if (fs->fptr == 0) /* On the top of the file? */
+ clst = fs->org_clust;
+ else
+ clst = get_fat(fs->curr_clust);
+ if (clst <= 1) ABORT(FR_DISK_ERR);
+ fs->curr_clust = clst; /* Update current cluster */
+ }
+ sect = clust2sect(fs->curr_clust); /* Get current sector */
+ if (!sect) ABORT(FR_DISK_ERR);
+ fs->dsect = sect + cs;
+ if (disk_writep(0, fs->dsect)) ABORT(FR_DISK_ERR); /* Initiate a sector write operation */
+ fs->flag |= FA__WIP;
+ }
+ wcnt = 512 - (UINT)fs->fptr % 512; /* Number of bytes to write to the sector */
+ if (wcnt > btw) wcnt = btw;
+ if (disk_writep(p, wcnt)) ABORT(FR_DISK_ERR); /* Send data to the sector */
+ fs->fptr += wcnt; p += wcnt; /* Update pointers and counters */
+ btw -= wcnt; *bw += wcnt;
+ if ((UINT)fs->fptr % 512 == 0) {
+ if (disk_writep(0, 0)) ABORT(FR_DISK_ERR); /* Finalize the currtent secter write operation */
+ fs->flag &= ~FA__WIP;
+ }
+ }
+
+ return FR_OK;
+}
+#endif
+
+
+
+/*-----------------------------------------------------------------------*/
+/* Seek File R/W Pointer */
+/*-----------------------------------------------------------------------*/
+#if _USE_LSEEK
+
+FRESULT pf_lseek (
+ DWORD ofs /* File pointer from top of file */
+)
+{
+ CLUST clst;
+ DWORD bcs, sect, ifptr;
+ FATFS *fs = FatFs;
+
+
+ if (!fs) return FR_NOT_ENABLED; /* Check file system */
+ if (!(fs->flag & FA_OPENED)) /* Check if opened */
+ return FR_NOT_OPENED;
+
+ if (ofs > fs->fsize) ofs = fs->fsize; /* Clip offset with the file size */
+ ifptr = fs->fptr;
+ fs->fptr = 0;
+ if (ofs > 0) {
+ bcs = (DWORD)fs->csize * 512; /* Cluster size (byte) */
+ if (ifptr > 0 &&
+ (ofs - 1) / bcs >= (ifptr - 1) / bcs) { /* When seek to same or following cluster, */
+ fs->fptr = (ifptr - 1) & ~(bcs - 1); /* start from the current cluster */
+ ofs -= fs->fptr;
+ clst = fs->curr_clust;
+ } else { /* When seek to back cluster, */
+ clst = fs->org_clust; /* start from the first cluster */
+ fs->curr_clust = clst;
+ }
+ while (ofs > bcs) { /* Cluster following loop */
+ clst = get_fat(clst); /* Follow cluster chain */
+ if (clst <= 1 || clst >= fs->n_fatent) ABORT(FR_DISK_ERR);
+ fs->curr_clust = clst;
+ fs->fptr += bcs;
+ ofs -= bcs;
+ }
+ fs->fptr += ofs;
+ sect = clust2sect(clst); /* Current sector */
+ if (!sect) ABORT(FR_DISK_ERR);
+ fs->dsect = sect + (fs->fptr / 512 & (fs->csize - 1));
+ }
+
+ return FR_OK;
+}
+#endif
+
+
+
+/*-----------------------------------------------------------------------*/
+/* Create a Directroy Object */
+/*-----------------------------------------------------------------------*/
+#if _USE_DIR
+
+FRESULT pf_opendir (
+ DIR *dj, /* Pointer to directory object to create */
+ const char *path /* Pointer to the directory path */
+)
+{
+ FRESULT res;
+ BYTE sp[12], dir[32];
+ FATFS *fs = FatFs;
+
+
+ if (!fs) { /* Check file system */
+ res = FR_NOT_ENABLED;
+ } else {
+ dj->fn = sp;
+ res = follow_path(dj, dir, path); /* Follow the path to the directory */
+ if (res == FR_OK) { /* Follow completed */
+ if (dir[0]) { /* It is not the root dir */
+ if (dir[DIR_Attr] & AM_DIR) /* The object is a directory */
+ dj->sclust = get_clust(dir);
+ else /* The object is not a directory */
+ res = FR_NO_FILE;
+ }
+ if (res == FR_OK)
+ res = dir_rewind(dj); /* Rewind dir */
+ }
+ }
+
+ return res;
+}
+
+
+
+
+/*-----------------------------------------------------------------------*/
+/* Read Directory Entry in Sequense */
+/*-----------------------------------------------------------------------*/
+
+FRESULT pf_readdir (
+ DIR *dj, /* Pointer to the open directory object */
+ FILINFO *fno /* Pointer to file information to return */
+)
+{
+ FRESULT res;
+ BYTE sp[12], dir[32];
+ FATFS *fs = FatFs;
+
+
+ if (!fs) { /* Check file system */
+ res = FR_NOT_ENABLED;
+ } else {
+ dj->fn = sp;
+ if (!fno) {
+ res = dir_rewind(dj);
+ } else {
+ res = dir_read(dj, dir); /* Get current directory item */
+ if (res == FR_NO_FILE) res = FR_OK;
+ if (res == FR_OK) { /* A valid entry is found */
+ get_fileinfo(dj, dir, fno); /* Get the object information */
+ res = dir_next(dj); /* Increment read index for next */
+ if (res == FR_NO_FILE) res = FR_OK;
+ }
+ }
+ }
+
+ return res;
+}
+
+#endif /* _USE_DIR */
+
diff --git a/3rdparty/petitfs-0.03/src/pff.h b/3rdparty/petitfs-0.03/src/pff.h
new file mode 100644
index 00000000..4b55be40
--- /dev/null
+++ b/3rdparty/petitfs-0.03/src/pff.h
@@ -0,0 +1,159 @@
+/*---------------------------------------------------------------------------/
+/ Petit FatFs - FAT file system module include file R0.03 (C)ChaN, 2014
+/----------------------------------------------------------------------------/
+/ Petit FatFs module is an open source software to implement FAT file system to
+/ small embedded systems. This is a free software and is opened for education,
+/ research and commercial developments under license policy of following trems.
+/
+/ Copyright (C) 2014, ChaN, all right reserved.
+/
+/ * The Petit FatFs module is a free software and there is NO WARRANTY.
+/ * No restriction on use. You can use, modify and redistribute it for
+/ personal, non-profit or commercial use UNDER YOUR RESPONSIBILITY.
+/ * Redistributions of source code must retain the above copyright notice.
+/
+/----------------------------------------------------------------------------*/
+
+#ifndef _PFATFS
+#define _PFATFS 4004 /* Revision ID */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "integer.h"
+#include "pffconf.h"
+
+#if _PFATFS != _PFFCONF
+#error Wrong configuration file (pffconf.h).
+#endif
+
+#if _FS_FAT32
+#define CLUST DWORD
+#else
+#define CLUST WORD
+#endif
+
+
+/* File system object structure */
+
+typedef struct {
+ BYTE fs_type; /* FAT sub type */
+ BYTE flag; /* File status flags */
+ BYTE csize; /* Number of sectors per cluster */
+ BYTE pad1;
+ WORD n_rootdir; /* Number of root directory entries (0 on FAT32) */
+ CLUST n_fatent; /* Number of FAT entries (= number of clusters + 2) */
+ DWORD fatbase; /* FAT start sector */
+ DWORD dirbase; /* Root directory start sector (Cluster# on FAT32) */
+ DWORD database; /* Data start sector */
+ DWORD fptr; /* File R/W pointer */
+ DWORD fsize; /* File size */
+ CLUST org_clust; /* File start cluster */
+ CLUST curr_clust; /* File current cluster */
+ DWORD dsect; /* File current data sector */
+} FATFS;
+
+
+
+/* Directory object structure */
+
+typedef struct {
+ WORD index; /* Current read/write index number */
+ BYTE* fn; /* Pointer to the SFN (in/out) {file[8],ext[3],status[1]} */
+ CLUST sclust; /* Table start cluster (0:Static table) */
+ CLUST clust; /* Current cluster */
+ DWORD sect; /* Current sector */
+} DIR;
+
+
+
+/* File status structure */
+
+typedef struct {
+ DWORD fsize; /* File size */
+ WORD fdate; /* Last modified date */
+ WORD ftime; /* Last modified time */
+ BYTE fattrib; /* Attribute */
+ char fname[13]; /* File name */
+} FILINFO;
+
+
+
+/* File function return code (FRESULT) */
+
+typedef enum {
+ FR_OK = 0, /* 0 */
+ FR_DISK_ERR, /* 1 */
+ FR_NOT_READY, /* 2 */
+ FR_NO_FILE, /* 3 */
+ FR_NOT_OPENED, /* 4 */
+ FR_NOT_ENABLED, /* 5 */
+ FR_NO_FILESYSTEM /* 6 */
+} FRESULT;
+
+
+
+/*--------------------------------------------------------------*/
+/* Petit FatFs module application interface */
+
+FRESULT pf_mount (FATFS* fs); /* Mount/Unmount a logical drive */
+FRESULT pf_open (const char* path); /* Open a file */
+FRESULT pf_read (void* buff, UINT btr, UINT* br); /* Read data from the open file */
+FRESULT pf_write (const void* buff, UINT btw, UINT* bw); /* Write data to the open file */
+FRESULT pf_lseek (DWORD ofs); /* Move file pointer of the open file */
+FRESULT pf_opendir (DIR* dj, const char* path); /* Open a directory */
+FRESULT pf_readdir (DIR* dj, FILINFO* fno); /* Read a directory item from the open directory */
+
+
+
+/*--------------------------------------------------------------*/
+/* Flags and offset address */
+
+/* File status flag (FATFS.flag) */
+
+#define FA_OPENED 0x01
+#define FA_WPRT 0x02
+#define FA__WIP 0x40
+
+
+/* FAT sub type (FATFS.fs_type) */
+
+#define FS_FAT12 1
+#define FS_FAT16 2
+#define FS_FAT32 3
+
+
+/* File attribute bits for directory entry */
+
+#define AM_RDO 0x01 /* Read only */
+#define AM_HID 0x02 /* Hidden */
+#define AM_SYS 0x04 /* System */
+#define AM_VOL 0x08 /* Volume label */
+#define AM_LFN 0x0F /* LFN entry */
+#define AM_DIR 0x10 /* Directory */
+#define AM_ARC 0x20 /* Archive */
+#define AM_MASK 0x3F /* Mask of defined bits */
+
+
+/*--------------------------------*/
+/* Multi-byte word access macros */
+
+#if _WORD_ACCESS == 1 /* Enable word access to the FAT structure */
+#define LD_WORD(ptr) (WORD)(*(WORD*)(BYTE*)(ptr))
+#define LD_DWORD(ptr) (DWORD)(*(DWORD*)(BYTE*)(ptr))
+#define ST_WORD(ptr,val) *(WORD*)(BYTE*)(ptr)=(WORD)(val)
+#define ST_DWORD(ptr,val) *(DWORD*)(BYTE*)(ptr)=(DWORD)(val)
+#else /* Use byte-by-byte access to the FAT structure */
+#define LD_WORD(ptr) (WORD)(((WORD)*((BYTE*)(ptr)+1)<<8)|(WORD)*(BYTE*)(ptr))
+#define LD_DWORD(ptr) (DWORD)(((DWORD)*((BYTE*)(ptr)+3)<<24)|((DWORD)*((BYTE*)(ptr)+2)<<16)|((WORD)*((BYTE*)(ptr)+1)<<8)|*(BYTE*)(ptr))
+#define ST_WORD(ptr,val) *(BYTE*)(ptr)=(BYTE)(val); *((BYTE*)(ptr)+1)=(BYTE)((WORD)(val)>>8)
+#define ST_DWORD(ptr,val) *(BYTE*)(ptr)=(BYTE)(val); *((BYTE*)(ptr)+1)=(BYTE)((WORD)(val)>>8); *((BYTE*)(ptr)+2)=(BYTE)((DWORD)(val)>>16); *((BYTE*)(ptr)+3)=(BYTE)((DWORD)(val)>>24)
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _PFATFS */
diff --git a/3rdparty/petitfs-0.03/src/pffconf.h b/3rdparty/petitfs-0.03/src/pffconf.h
new file mode 100644
index 00000000..c09c9fdb
--- /dev/null
+++ b/3rdparty/petitfs-0.03/src/pffconf.h
@@ -0,0 +1,89 @@
+/*---------------------------------------------------------------------------/
+/ Petit FatFs - Configuration file R0.03 (C)ChaN, 2014
+/---------------------------------------------------------------------------*/
+
+#ifndef _PFFCONF
+#define _PFFCONF 4004 /* Revision ID */
+
+/*---------------------------------------------------------------------------/
+/ Function Configurations
+/---------------------------------------------------------------------------*/
+
+#define _USE_READ 1 /* Enable pf_read() function */
+#define _USE_DIR 0 /* Enable pf_opendir() and pf_readdir() function */
+#define _USE_LSEEK 0 /* Enable pf_lseek() function */
+#define _USE_WRITE 0 /* Enable pf_write() function */
+
+#define _FS_FAT12 0 /* Enable FAT12 */
+#define _FS_FAT16 1 /* Enable FAT16 */
+#define _FS_FAT32 0 /* Enable FAT32 */
+
+
+/*---------------------------------------------------------------------------/
+/ Locale and Namespace Configurations
+/---------------------------------------------------------------------------*/
+
+#define _USE_LCC 0 /* Allow lower case characters for path name */
+
+#define _CODE_PAGE 437
+/* The _CODE_PAGE specifies the code page to be used on the target system.
+/ SBCS code pages with _USE_LCC == 1 requiers a 128 byte of case conversion
+/ table. This might occupy RAM on some platforms, e.g. avr-gcc.
+/ When _USE_LCC == 0, _CODE_PAGE has no effect.
+/
+/ 932 - Japanese Shift_JIS (DBCS, OEM, Windows)
+/ 936 - Simplified Chinese GBK (DBCS, OEM, Windows)
+/ 949 - Korean (DBCS, OEM, Windows)
+/ 950 - Traditional Chinese Big5 (DBCS, OEM, Windows)
+/ 1250 - Central Europe (Windows)
+/ 1251 - Cyrillic (Windows)
+/ 1252 - Latin 1 (Windows)
+/ 1253 - Greek (Windows)
+/ 1254 - Turkish (Windows)
+/ 1255 - Hebrew (Windows)
+/ 1256 - Arabic (Windows)
+/ 1257 - Baltic (Windows)
+/ 1258 - Vietnam (OEM, Windows)
+/ 437 - U.S. (OEM)
+/ 720 - Arabic (OEM)
+/ 737 - Greek (OEM)
+/ 775 - Baltic (OEM)
+/ 850 - Multilingual Latin 1 (OEM)
+/ 858 - Multilingual Latin 1 + Euro (OEM)
+/ 852 - Latin 2 (OEM)
+/ 855 - Cyrillic (OEM)
+/ 866 - Russian (OEM)
+/ 857 - Turkish (OEM)
+/ 862 - Hebrew (OEM)
+/ 874 - Thai (OEM, Windows)
+*/
+
+
+/*---------------------------------------------------------------------------/
+/ System Configurations
+/---------------------------------------------------------------------------*/
+
+#define _WORD_ACCESS 0
+/* The _WORD_ACCESS option is an only platform dependent option. It defines
+/ which access method is used to the word data on the FAT volume.
+/
+/ 0: Byte-by-byte access. Always compatible with all platforms.
+/ 1: Word access. Do not choose this unless under both the following conditions.
+/
+/ * Address misaligned memory access is always allowed for ALL instructions.
+/ * Byte order on the memory is little-endian.
+/
+/ If it is the case, _WORD_ACCESS can also be set to 1 to improve performance and
+/ reduce code size. Following table shows an example of some processor types.
+/
+/ ARM7TDMI 0 ColdFire 0 V850E 0
+/ Cortex-M3 0 Z80 0/1 V850ES 0/1
+/ Cortex-M0 0 RX600(LE) 0/1 TLCS-870 0/1
+/ AVR 0/1 RX600(BE) 0 TLCS-900 0/1
+/ AVR32 0 RL78 0 R32C 0
+/ PIC18 0/1 SH-2 0 M16C 0/1
+/ PIC24 0 H8S 0 MSP430 0
+/ PIC32 0 H8/300H 0 x86 0/1
+*/
+
+#endif /* _PFFCONF */