Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e76defd75c | |||
| 5da8c4a4b9 | |||
| 81b786bcd2 | |||
| 672636ff1d | |||
| 35fb314106 | |||
| f2bf030bfd | |||
| ff793da7d3 | |||
| f7aa9edafc | |||
| d5cd09ebf7 | |||
| 9c7d461c41 | |||
| 2a5ed95231 | |||
| 7ee1f4cc87 |
+24
@@ -0,0 +1,24 @@
|
|||||||
|
FatFs License
|
||||||
|
|
||||||
|
FatFs has being developped as a personal project of the author, ChaN. It is free from the code anyone else wrote at current release. Following code block shows a copy of the FatFs license document that heading the source files.
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------------/
|
||||||
|
/ FatFs - Generic FAT Filesystem Module Rx.xx /
|
||||||
|
/-----------------------------------------------------------------------------/
|
||||||
|
/
|
||||||
|
/ Copyright (C) 20xx, ChaN, all right reserved.
|
||||||
|
/
|
||||||
|
/ FatFs module is an open source software. Redistribution and use of FatFs in
|
||||||
|
/ source and binary forms, with or without modification, are permitted provided
|
||||||
|
/ that the following condition is met:
|
||||||
|
/
|
||||||
|
/ 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
/ this condition and the following disclaimer.
|
||||||
|
/
|
||||||
|
/ This software is provided by the copyright holder and contributors "AS IS"
|
||||||
|
/ and any warranties related to this software are DISCLAIMED.
|
||||||
|
/ The copyright owner or contributors be NOT LIABLE for any damages caused
|
||||||
|
/ by use of this software.
|
||||||
|
/----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
Therefore FatFs license is one of the BSD-style licenses but there is a significant feature. FatFs is mainly intended for embedded systems. In order to extend the usability for commercial products, the redistributions of FatFs in binary form, such as embedded code, binary library and any forms without source code, does not need to include about FatFs in the documentations. This is equivalent to the 1-clause BSD license. Of course FatFs is compatible with the most of open source software licenses including GNU GPL. When you redistribute the FatFs source code with any changes or create a fork, the license can also be changed to GNU GPL, BSD-style license or any open source software license that not conflict with FatFs license.
|
||||||
@@ -24,12 +24,12 @@
|
|||||||
<li>Very small footprint for program code and work area.</li>
|
<li>Very small footprint for program code and work area.</li>
|
||||||
<li>Various <a href="doc/config.html">configuration options</a> to support for:
|
<li>Various <a href="doc/config.html">configuration options</a> to support for:
|
||||||
<ul>
|
<ul>
|
||||||
<li>Multiple volumes (physical drives and partitions).</li>
|
|
||||||
<li>Multiple ANSI/OEM code pages including DBCS.</li>
|
|
||||||
<li>Long file name in ANSI/OEM or Unicode.</li>
|
<li>Long file name in ANSI/OEM or Unicode.</li>
|
||||||
<li>exFAT filesystem.</li>
|
<li>exFAT filesystem.</li>
|
||||||
<li>RTOS envilonment.</li>
|
<li>Thread safe for RTOS.</li>
|
||||||
<li>Fixed or variable sector size.</li>
|
<li>Multiple volumes (physical drives and partitions).</li>
|
||||||
|
<li>Variable sector size.</li>
|
||||||
|
<li>Multiple code pages including DBCS.</li>
|
||||||
<li>Read-only, optional API, I/O buffer and etc...</li>
|
<li>Read-only, optional API, I/O buffer and etc...</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
@@ -119,17 +119,19 @@
|
|||||||
<h3>Resources</h3>
|
<h3>Resources</h3>
|
||||||
<p>The FatFs module is a free software opened for education, research and development. You can use, modify and/or redistribute it for personal projects or commercial products without any restriction under your responsibility. For further information, refer to the application note.</p>
|
<p>The FatFs module is a free software opened for education, research and development. You can use, modify and/or redistribute it for personal projects or commercial products without any restriction under your responsibility. For further information, refer to the application note.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Read first: <a href="doc/appnote.html">FatFs module application note</a> <span class="mfd">May 21, 2017</span></li>
|
<li>Read first: <a href="doc/appnote.html">FatFs module application note</a></li>
|
||||||
|
<li>Download: <a href="http://elm-chan.org/fsw/ff/archives.html">Archives of FatFs and Petit-FatFs</a></li>
|
||||||
<li>Community: <a href="http://elm-chan.org/fsw/ff/bd/">FatFs User Forum</a></li>
|
<li>Community: <a href="http://elm-chan.org/fsw/ff/bd/">FatFs User Forum</a></li>
|
||||||
<li><a href="https://msdn.microsoft.com/en-us/windows/hardware/gg463080.aspx">FAT32 Specification by Microsoft</a>↗ (The authorized document on FAT filesystem)</li>
|
<li><a href="https://msdn.microsoft.com/en-us/windows/hardware/gg463080.aspx">FAT32 Specification by Microsoft</a>↗ (The authorized document on FAT filesystem)</li>
|
||||||
<li><a href="http://elm-chan.org/docs/fat_e.html">The basics of FAT filesystem</a></li>
|
<li><a href="http://elm-chan.org/docs/fat_e.html">The basics of FAT filesystem</a></li>
|
||||||
<li><a href="http://elm-chan.org/docs/exfat_e.html">The basics of exFAT filesystem</a></li>
|
<li><a href="http://elm-chan.org/docs/exfat_e.html">The basics of exFAT filesystem</a></li>
|
||||||
<li><a href="http://elm-chan.org/docs/mmc/mmc_e.html">How to use MMC/SDC</a></li>
|
<li><a href="http://elm-chan.org/docs/mmc/mmc_e.html">How to use MMC/SDC</a></li>
|
||||||
<li><a href="http://elm-chan.org/junk/fa/faff.html">Playing with FlashAir and FatFs</a></li>
|
<li><a href="http://elm-chan.org/junk/fa/faff.html">Playing with FlashAir and FatFs</a></li>
|
||||||
<li><a href="http://stm32f4-discovery.com/2014/07/library-21-read-sd-card-fatfs-stm32f4xx-devices/">Read SD card with FatFs on STM32F4xx devices by Tilen Majerle</a>↗ (Quick and easy implementation for STM32F4-Discovery)</li>
|
|
||||||
<li><a href="http://nemuisan.blog.bai.ne.jp/">Nemuisan's Blog</a>↗ (Well written implementations for STM32F/SPI & SDIO and LPC4088/SDMMC)</li>
|
<li><a href="http://nemuisan.blog.bai.ne.jp/">Nemuisan's Blog</a>↗ (Well written implementations for STM32F/SPI & SDIO and LPC4088/SDMMC)</li>
|
||||||
|
<li><a href="http://stm32f4-discovery.net/2014/07/library-21-read-sd-card-fatfs-stm32f4xx-devices/">Read SD card with FatFs on STM32F4xx devices by Tilen Majerle</a>↗ (Quick and easy implementation for STM32F4-Discovery)</li>
|
||||||
<li><a href="res/rwtest1.png">Benchmark 1</a> (ATmega1284/20MHz with MMC via USART in SPI, CFC via GPIO)</li>
|
<li><a href="res/rwtest1.png">Benchmark 1</a> (ATmega1284/20MHz with MMC via USART in SPI, CFC via GPIO)</li>
|
||||||
<li><a href="res/rwtest2.png">Benchmark 2</a> (LPC2368/72MHz with MMC via MCI)</li>
|
<li><a href="res/rwtest2.png">Benchmark 2</a> (LPC2368/72MHz with MMC via MCI)</li>
|
||||||
|
<li><a href="res/fd.mp4">Demo movie of an application</a> (this project is in ffsample.zip/lpc23xx)</li></ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+50
-41
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/appnote.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/appnote.html">
|
||||||
@@ -31,23 +31,29 @@
|
|||||||
<div class="para doc" id="port">
|
<div class="para doc" id="port">
|
||||||
<h3>How to Port</h3>
|
<h3>How to Port</h3>
|
||||||
|
|
||||||
<h4>Basic considerations</h4>
|
<h4>Basic Considerations</h4>
|
||||||
<p>The FatFs module is assuming following conditions on portability.</p>
|
<p>The FatFs module assumes following conditions on portability.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>ANSI C<br>
|
<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>
|
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 C89 or later. Only exFAT feature requires C99.</li>
|
||||||
<li>Size of integer types<br>
|
<li>Size of integer types<br>
|
||||||
The FatFs module assumes that size of <tt>char</tt>/<tt>short</tt>/<tt>long</tt> are 8/16/32 bit and <tt>int</tt> is 16 or 32 bit. These correspondence are defined in <tt>integer.h</tt>. This will not be a problem on most compilers. When a conflict with existing definitions is occured, you must resolve it with care.</li>
|
<ul>
|
||||||
|
<li>When the C standard is in C89, size of <tt>char</tt>/<tt>short</tt>/<tt>long</tt> must be 8/16/32-bit respectively.</li>
|
||||||
|
<li>When it is in C99 or later, <tt>stdint.h</tt> is used to obtain the correct sizes.</li>
|
||||||
|
<li>Size of <tt>char</tt> must be 8-bit.</li>
|
||||||
|
<li>Size of <tt>int</tt>, as well as integer promotion, must be 16-bit or 32-bit.</li>
|
||||||
|
</ul>
|
||||||
|
Integer types used in FatFs are defined in <tt>fftypes.h</tt>. This will not be a problem on most platform. When a conflict with existing definitions occured, you must resolve it with care.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h4>System organizations</h4>
|
<h4>System Organizations</h4>
|
||||||
<p>The dependency diagram shown below is a typical but not specific configuration of the embedded system with FatFs module.</p>
|
<p>The dependency diagram shown below is a typical, but not specific, configuration of the embedded system with FatFs module.</p>
|
||||||
<p><img src="../res/modules.png" width="580" height="280" alt="dependency diagram"></p>
|
<p><img src="../res/modules.png" width="580" height="280" alt="dependency diagram"></p>
|
||||||
<p>(a) If a working disk module with FatFs disk interface is provided, nothing else will be needed. (b) To attach existing disk drivers with different interface, glue functions are needed to translate the interfaces between FatFs and the drivers.</p>
|
<p>(a) If a working disk module for FatFs is provided, nothing else will be needed. (b) To attach existing disk drivers with different interface, some glue functions are needed to translate the interfaces between FatFs and the driver.</p>
|
||||||
<p><img src="../res/funcs.png" width="750" height="420" alt="functional diagram"></p>
|
<p><img src="../res/funcs.png" width="750" height="420" alt="functional diagram"></p>
|
||||||
|
|
||||||
<h4>Required functions</h4>
|
<h4>Required Functions</h4>
|
||||||
<p>You need to provide only low level disk I/O functions required by FatFs module and nothing else. If a working disk module for the target system is already provided, you need to write only glue functions to attach it to the FatFs module. If not, you need to port another disk I/O module or write it from scratch. Most of defined functions are not that always required. For example, any write function is not required at read-only configuration. Following table shows which function is required depends on the configuration options.</p>
|
<p>You need to provide only low level disk I/O functions required by FatFs module and nothing else. If a working disk I/O module for the target system is already provided, you need to write only glue functions to attach it to the FatFs module. If not, you need to port another disk I/O module or write it from scratch. Most of defined functions are not that always required. For instance, any write function is not required at read-only configuration. Following table shows which function is required depends on the configuration options.</p>
|
||||||
<table class="lst2">
|
<table class="lst2">
|
||||||
<tr><th>Function</th><th>Required when</th><th>Note</th></tr>
|
<tr><th>Function</th><th>Required when</th><th>Note</th></tr>
|
||||||
<tr><td>disk_status<br>disk_initialize<br>disk_read</td><td>Always</td><td rowspan="5">Disk I/O functions.<br>Samples available in ffsample.zip.<br>There are many implementations on the web.</td></tr>
|
<tr><td>disk_status<br>disk_initialize<br>disk_read</td><td>Always</td><td rowspan="5">Disk I/O functions.<br>Samples available in ffsample.zip.<br>There are many implementations on the web.</td></tr>
|
||||||
@@ -55,10 +61,11 @@ The FatFs module assumes that size of <tt>char</tt>/<tt>short</tt>/<tt>long</tt>
|
|||||||
<tr><td>disk_ioctl (GET_SECTOR_COUNT)<br>disk_ioctl (GET_BLOCK_SIZE)</td><td>FF_USE_MKFS == 1</td></tr>
|
<tr><td>disk_ioctl (GET_SECTOR_COUNT)<br>disk_ioctl (GET_BLOCK_SIZE)</td><td>FF_USE_MKFS == 1</td></tr>
|
||||||
<tr><td>disk_ioctl (GET_SECTOR_SIZE)</td><td>FF_MAX_SS != FF_MIN_SS</td></tr>
|
<tr><td>disk_ioctl (GET_SECTOR_SIZE)</td><td>FF_MAX_SS != FF_MIN_SS</td></tr>
|
||||||
<tr><td>disk_ioctl (CTRL_TRIM)</td><td>FF_USE_TRIM == 1</td></tr>
|
<tr><td>disk_ioctl (CTRL_TRIM)</td><td>FF_USE_TRIM == 1</td></tr>
|
||||||
<tr><td>ff_uni2oem<br>ff_oem2uni<br>ff_wtoupper</td><td>FF_USE_LFN != 0</td><td>Unicode support functions.<br>Just add ffunicode.c to the project.</td></tr>
|
<tr><td>ff_uni2oem<br>ff_oem2uni<br>ff_wtoupper</td><td>FF_USE_LFN != 0</td><td>Unicode support functions.<br>Add optional module ffunicode.c to the project.</td></tr>
|
||||||
<tr><td>ff_cre_syncobj<br>ff_del_syncobj<br>ff_req_grant<br>ff_rel_grant</td><td>FF_FS_REENTRANT == 1</td><td rowspan="2">O/S dependent functions.<br>Samples available in ffsystem.c.</td></tr>
|
<tr><td>ff_cre_syncobj<br>ff_del_syncobj<br>ff_req_grant<br>ff_rel_grant</td><td>FF_FS_REENTRANT == 1</td><td rowspan="2">O/S dependent functions.<br>Sample code is available in ffsystem.c.</td></tr>
|
||||||
<tr><td>ff_mem_alloc<br>ff_mem_free</td><td>FF_USE_LFN == 3</td></tr>
|
<tr><td>ff_mem_alloc<br>ff_mem_free</td><td>FF_USE_LFN == 3</td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
<p>FatFs cares about neither what kind of storage device is used nor how it is implemented. Only a requirement is that it is a block device read/written in fixed-size blocks that accessible via the disk I/O functions defined above.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="para doc" id="limits">
|
<div class="para doc" id="limits">
|
||||||
@@ -81,21 +88,21 @@ The FatFs module assumes that size of <tt>char</tt>/<tt>short</tt>/<tt>long</tt>
|
|||||||
<tr><th></th><th>ARM7<small><br>32bit</small></th><th>ARM7<small><br>Thumb</small></th><th>CM3<small><br>Thumb-2</small></th><th>AVR</th><th>H8/300H</th><th>PIC24</th><th>RL78</th><th>V850ES</th><th>SH-2A</th><th>RX600</th><th>IA-32</th></tr>
|
<tr><th></th><th>ARM7<small><br>32bit</small></th><th>ARM7<small><br>Thumb</small></th><th>CM3<small><br>Thumb-2</small></th><th>AVR</th><th>H8/300H</th><th>PIC24</th><th>RL78</th><th>V850ES</th><th>SH-2A</th><th>RX600</th><th>IA-32</th></tr>
|
||||||
<tr class="cal"> <td>Compiler</td><td>GCC</td><td>GCC</td><td>GCC</td><td>GCC</td><td>CH38</td><td>C30</td><td>CC78K0R</td><td>CA850</td><td>SHC</td><td>RXC</td><td>MSC</td></tr>
|
<tr class="cal"> <td>Compiler</td><td>GCC</td><td>GCC</td><td>GCC</td><td>GCC</td><td>CH38</td><td>C30</td><td>CC78K0R</td><td>CA850</td><td>SHC</td><td>RXC</td><td>MSC</td></tr>
|
||||||
<!-- ARM Thumb CM3 AVR H8 PIC24 RL78 V850ES SH-2A RX600 IA-32 -->
|
<!-- ARM Thumb CM3 AVR H8 PIC24 RL78 V850ES SH-2A RX600 IA-32 -->
|
||||||
<tr class="ral"><td class="cal">text (Full, R/W)</td><td>10.3k</td><td>6.7k</td><td>6.3k</td><td>12.4k</td> <td>9.9k</td><td>11.4k</td><td>13.1k</td><td>8.7k</td><td>9.0k</td><td>6.5k</td><td>8.6k</td></tr>
|
<tr class="ral"><td class="cal">text (Full, R/W)</td><td>10.4k</td><td>6.7k</td><td>6.3k</td><td>12.4k</td> <td>9.9k</td><td>11.2k</td><td>13.0k</td><td>8.7k</td><td>9.0k</td><td>6.5k</td><td>8.9k</td></tr>
|
||||||
<tr class="ral"><td class="cal">text (Min, R/W)</td> <td>6.9k</td><td>4.7k</td><td>4.4k</td> <td>8.4k</td> <td>6.9k</td> <td>8.0k</td> <td>9.4k</td><td>6.2k</td><td>6.2k</td><td>4.6k</td><td>6.1k</td></tr>
|
<tr class="ral"><td class="cal">text (Min, R/W)</td> <td>7.0k</td><td>4.7k</td><td>4.4k</td> <td>8.4k</td> <td>6.9k</td> <td>7.8k</td> <td>9.4k</td><td>6.0k</td><td>6.2k</td><td>4.6k</td><td>6.3k</td></tr>
|
||||||
<tr class="ral"><td class="cal">text (Full, R/O)</td> <td>4.7k</td><td>3.1k</td><td>2.8k</td> <td>5.7k</td> <td>4.7k</td> <td>5.4k</td> <td>6.4k</td><td>4.2k</td><td>4.0k</td><td>3.1k</td><td>4.1k</td></tr>
|
<tr class="ral"><td class="cal">text (Full, R/O)</td> <td>4.8k</td><td>3.1k</td><td>2.8k</td> <td>5.7k</td> <td>4.7k</td> <td>5.3k</td> <td>6.4k</td><td>4.2k</td><td>4.0k</td><td>3.1k</td><td>4.2k</td></tr>
|
||||||
<tr class="ral"><td class="cal">text (Min, R/O)</td> <td>3.6k</td><td>2.4k</td><td>2.2k</td> <td>4.4k</td> <td>3.6k</td> <td>4.2k</td> <td>5.0k</td><td>3.3k</td><td>3.1k</td><td>2.4k</td><td>3.2k</td></tr>
|
<tr class="ral"><td class="cal">text (Min, R/O)</td> <td>3.6k</td><td>2.4k</td><td>2.2k</td> <td>4.4k</td> <td>3.6k</td> <td>4.1k</td> <td>5.0k</td><td>3.3k</td><td>3.1k</td><td>2.4k</td><td>3.3k</td></tr>
|
||||||
<tr class="ral"><td class="cal">bss</td><td>V*4 + 2</td><td>V*4 + 2</td><td>V*4 + 2</td><td>V*2 + 2</td><td>V*4 + 2</td><td>V*2 + 2</td><td>V*2 + 2</td><td>V*4 + 2</td><td>V*4 + 2</td><td>V*4 + 2</td><td>V*4 + 2</td></tr>
|
<tr class="ral"><td class="cal">bss</td><td>V*4 + 2</td><td>V*4 + 2</td><td>V*4 + 2</td><td>V*2 + 2</td><td>V*4 + 2</td><td>V*2 + 2</td><td>V*2 + 2</td><td>V*4 + 2</td><td>V*4 + 2</td><td>V*4 + 2</td><td>V*4 + 2</td></tr>
|
||||||
<tr class="ral"><td class="cal">Work area<br><small>(FF_FS_TINY == 0)</small></td><td>V*564<br>+ F*552</td><td>V*564<br>+ F*552</td><td>V*564<br>+ F*552</td><td>V*560<br>+ F*546</td><td>V*560<br>+ F*546</td><td>V*560<br>+ F*546</td><td>V*560<br>+ F*546</td><td>V*564<br>+ F*552</td><td>V*564<br>+ F*552</td><td>V*564<br>+ F*552</td><td>V*564<br>+ F*552</td></tr>
|
<tr class="ral"><td class="cal">Work area<br><small>(FF_FS_TINY == 0)</small></td><td>V*564<br>+ F*552</td><td>V*564<br>+ F*552</td><td>V*564<br>+ F*552</td><td>V*560<br>+ F*546</td><td>V*560<br>+ F*546</td><td>V*560<br>+ F*546</td><td>V*560<br>+ F*546</td><td>V*564<br>+ F*552</td><td>V*564<br>+ F*552</td><td>V*564<br>+ F*552</td><td>V*564<br>+ F*552</td></tr>
|
||||||
<tr class="ral"><td class="cal">Work area<br><small>(FF_FS_TINY == 1)</small></td><td>V*564<br>+ F*40</td><td>V*564<br>+ F*40</td><td>V*564<br>+ F*40</td><td>V*560<br>+ F*34</td><td>V*560<br>+ F*34</td><td>V*560<br>+ F*34</td><td>V*560<br>+ F*34</td><td>V*564<br>+ F*40</td><td>V*564<br>+ F*40</td><td>V*564<br>+ F*40</td><td>V*564<br>+ F*40</td></tr>
|
<tr class="ral"><td class="cal">Work area<br><small>(FF_FS_TINY == 1)</small></td><td>V*564<br>+ F*40</td><td>V*564<br>+ F*40</td><td>V*564<br>+ F*40</td><td>V*560<br>+ F*34</td><td>V*560<br>+ F*34</td><td>V*560<br>+ F*34</td><td>V*560<br>+ F*34</td><td>V*564<br>+ F*40</td><td>V*564<br>+ F*40</td><td>V*564<br>+ F*40</td><td>V*564<br>+ F*40</td></tr>
|
||||||
</table>
|
</table>
|
||||||
<p>These are the memory usage on some target systems with following condition. The memory sizes are in unit of byte, <em>V</em> denotes option <tt>FF_VOLUMES</tt> and <em>F</em> denotes number of open files. All samples here are optimezed in code size.</p>
|
<p>These are the memory usage of FatFs module without lower layer on some target systems in following condition. <em>V</em> denotes number of mounted volumes and <em>F</em> denotes number of open files. Every samples here are optimezed in code size.</p>
|
||||||
<pre>
|
<pre>
|
||||||
FatFs R0.13 options:
|
FatFs R0.13a options:
|
||||||
FF_FS_READONLY 0 (R/W) or 1 (R/O)
|
FF_FS_READONLY 0 (Read/Write) or 1 (Read only)
|
||||||
FF_FS_MINIMIZE 0 (Full, with all basic functions) or 3 (Min, with fully minimized)
|
FF_FS_MINIMIZE 0 (Full, with all basic functions) or 3 (Min, with fully minimized)
|
||||||
FF_FS_TINY 0 (Default) or 1 (Tiny file object)
|
FF_FS_TINY 0 (Default) or 1 (Tiny file object)
|
||||||
And other options are left unchanged from original setting.
|
And any other options are left unchanged from original setting.
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -146,8 +153,8 @@ And other options are left unchanged from original setting.
|
|||||||
<h3>Long File Name</h3>
|
<h3>Long File Name</h3>
|
||||||
<p>FatFs module supports long file name (LFN). The two different file names, short file name (SFN) and LFN, of a file is transparent on the API except for <tt>f_readdir</tt> function. The support for LFN is disabled by default. To enable the LFN, set <tt><a href="config.html#use_lfn">FF_USE_LFN</a></tt> to 1, 2 or 3, and add <tt>ffunicode.c</tt> to the project. The LFN requiers a certain working buffer in addition. The buffer size can be configured by <tt><a href="config.html#max_lfn">FF_MAX_LFN</a></tt> according to the available memory. The length of an LFN will be up to 255 characters, so that the <tt>FF_MAX_LFN</tt> should be set to 255 for all file names. If the size of working buffer is insufficient for the input file name, the file function fails with <tt>FR_INVALID_NAME</tt>. When use any re-entry to the API with LFN is enabled, <tt>FF_USE_LFN</tt> must be set to 2 or 3. In this case, the file function allocates the working buffer on the stack or heap. The working buffer occupies <tt>(FF_MAX_LFN + 1) * 2</tt> bytes and additional <tt>(FF_MAX_LFN + 44) / 15 * 32</tt> bytes when exFAT is enabled.</p>
|
<p>FatFs module supports long file name (LFN). The two different file names, short file name (SFN) and LFN, of a file is transparent on the API except for <tt>f_readdir</tt> function. The support for LFN is disabled by default. To enable the LFN, set <tt><a href="config.html#use_lfn">FF_USE_LFN</a></tt> to 1, 2 or 3, and add <tt>ffunicode.c</tt> to the project. The LFN requiers a certain working buffer in addition. The buffer size can be configured by <tt><a href="config.html#max_lfn">FF_MAX_LFN</a></tt> according to the available memory. The length of an LFN will be up to 255 characters, so that the <tt>FF_MAX_LFN</tt> should be set to 255 for all file names. If the size of working buffer is insufficient for the input file name, the file function fails with <tt>FR_INVALID_NAME</tt>. When use any re-entry to the API with LFN is enabled, <tt>FF_USE_LFN</tt> must be set to 2 or 3. In this case, the file function allocates the working buffer on the stack or heap. The working buffer occupies <tt>(FF_MAX_LFN + 1) * 2</tt> bytes and additional <tt>(FF_MAX_LFN + 44) / 15 * 32</tt> bytes when exFAT is enabled.</p>
|
||||||
<table class="lst2 rset">
|
<table class="lst2 rset">
|
||||||
<caption>With LFN at CM3+gcc</caption>
|
<caption>With LFN at CM3 + gcc</caption>
|
||||||
<tr><th><tt>FF_CODE_PAGE</tt></th><th>Increment</th></tr>
|
<tr><th><tt>FF_CODE_PAGE</tt></th><th>Code size</th></tr>
|
||||||
<tr><td>437-869 (SBCS)</td><td>+3.3k</td></tr>
|
<tr><td>437-869 (SBCS)</td><td>+3.3k</td></tr>
|
||||||
<tr><td>932 (Japanese)</td><td>+62k</td></tr>
|
<tr><td>932 (Japanese)</td><td>+62k</td></tr>
|
||||||
<tr><td>936 (Simplified Chinese)</td><td>+177k</td></tr>
|
<tr><td>936 (Simplified Chinese)</td><td>+177k</td></tr>
|
||||||
@@ -155,51 +162,52 @@ And other options are left unchanged from original setting.
|
|||||||
<tr><td>950 (Traditional Chinese)</td><td>+111k</td></tr>
|
<tr><td>950 (Traditional Chinese)</td><td>+111k</td></tr>
|
||||||
<tr><td>0 (All code pages)</td><td>+486k</td></tr>
|
<tr><td>0 (All code pages)</td><td>+486k</td></tr>
|
||||||
</table>
|
</table>
|
||||||
<p>When the LFN is enabled, the module size will be increased depends on the configured code page. Right table shows increment of code size by LFN function at different code pages. Especially, in the CJK region, tens of thousands of characters are being used. Unfortunately, it requires a huge OEM-Unicode bidirectional conversion table and the module size will be drastically increased as shown in the table. As the result, the FatFs with LFN enebled with those code pages will not able to be ported on the most 8-bit MCU systems.</p>
|
<p>When the LFN is enabled, the module size will be increased depends on the configured code page. Right table shows increment of code size by LFN function at different code pages. Especially, in the CJK region, tens of thousands of characters are being used. Unfortunately, it requires a huge OEM-Unicode bidirectional conversion table and the module size will be drastically increased as shown in the table.</p>
|
||||||
<p>There ware some restrictions on using LFN for open source project because the support for LFN on the FAT volume was a patent of Microsoft Corporation. The related patents have expired and using the LFN function have got free for any projects.</p>
|
<p>As the result, the FatFs with LFN enebled with DBCS code pages will not able to be ported on the most 8-bit MCU systems. If the target system is in legacy-free, in only Unicode and any ANSI/OEM code is not used at all, the code page setting gets meaningless. You will able to reduce the code size by configureing FatFs for Unicode with any SBCS code page.</p>
|
||||||
|
<p>There ware some restrictions on using LFN for open source project because the support for LFN on the FAT volume was a patent of Microsoft Corporation. The related patents have expired and using the LFN function has got free for any projects.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="para doc" id="unicode">
|
<div class="para doc" id="unicode">
|
||||||
<h3>Unicode API</h3>
|
<h3>Unicode API</h3>
|
||||||
<p>By default, FatFs uses ANSI/OEM code set on the API even at LFN configuration. FatFs can also switch the character encoding on the API to Unicode by configuration option <tt><a href="config.html#lfn_unicode">FF_LFN_UNICODE</a></tt>. This means that FatFs supports the full featured LFN specification. The data type <tt>TCHAR</tt> specifies path name strings on the API is an alias of either <tt>char</tt>(ANSI/OEM) or <tt>WCHAR</tt>(UTF-16) depends on that option. For more information, refer to the description in the <a href="filename.html#uni">file name</a>.</p>
|
<p>By default, FatFs uses ANSI/OEM code set on the API even at LFN configuration. FatFs can also switch the character encoding on the API to Unicode by configuration option <tt><a href="config.html#lfn_unicode">FF_LFN_UNICODE</a></tt>. This means that FatFs is compliant with the full featured LFN specification. The data type <tt>TCHAR</tt> specifies path name strings on the API is an alias of either <tt>char</tt>(ANSI/OEM or UTF-8), <tt>WCHAR</tt>(UTF-16) or <tt>DWORD</tt>(UTF-32) depends on that option. For more information, refer to the description in the <a href="filename.html#uni">file name</a>.</p>
|
||||||
<p>Note that code page setting, <tt><a href="config.html#code_page">FF_CODE_PAGE</a></tt>, has actually no meaning for the path names at the Unicode API. However it still affects code conversion of string I/O functions at <tt><a href="config.html#strf_encode">FF_STRF_ENCODE = 0</a></tt> and backward compatibility with non-LFN systems, so that code page needs to be set properly when it is considered a problem.</p>
|
<p>Note that setting of code page, <tt><a href="config.html#code_page">FF_CODE_PAGE</a></tt>, has actually no meaning when FatFs is configured for the Unicode API. It should be set 437 anyway. However it still affects code conversion of string I/O functions at <tt><a href="config.html#strf_encode">FF_STRF_ENCODE</a> == 0</tt> and backward compatibility with legacy systems, so that code page may need to be configured properly if it is considered a problem.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="para doc" id="exfat">
|
<div class="para doc" id="exfat">
|
||||||
<h3>exFAT Filesystem</h3>
|
<h3>exFAT Filesystem</h3>
|
||||||
<p>The exFAT (Microsoft's Extended File Allocation Table) filesystem is a succession of the FAT filesystem which has been widely used in embedded systems, consumer devices and portable storage media. It is adopted by SDA (SD Association) as a recommended filesystem for high capacity SD cards larger than 32 GB and they are being shipped with this format, so that the exFAT became one of the standard filesystems for removable media as well as FAT. The exFAT filesystem allows the file size beyond the 4 GB limit what FAT filesystem allows upto and some filesystem overhead, especially cluster allocation delay, are reduced as well. This feature improves the write throughput to the file.</p>
|
<p>The exFAT (Microsoft's Extended File Allocation Table) filesystem is a succession of the FAT/FAT32 filesystem which has been widely used in embedded systems, consumer devices and portable storage media. It is adopted by SDA (SD Association) as the regular filesystem for SDXC card, 64 GB and larger, and they are being shipped with this format. Therefore the exFAT is one of the standard filesystems for removable media as well as FAT. The exFAT filesystem allows the file size beyond the 4 GB limit what FAT filesystem allows upto and some filesystem overhead, especially cluster allocation delay, are reduced as well. These features allow to record the large media file without dividing into some files and improve the write throughput to the file.</p>
|
||||||
<p>Note that the exFAT is a patent of Microsoft Corporation. The exFAT function of FatFs is an implementation based on <cite>US. Pat. App. Pub. No. 2009/0164440 A1</cite>. FatFs module can swich the support for exFAT on/off by configuration option, <tt><a href="config.html#fs_exfat">FF_FS_EXFAT</a></tt>. When enable the exFAT on the commercial products, a license by Microsoft will be needed depends on the final destination of the products.</p>
|
<p>Note that the exFAT is a patent of Microsoft Corporation. The support for exFAT of FatFs is an implementation based on <cite>US. Pat. App. Pub. No. 2009/0164440 A1</cite>. FatFs module can switch the exFAT on or off by configuration option, <tt><a href="config.html#fs_exfat">FF_FS_EXFAT</a></tt>. When enable the exFAT on the commercial products, a license by Microsoft will be needed depends on the final destination of the products.</p>
|
||||||
<p><em>Remark: Enabling exFAT discards ANSI C (C89) compatibility because of need for 64-bit integer type.</em></p>
|
<p><em>Remark: Enabling exFAT discards C89 compatibility because of need for 64-bit integer type.</em></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="para doc" id="reentrant">
|
<div class="para doc" id="reentrant">
|
||||||
<h3>Re-entrancy</h3>
|
<h3>Re-entrancy</h3>
|
||||||
<p>The file operations to the <em>different volumes</em> each other is always re-entrant regardless of configurations except when LFN is enabled with static working buffer. It can work concurrently without any mutual exclusion.</p>
|
<p>The file operations to the <em>different volumes</em> each other is always re-entrant regardless of configurations except when LFN is enabled with static working buffer. It can work concurrently without any mutual exclusion.</p>
|
||||||
<p>The file operations to the <em>same volume</em> is not re-entrant. It can also be configured for thread-safe by option <tt><a href="config.html#fs_reentrant">FF_FS_REENTRANT</a></tt>. In this case, also the OS dependent synchronization object control functions, <tt>ff_cre_syncobj/ff_del_syncobj/ff_req_grant/ff_rel_grant</tt>, need to be added to the project. There are some examples in the <tt>ffsystem.c</tt>. When a file function is called while the volume is being accessed by another task, the file function to the volume will be suspended until that task leaves the file function. If the wait time exceeded a period defined by <tt>FF_TIMEOUT</tt>, the file function will abort with <tt>FR_TIMEOUT</tt>. The timeout function might not be supported on the some RTOSs.</p>
|
<p>The file operations to the <em>same volume</em> is not re-entrant. It can also be configured for thread-safe by option <tt><a href="config.html#fs_reentrant">FF_FS_REENTRANT</a></tt>. In this case, also the OS dependent synchronization control functions, <tt>ff_cre_syncobj/ff_del_syncobj/ff_req_grant/ff_rel_grant</tt>, need to be added to the project. There are some examples in the <tt>ffsystem.c</tt>. When a file function is called while the volume is being accessed by another task, the file function to the volume will be suspended until that task leaves the file function. If the wait time exceeded a period defined by <tt>FF_TIMEOUT</tt>, the file function will abort with <tt>FR_TIMEOUT</tt>. The timeout function might not be supported on the some RTOSs.</p>
|
||||||
<p>There is an exception on the re-entrancy for <tt>f_mount/f_mkfs</tt> function. These volume management functions are not re-entrant to the same volume. When use these functions, other tasks need to avoid to access the volume.</p>
|
<p>There is an exception on the re-entrancy for <tt>f_mount/f_mkfs</tt> function. These volume management functions are not re-entrant to the same volume. When use these functions, other tasks need to avoid to access the volume.</p>
|
||||||
<p>Remarks: This section describes on the re-entrancy of the FatFs module itself. The <tt>FF_FS_REENTRANT</tt> option enables only exclusive use of each filesystem objects and FatFs never prevents to re-enter <tt>disk_*()</tt> functions. Thus the low level disk I/O layer must be always thread-safe when FatFs API is re-entered for different volumes.</p>
|
<p>Remarks: This section describes on the re-entrancy of the FatFs module itself. The <tt>FF_FS_REENTRANT</tt> option enables only exclusive use of each filesystem objects and FatFs never prevents to re-enter <tt>disk_*()</tt> functions. Thus the low level disk I/O layer must be always thread-safe when FatFs API is re-entered for different volumes.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="para doc" id="dup">
|
<div class="para doc" id="dup">
|
||||||
<h3>Duplicated File Open</h3>
|
<h3>Duplicated File Open</h3>
|
||||||
<p>FatFs module does not support the read/write collision control of duplicated open to a file. The duplicated open is permitted only when each of open method to a file is read mode. The duplicated open with one or more write mode to a file is always prohibited, and also open file must not be renamed or deleted. A violation of these rules can cause data colluption.</p>
|
<p>FatFs module does not support the read/write collision control of duplicated open to a file. The duplicated open is permitted only when each of open method to a file is read mode. The duplicated open with one or more write mode to a file is always prohibited, and also open file must not be renamed or deleted. A violation of these rules can cause data collaption.</p>
|
||||||
<p>The file lock control can be enabled by <tt><a href="config.html#fs_lock">FF_FS_LOCK</a></tt> option. The value of option defines the number of open objects to manage simultaneously. In this case, if any open, rename or remove that violating the file shareing rule that described above is attempted, the file function will rejected with <tt>FR_LOCKED</tt>. If number of open objects, files and sub-directories, is equal to <tt>FF_FS_LOCK</tt>, an extra <tt>f_open/f_opendir</tt> function will fail with <tt>FR_TOO_MANY_OPEN_FILES</tt>.</p>
|
<p>The file lock control can be enabled by <tt><a href="config.html#fs_lock">FF_FS_LOCK</a></tt> option. The value of option defines the number of open objects to manage simultaneously. In this case, if any opening, renaming or removing against the file shareing rule that described above is attempted, the file function will be rejected with <tt>FR_LOCKED</tt>. If number of open objects, files and sub-directories, is equal to <tt>FF_FS_LOCK</tt>, an extra <tt>f_open/f_opendir</tt> function will fail with <tt>FR_TOO_MANY_OPEN_FILES</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="para doc" id="fs1">
|
<div class="para doc" id="fs1">
|
||||||
<h3>Performance Effective File Access</h3>
|
<h3>Performance Effective File Access</h3>
|
||||||
<p>For good read/write throughput on the small embedded systems with limited size of memory, application programmer should consider what process is done in the FatFs module. The file data on the volume is transferred in following sequence by <tt>f_read</tt> function.</p>
|
<p>For good read/write throughput on the small embedded systems with limited size of memory, application programmer should consider what process is done in the FatFs module. The file data on the volume is transferred in following sequence by <tt>f_read</tt> function.</p>
|
||||||
<p>Figure 1. Sector misaligned read (short)<br>
|
<p>Figure 1. Sector unaligned read (short)<br>
|
||||||
<img src="../res/f1.png" width="490" height="110" alt="">
|
<img src="../res/f1.png" width="490" height="110" alt="">
|
||||||
</p>
|
</p>
|
||||||
<p>Figure 2. Sector misaligned read (long)<br>
|
<p>Figure 2. Sector unaligned read (long)<br>
|
||||||
<img src="../res/f2.png" width="490" height="140" alt="">
|
<img src="../res/f2.png" width="490" height="140" alt="">
|
||||||
</p>
|
</p>
|
||||||
<p>Figure 3. Fully sector aligned read<br>
|
<p>Figure 3. Fully sector aligned read<br>
|
||||||
<img src="../res/f3.png" width="490" height="119" alt="">
|
<img src="../res/f3.png" width="490" height="119" alt="">
|
||||||
</p>
|
</p>
|
||||||
<p>The file I/O buffer is a sector buffer to read/write a part of data on the sector. The sector buffer is either file private sector buffer on each file object or shared sector buffer in the filesystem object. The buffer configuration option <tt><a href="config.html#fs_tiny">FF_FS_TINY</a></tt> determins which sector buffer is used for the file data transfer. When tiny buffer configuration (1) is selected, data memory consumption is reduced <tt>FF_MAX_SS</tt> bytes each file object. In this case, FatFs module uses only a sector buffer in the filesystem object for file data transfer and FAT/directory access. The disadvantage of the tiny buffer configuration is: the FAT data cached in the sector buffer will be lost by file data transfer and it must be reloaded at every cluster boundary. However it will be suitable for most application from view point of the decent performance and low memory comsumption.</p>
|
<p>The file I/O buffer is a sector buffer to read/write a part of data on the sector. The sector buffer is either file private sector buffer on each file object or shared sector buffer in the filesystem object. The buffer configuration option <tt><a href="config.html#fs_tiny">FF_FS_TINY</a></tt> determins which sector buffer is used for the file data transfer. When tiny buffer configuration (1) is selected, data memory consumption is reduced <tt>FF_MAX_SS</tt> bytes each file object. In this case, FatFs module uses only a sector buffer in the filesystem object for file data transfer and FAT/directory access. The disadvantage of the tiny buffer configuration is: the FAT data cached in the sector buffer will be lost by file data transfer and it must be reloaded at every cluster boundary. However it will be suitable for most application from view point of the decent performance and low memory comsumption.</p>
|
||||||
<p>Figure 1 shows that a partial sector, sector misaligned part of the file, is transferred via the file I/O buffer. At long data transfer shown in Figure 2, middle of transfer data that covers one or more sector is transferred to the application buffer directly. Figure 3 shows that the case of entier transfer data is aligned to the sector boundary. In this case, file I/O buffer is not used. On the direct transfer, the maximum extent of sectors are read with <tt>disk_read</tt> function at a time but the multiple sector transfer is divided at cluster boundary even if it is contiguous.</p>
|
<p>Figure 1 shows that a partial sector, sector unaligned part of the file, is transferred via the file I/O buffer. At long data transfer shown in Figure 2, middle of transfer data that covers one or more sector is transferred to the application buffer directly. Figure 3 shows that the case of entier transfer data is aligned to the sector boundary. In this case, file I/O buffer is not used. On the direct transfer, the maximum extent of sectors are read with <tt>disk_read</tt> function at a time but the multiple sector transfer is divided at cluster boundary even if it is contiguous.</p>
|
||||||
<p>Therefore taking effort to sector aligned read/write accesss eliminates buffered data transfer and the read/write performance will be improved. Besides the effect, cached FAT data will not be flushed by file data transfer at the tiny configuration, so that it can achieve same performance as non-tiny configuration with small memory footprint.</p>
|
<p>Therefore taking effort to sector aligned read/write accesss eliminates buffered data transfer and the read/write performance will be improved. Besides the effect, cached FAT data will not be flushed by file data transfer at the tiny configuration, so that it can achieve same performance as non-tiny configuration with small memory footprint.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -211,7 +219,7 @@ And other options are left unchanged from original setting.
|
|||||||
Figure 6. Comparison between Multiple/Single Sector Write<br>
|
Figure 6. Comparison between Multiple/Single Sector Write<br>
|
||||||
<img src="../res/f6.png" width="630" height="148" alt="fig.6">
|
<img src="../res/f6.png" width="630" height="148" alt="fig.6">
|
||||||
</div>
|
</div>
|
||||||
<p>The write throughput of the flash memory media becomes the worst at single sector write transaction. The write throughput increases as the number of sectors per a write transaction as shown in Figure 6. This effect more appers at faster interface speed and the performance ratio often becomes grater than ten. <a href="../res/rwtest2.png">This graph</a> is clearly explaining how fast is multiple block write (W:16K, 32 sectors) than single block write (W:100, 1 sector), and also larger card tends to be slow at single block write. Number of write transactions also affects life time of the flash memory media. When compared at same amount of write data, the single sector write in Figure 6 above wears flash memory media 16 times more than multiple sector write in Figure 6 below. Single sector write is pretty pain for the flash memory media.</p>
|
<p>The write throughput of the flash memory media becomes the worst at single sector write transaction. The write throughput increases as the number of sectors per a write transaction as shown in Figure 6. This effect more appers at faster interface speed and the performance ratio often becomes grater than ten. <a href="../res/rwtest2.png">This result</a> is clearly explaining how fast is multiple block write (W:16K, 32 sectors) than single block write (W:100, 1 sector), and also larger card tends to be slow at single block write. Number of write transactions also affects life time of the flash memory media. When compared at same amount of write data, the single sector write in Figure 6 above wears flash memory media 16 times more than multiple sector write in Figure 6 below. Single sector write is pretty pain for the flash memory media.</p>
|
||||||
<p>Therefore the application program should write the data in large block as possible. The ideal write chunk size and alighment is size of sector, and size of cluster is the best. Of course all layers between the application and the storage device must have consideration on multiple sector write, however most of open-source memory card drivers lack it. Do not split a multiple sector write request into single sector write transactions or the write throughput gets poor. Note that FatFs module and its sample disk drivers supprt multiple sector read/write operation. </p>
|
<p>Therefore the application program should write the data in large block as possible. The ideal write chunk size and alighment is size of sector, and size of cluster is the best. Of course all layers between the application and the storage device must have consideration on multiple sector write, however most of open-source memory card drivers lack it. Do not split a multiple sector write request into single sector write transactions or the write throughput gets poor. Note that FatFs module and its sample disk drivers supprt multiple sector read/write operation. </p>
|
||||||
<h4>Forcing Memory Erase</h4>
|
<h4>Forcing Memory Erase</h4>
|
||||||
<p>When remove a file with <tt>f_unlink</tt> function, the data clusters occupied by the file are marked 'free' on the FAT. But the data sectors containing the file data are not that applied any process, so that the file data left occupies a part of the flash memory array as 'live block'. If the file data can be erased on removing the file, those data blocks will be turned into the free block pool. This may skip internal block erase operation to the data block on next write operation. As the result the write performance might be improved. FatFs can manage this function by setting <tt><a href="config.html#use_trim">FF_USE_TRIM</a></tt> to 1. Note that this is an expectation of internal process of the storage device and not that always effective. Most applications will not need this function. Also <tt>f_unlink</tt> function can take a time when remove a large file.</p>
|
<p>When remove a file with <tt>f_unlink</tt> function, the data clusters occupied by the file are marked 'free' on the FAT. But the data sectors containing the file data are not that applied any process, so that the file data left occupies a part of the flash memory array as 'live block'. If the file data can be erased on removing the file, those data blocks will be turned into the free block pool. This may skip internal block erase operation to the data block on next write operation. As the result the write performance might be improved. FatFs can manage this function by setting <tt><a href="config.html#use_trim">FF_USE_TRIM</a></tt> to 1. Note that this is an expectation of internal process of the storage device and not that always effective. Most applications will not need this function. Also <tt>f_unlink</tt> function can take a time when remove a large file.</p>
|
||||||
@@ -244,11 +252,12 @@ Figure 5. Minimized critical section<br>
|
|||||||
<h3>Extended Use of FatFs API</h3>
|
<h3>Extended Use of FatFs API</h3>
|
||||||
<p>These are examples of extended use of FatFs APIs. New item will be added whenever a useful code is found.</p>
|
<p>These are examples of extended use of FatFs APIs. New item will be added whenever a useful code is found.</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li><a href="../res/app1.c">Open or create a file for append</a> (for only R0.12 and earlier)</li>
|
<li><a href="http://elm-chan.org/fsw/ff/res/app1.c">Open or create a file for append</a> (for R0.12 and earlier)</li>
|
||||||
<li><a href="../res/app2.c">Empty a directory</a></li>
|
<li><a href="http://elm-chan.org/fsw/ff/res/app2.c">Delete a non-empty sub-directory</a> (for R0.12 and later)</li>
|
||||||
<li><a href="../res/app3.c">Allocate contiguous area to the file</a> (for only R0.11a and earlier)</li>
|
<li><a href="http://elm-chan.org/fsw/ff/res/app3.c">Allocate contiguous area to the file</a> (for R0.11a and earlier)</li>
|
||||||
<li><a href="../res/app4.c">Compatibility checker for low level disk I/O module</a></li>
|
<li><a href="http://elm-chan.org/fsw/ff/res/app4.c">Compatibility checker for low level disk I/O module</a></li>
|
||||||
<li><a href="../res/mkfatimg.zip">FAT image creator</a></li>
|
<li><a href="http://elm-chan.org/fsw/ff/res/mkfatimg.zip">FAT volume image creator</a></li>
|
||||||
|
<li><a href="http://elm-chan.org/fsw/ff/res/app5.c">Test if the file is contiguous or not</a></li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/chdir.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/chdir.html">
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<div class="para func">
|
<div class="para func">
|
||||||
<h2>f_chdir</h2>
|
<h2>f_chdir</h2>
|
||||||
<p>The f_chdir function changes the current directory of a drive.</p>
|
<p>The <tt>f_chdir</tt> function changes the current directory of the logical drive.</p>
|
||||||
<pre>
|
<pre>
|
||||||
FRESULT f_chdir (
|
FRESULT f_chdir (
|
||||||
const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] Path name */</span>
|
const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] Path name */</span>
|
||||||
@@ -50,24 +50,31 @@ FRESULT f_chdir (
|
|||||||
|
|
||||||
<div class="para desc">
|
<div class="para desc">
|
||||||
<h4>Description</h4>
|
<h4>Description</h4>
|
||||||
<p>The <tt>f_chdir</tt> function changes the current directory of the logical drive. The current directory of a drive is set to the root directory when the drive is mounted. Note that the current directory is retained in the each file system object, so that it also affects other tasks that use the volume.</p>
|
<p>The <tt>f_chdir</tt> function changes the current directory of the logical drive. Also the current drive is changed at Unix style volume ID, <tt><a href="config.html#str_volume_id">FF_STR_VOLUME_ID</a> == 2</tt>. The current directory of each logical drive is initialized to the root directory on mount.</p>
|
||||||
|
<p>Note that the current directory is retained in the each file system object and the current drive is retained in a static variable, so that it also affects other tasks that use the file functions.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_FS_RPATH >= 1</tt>.</p>
|
<p>Available when <tt><a href="config.html#fs_rpath">FF_FS_RPATH</a> >= 1</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="para use">
|
<div class="para use">
|
||||||
<h4>Example</h4>
|
<h4>Example</h4>
|
||||||
<pre>
|
<pre>
|
||||||
<span class="c">/* Change current direcoty of the current drive ('dir1' under root directory) */</span>
|
<span class="c">/* Change current direcoty of the current drive ("dir1" under root directory) */</span>
|
||||||
<em>f_chdir</em>("/dir1");
|
<em>f_chdir</em>("/dir1");
|
||||||
|
|
||||||
<span class="c">/* Change current direcoty of drive 2 (parent directory) */</span>
|
<span class="c">/* Change current direcoty of current drive (parent directory of drive 2) */</span>
|
||||||
<em>f_chdir</em>("2:..");
|
<em>f_chdir</em>("2:..");
|
||||||
|
|
||||||
|
<span class="c">/* Change current direcoty of the drive "sdcard" (at DOS/Windows style volume ID) */</span>
|
||||||
|
<em>f_chdir</em>("sdcard:/dir1");
|
||||||
|
|
||||||
|
<span class="c">/* Change current direcoty of the drive "flash" and set it as current drive (at Unix style volume ID) */</span>
|
||||||
|
<em>f_chdir</em>("/flash/dir1");
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/chdrive.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/chdrive.html">
|
||||||
@@ -41,22 +41,23 @@ FRESULT f_chdrive (
|
|||||||
|
|
||||||
<div class="para desc">
|
<div class="para desc">
|
||||||
<h4>Description</h4>
|
<h4>Description</h4>
|
||||||
<p>The <tt>f_chdrive</tt> function changes the current drive. The initial value of the current drive number is 0. Note that the current drive is retained in a static variable so that it also affects other tasks that using the file functions.</p>
|
<p>The <tt>f_chdrive</tt> function changes only the current drive. The initial value of the current drive number is 0. Note that the current drive is retained in a static variable, so that it also affects other tasks that using the file functions.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_FS_RPATH >= 1</tt> and <tt>FF_VOLUMES >= 2</tt>.</p>
|
<p>Available when <tt><a href="config.html#fs_rpath">FF_FS_RPATH</a> >= 1</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="para use">
|
<div class="para use">
|
||||||
<h4>Example</h4>
|
<h4>Example</h4>
|
||||||
<pre>
|
<pre>
|
||||||
<em>f_chdrive</em>("2:"); <span class="c">/* Set current drive to drive 2 */</span>
|
<em>f_chdrive</em>("2:"); <span class="c">/* Set drive 2 as current drive */</span>
|
||||||
|
|
||||||
<em>f_chdrive</em>(""); <span class="c">/* No effect (set current drive to current drive) */</span>
|
<em>f_chdrive</em>(""); <span class="c">/* No effect (set current drive as current drive) */</span>
|
||||||
|
|
||||||
|
<em>f_chdrive</em>("/flash"); <span class="c">/* Set drive "flash" as current drive (at Unix style volume ID) */</span>
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/chmod.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/chmod.html">
|
||||||
@@ -72,7 +72,7 @@ FRESULT f_chmod (
|
|||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_FS_READONLY == 0</tt> and <tt>FF_USE_CHMOD == 1</tt>.</p>
|
<p>Available when <tt><a href="config.html#fs_readonly">FF_FS_READONLY</a> == 0</tt> and <tt><a href="config.html#use_chmod">FF_USE_CHMOD</a> == 1</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/close.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/close.html">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/close.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/close.html">
|
||||||
@@ -50,7 +50,7 @@ FRESULT f_closedir (
|
|||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_FS_MINIMIZE <= 1</tt>.</p>
|
<p>Available when <tt><a href="config.html#fs_minimize">FF_FS_MINIMIZE</a> <= 1</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+51
-21
@@ -33,6 +33,7 @@
|
|||||||
<li><a href="#use_lfn">FF_USE_LFN</a></li>
|
<li><a href="#use_lfn">FF_USE_LFN</a></li>
|
||||||
<li><a href="#max_lfn">FF_MAX_LFN</a></li>
|
<li><a href="#max_lfn">FF_MAX_LFN</a></li>
|
||||||
<li><a href="#lfn_unicode">FF_LFN_UNICODE</a></li>
|
<li><a href="#lfn_unicode">FF_LFN_UNICODE</a></li>
|
||||||
|
<li><a href="#lfn_buf">FF_LFN_BUF, FF_SFN_BUF</a></li>
|
||||||
<li><a href="#strf_encode">FF_STRF_ENCODE</a></li>
|
<li><a href="#strf_encode">FF_STRF_ENCODE</a></li>
|
||||||
<li><a href="#fs_rpath">FF_FS_RPATH</a></li>
|
<li><a href="#fs_rpath">FF_FS_RPATH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -115,10 +116,10 @@
|
|||||||
<h3>Namespace and Locale Configurations</h3>
|
<h3>Namespace and Locale Configurations</h3>
|
||||||
|
|
||||||
<h4 id="code_page">FF_CODE_PAGE</h4>
|
<h4 id="code_page">FF_CODE_PAGE</h4>
|
||||||
<p>This option specifies the OEM code page to be used on the target system. Incorrect setting of the code page can cause a file open failure. If any non-ASCII character is not used at all, there is no difference between any code pages.</p>
|
<p>This option specifies the OEM code page to be used on the target system. Incorrect setting of the code page can cause a file open failure. If any non-ASCII character is not used for the path name, there is no difference between any code page settings. Set it 437 anyway.</p>
|
||||||
<table class="lst1">
|
<table class="lst1">
|
||||||
<tr><th>Value</th><th>Code page</th></tr>
|
<tr><th>Value</th><th>Code page</th></tr>
|
||||||
<tr><td>0</td><td>Include all code pages below and set by <tt>f_setcp()</tt></td></tr>
|
<tr><td>0</td><td>Includes all code pages below and set by <tt>f_setcp()</tt></td></tr>
|
||||||
<tr><td>437</td><td>U.S.</td></tr>
|
<tr><td>437</td><td>U.S.</td></tr>
|
||||||
<tr><td>720</td><td>Arabic</td></tr>
|
<tr><td>720</td><td>Arabic</td></tr>
|
||||||
<tr><td>737</td><td>Greek</td></tr>
|
<tr><td>737</td><td>Greek</td></tr>
|
||||||
@@ -143,7 +144,7 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h4 id="use_lfn">FF_USE_LFN</h4>
|
<h4 id="use_lfn">FF_USE_LFN</h4>
|
||||||
<p>This option switches the support for long file name (LFN). When enable the LFN, Unicode support functions <tt>ffunicode.c</tt> need to be added to the project. The working buffer for LFN occupies <tt>(FF_MAX_LFN + 1) * 2</tt> bytes and additional <tt>((FF_MAX_LFN + 44) / 15 * 32</tt> bytes when exFAT enabled. When use stack for the working buffer, take care on stack overflow. When use heap memory for the working buffer, memory management functions, <tt>ff_memalloc</tt> and <tt>ff_memfree</tt>, need to be added to the project.</p>
|
<p>This option switches the support for long file name (LFN). When enable the LFN, Unicode support module <tt>ffunicode.c</tt> need to be added to the project. When use stack for the working buffer, take care on stack overflow. When use heap memory for the working buffer, memory management functions (<tt>ff_memalloc</tt> and <tt>ff_memfree</tt>) need to be added to the project.</p>
|
||||||
<table class="lst1">
|
<table class="lst1">
|
||||||
<tr><th>Value</th><th>Description</th></tr>
|
<tr><th>Value</th><th>Description</th></tr>
|
||||||
<tr><td>0</td><td>Disable LFN. Path name in only 8.3 format can be used.</td></tr>
|
<tr><td>0</td><td>Disable LFN. Path name in only 8.3 format can be used.</td></tr>
|
||||||
@@ -153,19 +154,38 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h4 id="max_lfn">FF_MAX_LFN</h4>
|
<h4 id="max_lfn">FF_MAX_LFN</h4>
|
||||||
<p>This option defines the size of LFN working buffer from 12 to 255 in unit of character. This option has no effect when LFN is disabled.</p>
|
<p>LFN function requiers certain internal working buffer for the file name. This option defines size of the buffer and the value can be in range of 12 to 255 in UTF-16 encoding unit of the LFN. The buffer occupies <tt>(FF_MAX_LFN + 1) * 2</tt> bytes and additional <tt>(FF_MAX_LFN + 44) / 15 * 32</tt> bytes when exFAT is enabled. It is recommended to be set 255 to fully support the LFN specification. This option has no effect when LFN is not enabled.</p>
|
||||||
|
|
||||||
<h4 id="lfn_unicode">FF_LFN_UNICODE</h4>
|
<h4 id="lfn_unicode">FF_LFN_UNICODE</h4>
|
||||||
<p>This option switches character encoding on the API, ANSI/OEM (0) or Unicode in UTF-16 (1). To use Unicode string for the path name, enable LFN and set this option to 1. This option also affects behavior of string I/O functions. When LFN is disabled, this option has no effect. For more information, read <a href="filename.html#uni">here</a>.</p>
|
<p>This option switches character encoding for the file name on the API. When Unicode is selected, <tt>FF_CODE_PAGE</tt> has actually no meaning except for compatibility with legacy systems, such as MS-DOS and any system without support for LFN. FatFs supports the code point upto U+10FFFF.</p>
|
||||||
|
<table class="lst2">
|
||||||
|
<tr><th>Value</th><th>Character Encoding</th><th><tt>TCHAR</tt></th></tr>
|
||||||
|
<tr><td>0</td><td>ANSI/OEM in current CP</td><td>char</td></tr>
|
||||||
|
<tr><td>1</td><td>Unicode in UTF-16</td><td>WCHAR</td></tr>
|
||||||
|
<tr><td>2</td><td>Unicode in UTF-8</td><td>char</td></tr>
|
||||||
|
<tr><td>3</td><td>Unicode in UTF-32</td><td>DWORD</td></tr>
|
||||||
|
</table>
|
||||||
|
<p>This option also affects behavior of string I/O functions (see <tt>FF_STRF_ENCODE</tt>). When LFN is not enabled, this option has no effect and FatFs works at ANSI/OEM code on the API. For more information, read <a href="filename.html#uni">here</a>.</p>
|
||||||
|
|
||||||
|
<h4 id="lfn_buf">FF_LFN_BUF, FF_SFN_BUF</h4>
|
||||||
|
<p>This set of options defines size of file name members, <tt>fname[]</tt> and <tt>altname[]</tt>, in the <tt><a href="sfileinfo.html">FILINFO</a></tt> structure which is used to read out the directory items. These values should be suffcient for the file names to read. The maximum possible length of read file name depends on the character encoding on the API as follows:</p>
|
||||||
|
<table class="lst2">
|
||||||
|
<tr><th>Encoding</th><th>LFN length</th><th>SFN length</th></tr>
|
||||||
|
<tr><td>ANSI/OEM at SBCS</td><td>255 items</td><td>12 items</td></tr>
|
||||||
|
<tr><td>ANSI/OEM at DBCS</td><td>510 items</td><td>12 items</td></tr>
|
||||||
|
<tr><td>Unicode in UTF-16/32</td><td>255 items</td><td>12 items</td></tr>
|
||||||
|
<tr><td>Unicode in UTF-8</td><td>765 items</td><td>34 items</td></tr>
|
||||||
|
</table>
|
||||||
|
<p>If the size of name member is insufficient for the LFN, the item is treated as without LFN. When LFN is not enabled, these options have no effect.</p>
|
||||||
|
|
||||||
<h4 id="strf_encode">FF_STRF_ENCODE</h4>
|
<h4 id="strf_encode">FF_STRF_ENCODE</h4>
|
||||||
<p>When Unicode API is selected by <tt>FF_LFN_UNICODE = 1</tt>, string I/O functions, <tt>f_gets</tt>, <tt>f_putc</tt>, <tt>f_puts</tt> and <tt>f_printf</tt> convert the character encodins in it. This option defines the assumption of character encoding <em>on the file</em> to be read/written via those functions. When Unicode API is not selected, the string functions work without any conversion and this option has no effect.</p>
|
<p>When character encoding on the API is Unicode (<tt>FF_LFN_UNICODE >= 1</tt>), string I/O functions, <tt>f_gets</tt>, <tt>f_putc</tt>, <tt>f_puts</tt> and <tt>f_printf</tt>, convert the character encoding in it. This option defines the assumption of character encoding <em>on the file</em> to be read/written via those functions. When LFN is not enabled or <tt>FF_LFN_UNICODE == 0</tt>, the string functions work without any encoding conversion and this option has no effect.</p>
|
||||||
<table class="lst1">
|
<table class="lst2">
|
||||||
<tr><th>Value</th><th>Description</th></tr>
|
<tr><th>Value</th><th>Character encoding on the file</th></tr>
|
||||||
<tr><td>0</td><td>ANSI/OEM</td></tr>
|
<tr><td>0</td><td>ANSI/OEM in current code page</td></tr>
|
||||||
<tr><td>1</td><td>UTF-16LE</td></tr>
|
<tr><td>1</td><td>Unicode in UTF-16LE</td></tr>
|
||||||
<tr><td>2</td><td>UTF-16BE</td></tr>
|
<tr><td>2</td><td>Unicode in UTF-16BE</td></tr>
|
||||||
<tr><td>3</td><td>UTF-8</td></tr>
|
<tr><td>3</td><td>Unicode in UTF-8</td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h4 id="fs_rpath">FF_FS_RPATH</h4>
|
<h4 id="fs_rpath">FF_FS_RPATH</h4>
|
||||||
@@ -184,13 +204,23 @@
|
|||||||
<h3>Volume/Drive Configurations</h3>
|
<h3>Volume/Drive Configurations</h3>
|
||||||
|
|
||||||
<h4 id="volumes">FF_VOLUMES</h4>
|
<h4 id="volumes">FF_VOLUMES</h4>
|
||||||
<p>This option configures number of volumes (logical drives, from 1 to 10) to be used.</p>
|
<p>This option configures number of volumes (logical drives upto 10) to be used.</p>
|
||||||
|
|
||||||
<h4 id="str_volume_id">FF_STR_VOLUME_ID</h4>
|
<h4 id="str_volume_id">FF_STR_VOLUME_ID</h4>
|
||||||
<p>Disable (0) or Enable (1). This option switches the support for string volume ID. When enabled, also pre-defined strings in <tt>FF_VOLUME_STRS</tt> can be used as drive identifier in the path name.</p>
|
<p>This option switches the support for string volume ID. When arbitrary string for the volume ID is enabled for the drive prefix, also pre-defined strings by <tt>FF_VOLUME_STRS</tt> or user defined strings can be used as drive prefix in the path name. Numeric drive number is always valid regardless of this option, and also either format of drive prefix can be enabled by this option.</p>
|
||||||
|
<table class="lst2">
|
||||||
|
<tr><th>Value</th><th>Description</th><th>Example</th></tr>
|
||||||
|
<tr><td>0</td><td>Only DOS/Windows style drive prefix in numeric ID can be used.</td><td>0:/filename</td></tr>
|
||||||
|
<tr><td>1</td><td>Also DOS/Windows style drive prefix in string ID can be used.</td><td>flash:/filename</td></tr>
|
||||||
|
<tr><td>2</td><td>Also Unix style drive prefix in string ID can be used.</td><td>/flash/filename</td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
<h4 id="volume_strs">FF_VOLUME_STRS</h4>
|
<h4 id="volume_strs">FF_VOLUME_STRS</h4>
|
||||||
<p>This option defines the drive ID strings for each logical drives. Number of items must not be less than <tt>FF_VOLUMES</tt>. Valid characters for the drive ID string are: A-Z and 0-9.</p>
|
<p>This option defines the volume ID strings for each logical drives. Number of items must not be less than <tt>FF_VOLUMES</tt>. Valid characters for the volume ID string are A-Z, a-z and 0-9, however, they are compared in case-insensitive. If <tt>FF_STR_VOLUME_ID == 0</tt>, this option has no effect. If <tt>FF_STR_VOLUME_ID >= 1</tt> and this option is not defined, a user defined volume string table needs to be defined as shown below. The table should not be modified on the fly.</p>
|
||||||
|
<pre>
|
||||||
|
<span class="c">/* User defined volume ID strings for 0: 1: 2: 3: ... */</span>
|
||||||
|
const char* VolumeStr[FF_VOLUMES] = {"ram","flash","sdc","usb"};
|
||||||
|
</pre>
|
||||||
|
|
||||||
<h4 id="multi_partition">FF_MULTI_PARTITION</h4>
|
<h4 id="multi_partition">FF_MULTI_PARTITION</h4>
|
||||||
<p>Disable (0) or Enable (1). This option switches multi-partition function. By default (0), each logical drive number is bound to the same physical drive number and only a volume in the physical drive is mounted. When enabled, each logical drive is bound to the partition on the physical drive listed in the user defined partition resolution table <tt>VolToPart[]</tt>. Also <tt>f_fdisk</tt> funciton will be available. For more information, read <a href="filename.html#vol">here</a>.</p>
|
<p>Disable (0) or Enable (1). This option switches multi-partition function. By default (0), each logical drive number is bound to the same physical drive number and only a volume in the physical drive is mounted. When enabled, each logical drive is bound to the partition on the physical drive listed in the user defined partition resolution table <tt>VolToPart[]</tt>. Also <tt>f_fdisk</tt> funciton will be available. For more information, read <a href="filename.html#vol">here</a>.</p>
|
||||||
@@ -221,13 +251,13 @@
|
|||||||
<p>Normal (0) or Tiny (1). At the tiny configuration, size of the file object <tt>FIL</tt> is reduced <tt>FF_MAX_SS</tt> bytes. Instead of private data buffer eliminated from the file object, common sector buffer in the filesystem object <tt>FATFS</tt> is used for the file data transfer.</p>
|
<p>Normal (0) or Tiny (1). At the tiny configuration, size of the file object <tt>FIL</tt> is reduced <tt>FF_MAX_SS</tt> bytes. Instead of private data buffer eliminated from the file object, common sector buffer in the filesystem object <tt>FATFS</tt> is used for the file data transfer.</p>
|
||||||
|
|
||||||
<h4 id="fs_exfat">FF_FS_EXFAT</h4>
|
<h4 id="fs_exfat">FF_FS_EXFAT</h4>
|
||||||
<p>This option switches support for the exFAT filesystem in addition to the FAT/FAT32 filesystem, Enabled(1) or Disabled(0). To enable this feature, also LFN must be enabled and configureing <tt>FF_LFN_UNICODE = 1</tt> and <tt>FF_MAX_LFN = 255</tt> is recommended for full-featured exFAT function. Note that enabling exFAT discards ANSI C (C89) compatibility because of need for 64-bit integer type.</p>
|
<p>This option switches support for the exFAT filesystem in addition to the FAT/FAT32 filesystem, Enabled (1) or Disabled (0). To enable exFAT, also LFN must be enabled and configureing <tt>FF_LFN_UNICODE >= 1</tt> and <tt>FF_MAX_LFN == 255</tt> is recommended for full-featured exFAT function. Note that enabling exFAT discards ANSI C (C89) compatibility because of need for 64-bit integer type.</p>
|
||||||
|
|
||||||
<h4 id="fs_nortc">FF_FS_NORTC</h4>
|
<h4 id="fs_nortc">FF_FS_NORTC</h4>
|
||||||
<p>Use RTC (0) or Do not use RTC (1). This option controls timestamp function. If the system does not have an RTC function or valid timestamp is not needed, set <tt>FF_FS_NORTC</tt> to 1 to disable the timestamp function. Any object modified by FatFs will have a fixed timestamp defined by <tt>FF_NORTC_MON</tt>, <tt>FF_NORTC_MDAY</tt> and <tt>FF_NORTC_YEAR</tt>. To use the timestamp function, set <tt>FF_FS_NORTC = 0</tt> and add <tt>get_fattime</tt> function to the project to get the current time form real-time clock. This option has no effect at read-only configuration.</p>
|
<p>Use RTC (0) or Do not use RTC (1). This option controls timestamp function. If the system does not have any RTC function or valid timestamp is not needed, set <tt>FF_FS_NORTC</tt> to 1 to disable the timestamp function. Every objects modified by FatFs will have a fixed timestamp defined by <tt>FF_NORTC_MON</tt>, <tt>FF_NORTC_MDAY</tt> and <tt>FF_NORTC_YEAR</tt>. To use the timestamp function, set <tt>FF_FS_NORTC == 0</tt> and add <tt>get_fattime</tt> function to the project to get current time form the RTC. This option has no effect at read-only configuration.</p>
|
||||||
|
|
||||||
<h4 id="nortc_time">FF_NORTC_MON, FF_NORTC_MDAY, FF_NORTC_YEAR</h4>
|
<h4 id="nortc_time">FF_NORTC_MON, FF_NORTC_MDAY, FF_NORTC_YEAR</h4>
|
||||||
<p>This set of options defines the time to be used at no RTC systems. This option has no effect at read-only configuration or <tt>FF_FS_NORTC = 0</tt>.</p>
|
<p>This set of options defines the time to be used at no RTC systems. This option has no effect at read-only configuration or <tt>FF_FS_NORTC == 0</tt>.</p>
|
||||||
|
|
||||||
<h4 id="fs_lock">FF_FS_LOCK</h4>
|
<h4 id="fs_lock">FF_FS_LOCK</h4>
|
||||||
<p>This option switches file lock function to control duplicated file open and illegal operations to open objects. Note that the file lock function is independent of re-entrancy. This option must be 0 at read-only configuration.</p>
|
<p>This option switches file lock function to control duplicated file open and illegal operations to open objects. Note that the file lock function is independent of re-entrancy. This option must be 0 at read-only configuration.</p>
|
||||||
@@ -238,13 +268,13 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h4 id="fs_reentrant">FF_FS_REENTRANT</h4>
|
<h4 id="fs_reentrant">FF_FS_REENTRANT</h4>
|
||||||
<p>Disable (0) or Enable (1). This option switches the re-entrancy (thread safe) of the FatFs module itself. Note that file/directory access to the different volume is always re-entrant and it can work simultaneously regardless of this option but volume control functions. <tt>f_mount</tt>, <tt>f_mkfs</tt> and <tt>f_fdisk</tt>, are always not re-entrant. Only file/directory access to the same volume, in other words, exclusive use of each filesystem object, is under control of this function. To enable this feature, also user provided synchronization handlers, <tt>ff_req_grant</tt>, <tt>ff_rel_grant</tt>, <tt>ff_del_syncobj</tt> and <tt>ff_cre_syncobj</tt>, need to be added to the project. Sample code is available in <tt>ffsystem.c</tt>.</p>
|
<p>Disable (0) or Enable (1). This option switches the re-entrancy (thread safe) of the FatFs module itself. Note that file/directory access to the different volume is always re-entrant and it can work simultaneously regardless of this option, however, volume management functions, <tt>f_mount</tt>, <tt>f_mkfs</tt> and <tt>f_fdisk</tt>, are always not re-entrant. Only file/directory access to the same volume, in other words, exclusive use of each filesystem object, is under control of this function. To enable this feature, also user provided synchronization handlers, <tt>ff_req_grant</tt>, <tt>ff_rel_grant</tt>, <tt>ff_del_syncobj</tt> and <tt>ff_cre_syncobj</tt>, need to be added to the project. Sample code is available in <tt>ffsystem.c</tt>.</p>
|
||||||
|
|
||||||
<h4 id="fs_timeout">FF_FS_TIMEOUT</h4>
|
<h4 id="fs_timeout">FF_FS_TIMEOUT</h4>
|
||||||
<p>Number of time ticks to abort the file function with <tt>FR_TIMEOUT</tt> when wait time is too long. This option has no effect when <tt>FF_FS_REENTRANT = 0</tt>.</p>
|
<p>Number of time ticks to abort the file function with <tt>FR_TIMEOUT</tt> when wait time is too long. This option has no effect when <tt>FF_FS_REENTRANT == 0</tt>.</p>
|
||||||
|
|
||||||
<h4 id="sync_t">FF_SYNC_t</h4>
|
<h4 id="sync_t">FF_SYNC_t</h4>
|
||||||
<p>This option defines O/S dependent sync object type. e.g. <tt>HANDLE</tt>, <tt>ID</tt>, <tt>OS_EVENT*</tt>, <tt>SemaphoreHandle_t</tt> and etc. A header file for O/S definitions needs to be included somewhere in the scope of <tt>ff.c</tt>. This option has no effect when <tt>FF_FS_REENTRANT = 0</tt>.</p>
|
<p>This option defines O/S dependent sync object type. e.g. <tt>HANDLE</tt>, <tt>ID</tt>, <tt>OS_EVENT*</tt>, <tt>SemaphoreHandle_t</tt> and etc. A header file for O/S definitions needs to be included somewhere in the scope of <tt>ff.c</tt>. This option has no effect when <tt>FF_FS_REENTRANT == 0</tt>.</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/dinit.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/dinit.html">
|
||||||
|
|||||||
+11
-10
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/dioctl.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/dioctl.html">
|
||||||
@@ -31,7 +31,7 @@ DRESULT disk_ioctl (
|
|||||||
<dt>cmd</dt>
|
<dt>cmd</dt>
|
||||||
<dd>Command code.</dd>
|
<dd>Command code.</dd>
|
||||||
<dt>buff</dt>
|
<dt>buff</dt>
|
||||||
<dd>Pointer to the parameter depends on the command code. Do not care if no parameter to be passed.</dd>
|
<dd>Pointer to the parameter depends on the command code. Do not care if the command has no parameter to be passed.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -58,13 +58,13 @@ DRESULT disk_ioctl (
|
|||||||
<caption>Standard ioctl command used by FatFs</caption>
|
<caption>Standard ioctl command used by FatFs</caption>
|
||||||
<tr><th>Command</th><th>Description</th></tr>
|
<tr><th>Command</th><th>Description</th></tr>
|
||||||
<tr><td>CTRL_SYNC</td><td>Make sure that the device has finished pending write process. If the disk I/O module has a write back cache, the dirty buffers must be written back to the media immediately. Nothing to do for this command if each write operation to the media is completed within the <tt>disk_write</tt> function.</td></tr>
|
<tr><td>CTRL_SYNC</td><td>Make sure that the device has finished pending write process. If the disk I/O module has a write back cache, the dirty buffers must be written back to the media immediately. Nothing to do for this command if each write operation to the media is completed within the <tt>disk_write</tt> function.</td></tr>
|
||||||
<tr><td>GET_SECTOR_COUNT</td><td>Returns number of available sectors on the drive into the <tt>DWORD</tt> variable pointed by <tt class="arg">buff</tt>. This command is used in only <tt>f_mkfs</tt> and <tt>f_fdisk</tt> function to determine the volume/partition size to be created. Required at <tt>FF_USE_MKFS == 1</tt> or <tt>FF_MULTI_PARTITION == 1</tt>.</td></tr>
|
<tr><td>GET_SECTOR_COUNT</td><td>Returns number of available sectors on the drive into the <tt>DWORD</tt> variable pointed by <tt class="arg">buff</tt>. This command is used by <tt>f_mkfs</tt> and <tt>f_fdisk</tt> function to determine the volume/partition size to be created. Required at <tt>FF_USE_MKFS == 1</tt>.</td></tr>
|
||||||
<tr><td>GET_SECTOR_SIZE</td><td>Returns sector size of the device into the <tt>WORD</tt> variable pointed by <tt class="arg">buff</tt>. Valid return values for this command are 512, 1024, 2048 and 4096. This command is required only if <tt>FF_MAX_SS > FF_MIN_SS</tt>. When <tt>FF_MAX_SS == FF_MIN_SS</tt>, this command is never used and the device must work at that sector size.</td></tr>
|
<tr><td>GET_SECTOR_SIZE</td><td>Returns sector size of the device into the <tt>WORD</tt> variable pointed by <tt class="arg">buff</tt>. Valid return values for this command are 512, 1024, 2048 and 4096. This command is required only if <tt>FF_MAX_SS > FF_MIN_SS</tt>. When <tt>FF_MAX_SS == FF_MIN_SS</tt>, this command is never used and the device must work at that sector size.</td></tr>
|
||||||
<tr><td>GET_BLOCK_SIZE</td><td>Returns erase block size of the flash memory media in unit of sector into the <tt>DWORD</tt> variable pointed by <tt class="arg">buff</tt>. The allowable value is from 1 to 32768 in power of 2. Return 1 if the erase block size is unknown or non flash memory media. This command is used by only <tt>f_mkfs</tt> function and it attempts to align data area on the erase block boundary. Required at <tt>FF_USE_MKFS == 1</tt>.</td></tr>
|
<tr><td>GET_BLOCK_SIZE</td><td>Returns erase block size of the flash memory media in unit of sector into the <tt>DWORD</tt> variable pointed by <tt class="arg">buff</tt>. The allowable value is 1 to 32768 in power of 2. Return 1 if the erase block size is unknown or non flash memory media. This command is used by only <tt>f_mkfs</tt> function and it attempts to align data area on the erase block boundary. Required at <tt>FF_USE_MKFS == 1</tt>.</td></tr>
|
||||||
<tr><td>CTRL_TRIM</td><td>Informs the device the data on the block of sectors is no longer needed and it can be erased. The sector block is specified by a <tt>DWORD</tt> array {<start sector>, <end sector>} pointed by <tt class="arg">buff</tt>. This is an identical command to Trim of ATA device. Nothing to do for this command if this funcion is not supported or not a flash memory device. FatFs does not check the result code and the file function is not affected even if the sector block was not erased well. This command is called on remove a cluster chain and in the <tt>f_mkfs</tt> function. Required at <tt>FF_USE_TRIM == 1</tt>.</td></tr>
|
<tr><td>CTRL_TRIM</td><td>Informs the device the data on the block of sectors is no longer needed and it can be erased. The sector block is specified by a <tt>DWORD</tt> array {<start sector>, <end sector>} pointed by <tt class="arg">buff</tt>. This is an identical command to Trim of ATA device. Nothing to do for this command if this funcion is not supported or not a flash memory device. FatFs does not check the result code and the file function is not affected even if the sector block was not erased well. This command is called on remove a cluster chain and in the <tt>f_mkfs</tt> function. Required at <tt>FF_USE_TRIM == 1</tt>.</td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<p>FatFs never uses any device dependent command nor user defined command. Following table shows an example of non-standard commands may be useful for some applications.</p>
|
<p>FatFs never uses any device dependent command nor user defined command. Following table shows an example of non-standard commands which may be useful for some applications.</p>
|
||||||
<table class="lst">
|
<table class="lst">
|
||||||
<caption>Example of optional ioctl command</caption>
|
<caption>Example of optional ioctl command</caption>
|
||||||
<tr><th>Command</th><th>Description</th></tr>
|
<tr><th>Command</th><th>Description</th></tr>
|
||||||
@@ -74,11 +74,12 @@ DRESULT disk_ioctl (
|
|||||||
<tr><td>CTRL_LOCK</td><td>Lock media eject mechanism.</td></tr>
|
<tr><td>CTRL_LOCK</td><td>Lock media eject mechanism.</td></tr>
|
||||||
<tr><td>CTRL_UNLOCK</td><td>Unlock media eject mechanism.</td></tr>
|
<tr><td>CTRL_UNLOCK</td><td>Unlock media eject mechanism.</td></tr>
|
||||||
<tr><td>CTRL_EJECT</td><td>Eject media cartridge. <tt>STA_NOINIT</tt> and <tt>STA_NODISK</tt> in status flag are set after the function succeeded.</td></tr>
|
<tr><td>CTRL_EJECT</td><td>Eject media cartridge. <tt>STA_NOINIT</tt> and <tt>STA_NODISK</tt> in status flag are set after the function succeeded.</td></tr>
|
||||||
|
<tr><td>CTRL_GET_SMART</td><td>Read SMART information.</td></tr>
|
||||||
<tr><td>MMC_GET_TYPE</td><td>Get card type. The type flags, bit0:MMCv3, bit1:SDv1, bit2:SDv2+ and bit3:LBA, is stored to a BYTE variable pointed by <tt class="arg">buff</tt>. (MMC/SDC specific command)</td></tr>
|
<tr><td>MMC_GET_TYPE</td><td>Get card type. The type flags, bit0:MMCv3, bit1:SDv1, bit2:SDv2+ and bit3:LBA, is stored to a BYTE variable pointed by <tt class="arg">buff</tt>. (MMC/SDC specific command)</td></tr>
|
||||||
<tr><td>MMC_GET_CSD</td><td>Get CSD register into a 16-byte buffer pointed by <tt class="arg">buff</tt>. (MMC/SDC specific command)</td></tr>
|
<tr><td>MMC_GET_CSD</td><td>Read CSD register into a 16-byte buffer pointed by <tt class="arg">buff</tt>. (MMC/SDC specific command)</td></tr>
|
||||||
<tr><td>MMC_GET_CID</td><td>Get CID register into a 16-byte buffer pointed by <tt class="arg">buff</tt>. (MMC/SDC specific command)</td></tr>
|
<tr><td>MMC_GET_CID</td><td>Read CID register into a 16-byte buffer pointed by <tt class="arg">buff</tt>. (MMC/SDC specific command)</td></tr>
|
||||||
<tr><td>MMC_GET_OCR</td><td>Get OCR register into a 4-byte buffer pointed by <tt class="arg">buff</tt>. (MMC/SDC specific command)</td></tr>
|
<tr><td>MMC_GET_OCR</td><td>Read OCR register into a 4-byte buffer pointed by <tt class="arg">buff</tt>. (MMC/SDC specific command)</td></tr>
|
||||||
<tr><td>MMC_GET_SDSTAT</td><td>Get SDSTATUS register into a 64-byte buffer pointed by <tt class="arg">buff</tt>. (SDC specific command)</td></tr>
|
<tr><td>MMC_GET_SDSTAT</td><td>Read SDSTATUS register into a 64-byte buffer pointed by <tt class="arg">buff</tt>. (SDC specific command)</td></tr>
|
||||||
<tr><td>ATA_GET_REV</td><td>Get the revision string into a 16-byte buffer pointed by <tt class="arg">buff</tt>. (ATA/CFC specific command)</td></tr>
|
<tr><td>ATA_GET_REV</td><td>Get the revision string into a 16-byte buffer pointed by <tt class="arg">buff</tt>. (ATA/CFC specific command)</td></tr>
|
||||||
<tr><td>ATA_GET_MODEL</td><td>Get the model string into a 40-byte buffer pointed by <tt class="arg">buff</tt>. (ATA/CFC specific command)</td></tr>
|
<tr><td>ATA_GET_MODEL</td><td>Get the model string into a 40-byte buffer pointed by <tt class="arg">buff</tt>. (ATA/CFC specific command)</td></tr>
|
||||||
<tr><td>ATA_GET_SN</td><td>Get the serial number string into a 20-byte buffer pointed by <tt class="arg">buff</tt>. (ATA/CFC specific command)</td></tr>
|
<tr><td>ATA_GET_SN</td><td>Get the serial number string into a 20-byte buffer pointed by <tt class="arg">buff</tt>. (ATA/CFC specific command)</td></tr>
|
||||||
@@ -91,7 +92,7 @@ DRESULT disk_ioctl (
|
|||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>The disk_ioctl function is not needed when <tt>FF_FS_READONLY == 1</tt> and <tt>FF_MAX_SS == FF_MIN_SS</tt>.</p>
|
<p>The disk_ioctl function is not needed when <tt><a href="config.html#fs_readonly">FF_FS_READONLY</a> == 1</tt> and <tt><a href="config.html#max_ss">FF_MAX_SS</a> == <a href="config.html#max_ss">FF_MIN_SS</a></tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/dread.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/dread.html">
|
||||||
@@ -45,7 +45,7 @@ DRESULT disk_read (
|
|||||||
<dt>RES_OK (0)</dt>
|
<dt>RES_OK (0)</dt>
|
||||||
<dd>The function succeeded.</dd>
|
<dd>The function succeeded.</dd>
|
||||||
<dt>RES_ERROR</dt>
|
<dt>RES_ERROR</dt>
|
||||||
<dd>A hard error occured during the read operation and could not recover it.</dd>
|
<dd>An unrecoverable hard error occured during the read operation.</dd>
|
||||||
<dt>RES_PARERR</dt>
|
<dt>RES_PARERR</dt>
|
||||||
<dd>Invalid parameter.</dd>
|
<dd>Invalid parameter.</dd>
|
||||||
<dt>RES_NOTRDY</dt>
|
<dt>RES_NOTRDY</dt>
|
||||||
@@ -56,12 +56,12 @@ DRESULT disk_read (
|
|||||||
|
|
||||||
<div class="para desc">
|
<div class="para desc">
|
||||||
<h4>Description</h4>
|
<h4>Description</h4>
|
||||||
<p>Read/write operation to the generic storage devices, such as memory card, hadddisk and optical disk, is done in unit of block of data bytes called <em>sector</em>. FatFs supports the sector size in range of from 512 to 4096 bytes. When FatFs is configured for fixed sector size (<tt>FF_MIN_SS == MAX_SS</tt>, this is the most case), the read/write function must work at that sector size. When FatFs is configured for variable sector size (<tt>FF_MIN_SS != MAX_SS</tt>), the sector size of medium is inquired with <tt>disk_ioctl</tt> function immediately following <tt>disk_initialize</tt> function.</p>
|
<p>Read/write operation to the generic storage devices, such as memory card, hadddisk and optical disk, is done in unit of block of data bytes called <em>sector</em>. FatFs supports the sector size in range of 512 to 4096 bytes. When FatFs is configured for fixed sector size (<tt>FF_MIN_SS == FF_MAX_SS</tt>, this is the most case), the read/write function must work at that sector size. When FatFs is configured for variable sector size (<tt>FF_MIN_SS < FF_MAX_SS</tt>), the sector size of medium is inquired with <tt>disk_ioctl</tt> function immediately following <tt>disk_initialize</tt> function succeeded.</p>
|
||||||
<p>The memory address specified by <tt class="arg">buff</tt> is not that always aligned to word boundary because the argument is defined as <tt>BYTE*</tt>. The unaligned read/write request can occure at <a href="appnote.html#fs1">direct transfer</a>. If the bus architecture, especially DMA controller, does not allow unaligned memory access, it should be solved in this function. There are some workarounds described below to avoid this issue.</p>
|
<p>The memory address specified by <tt class="arg">buff</tt> is not that always aligned to word boundary because the argument is defined as <tt>BYTE*</tt>. The unaligned read/write request can occure at <a href="appnote.html#fs1">direct transfer</a>. If the bus architecture, especially DMA controller, does not allow unaligned memory access, it should be solved in this function. There are some workarounds described below to avoid this issue.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Convert word transfer to byte transfer in this function if needed. - Recommended.</li>
|
<li>Convert word transfer to byte transfer in this function if needed. - Recommended.</li>
|
||||||
<li>On the <tt>f_read()</tt> calls, avoid long read request that includes a whole of sector. - Any direct transfer never occures.</li>
|
<li>On the <tt>f_read()</tt> calls, avoid long read request that includes a whole of sector. - Any direct transfer never occures.</li>
|
||||||
<li>On the <tt>f_read(fp, data, btw, bw)</tt> calls, make sure that <tt>(((UINT)data & 3) == (f_tell(fp) & 3))</tt> is true. - Word alignment of <tt class="arg">buff</tt> is guaranteed.</li>
|
<li>On the <tt>f_read(fp, dat, btw, bw)</tt> calls, make sure that <tt>(((UINT)dat & 3) == (f_tell(fp) & 3))</tt> is true. - Word alignment of <tt class="arg">buff</tt> is guaranteed.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>Generally, a multiple sector read request must not be split into single sector transactions to the storage device, or read throughput gets worse.</p>
|
<p>Generally, a multiple sector read request must not be split into single sector transactions to the storage device, or read throughput gets worse.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/dstat.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/dstat.html">
|
||||||
@@ -35,11 +35,11 @@ DSTATUS disk_status (
|
|||||||
<p>The current drive status is returned in combination of status flags described below. FatFs refers only <tt>STA_NOINIT</tt> and <tt>STA_PROTECT</tt>.</p>
|
<p>The current drive status is returned in combination of status flags described below. FatFs refers only <tt>STA_NOINIT</tt> and <tt>STA_PROTECT</tt>.</p>
|
||||||
<dl class="ret">
|
<dl class="ret">
|
||||||
<dt>STA_NOINIT</dt>
|
<dt>STA_NOINIT</dt>
|
||||||
<dd>Indicates that the device has not been initialized and not ready to work. This flag is set on system reset, media removal or failure of <tt>disk_initialize</tt> function. It is cleared on <tt>disk_initialize</tt> function succeeded. Any media change that occurs asynchronously must be captured and reflect it to the status flags, or auto-mount function will not work correctly. If the system does not support media change detection, application program needs to explicitly re-mount the volume with <tt>f_mount</tt> function after each media change.</dd>
|
<dd>Indicates that the device has not been initialized and not ready to work. This flag is set on system reset, media removal or failure of <a href="dinit.html"><tt>disk_initialize</tt></a> function. It is cleared on <tt>disk_initialize</tt> function succeeded. Any media change that occurs asynchronously must be captured and reflect it to the status flags, or auto-mount function will not work correctly. If the system does not support media change detection, application program needs to explicitly re-mount the volume with <tt>f_mount</tt> function after each media change.</dd>
|
||||||
<dt>STA_NODISK</dt>
|
<dt>STA_NODISK</dt>
|
||||||
<dd>Indicates that no medium in the drive. This is always cleared at fixed disk drive. Note that FatFs does not refer this flag.</dd>
|
<dd>Indicates that no medium in the drive. This is always cleared at fixed disk drive. Note that FatFs does not refer this flag.</dd>
|
||||||
<dt>STA_PROTECT</dt>
|
<dt>STA_PROTECT</dt>
|
||||||
<dd>Indicates that the medium is write protected. This is always cleared at the drives without write protect function. Not valid if no medium in the drive.</dd>
|
<dd>Indicates that the medium is write protected. This is always cleared at the drives without write protect function. Not valid if <tt>STA_NODISK</tt> is set.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/dwrite.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/dwrite.html">
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
<p>The disk_write function is called to write data to the sector(s) of storage device.</p>
|
<p>The disk_write function is called to write data to the sector(s) of storage device.</p>
|
||||||
<pre>
|
<pre>
|
||||||
DRESULT disk_write (
|
DRESULT disk_write (
|
||||||
BYTE <span class="arg">drv</span>, <span class="c">/* [IN] Physical drive number */</span>
|
BYTE <span class="arg">pdrv</span>, <span class="c">/* [IN] Physical drive number */</span>
|
||||||
const BYTE* <span class="arg">buff</span>, <span class="c">/* [IN] Pointer to the data to be written */</span>
|
const BYTE* <span class="arg">buff</span>, <span class="c">/* [IN] Pointer to the data to be written */</span>
|
||||||
DWORD <span class="arg">sector</span>, <span class="c">/* [IN] Sector number to write from */</span>
|
DWORD <span class="arg">sector</span>, <span class="c">/* [IN] Sector number to write from */</span>
|
||||||
UINT <span class="arg">count</span> <span class="c">/* [IN] Number of sectors to write */</span>
|
UINT <span class="arg">count</span> <span class="c">/* [IN] Number of sectors to write */</span>
|
||||||
@@ -45,7 +45,7 @@ DRESULT disk_write (
|
|||||||
<dt>RES_OK (0)</dt>
|
<dt>RES_OK (0)</dt>
|
||||||
<dd>The function succeeded.</dd>
|
<dd>The function succeeded.</dd>
|
||||||
<dt>RES_ERROR</dt>
|
<dt>RES_ERROR</dt>
|
||||||
<dd>A hard error occured during the write operation and could not recover it.</dd>
|
<dd>An unrecoverable hard error occured during the write operation.</dd>
|
||||||
<dt>RES_WRPRT</dt>
|
<dt>RES_WRPRT</dt>
|
||||||
<dd>The medium is write protected.</dd>
|
<dd>The medium is write protected.</dd>
|
||||||
<dt>RES_PARERR</dt>
|
<dt>RES_PARERR</dt>
|
||||||
@@ -59,7 +59,7 @@ DRESULT disk_write (
|
|||||||
<div class="para desc">
|
<div class="para desc">
|
||||||
<h4>Description</h4>
|
<h4>Description</h4>
|
||||||
<p>The specified memory address is not that always aligned to word boundary because the argument is defined as <tt>BYTE*</tt>. For more information, refer to the description of <a href="dread.html"><tt>disk_read</tt></a> function.</p>
|
<p>The specified memory address is not that always aligned to word boundary because the argument is defined as <tt>BYTE*</tt>. For more information, refer to the description of <a href="dread.html"><tt>disk_read</tt></a> function.</p>
|
||||||
<p>Generally, a multiple sector transfer request must not be split into single sector transactions to the storage device, or the write throughput will be drastically decreased.</p>
|
<p>Generally, a multiple sector write request (<tt class="arg">count</tt><tt> > 1</tt>) must not be split into single sector transactions to the storage device, or the file write throughput will be drastically decreased.</p>
|
||||||
<p>FatFs expects delayed write function of the disk control layer. The write operation to the media does not need to be completed at return from this function by what write operation is in progress or data is only stored into the write-back cache. But write data on the <tt class="arg">buff</tt> is invalid after return from this function. The write completion request is done by <tt>CTRL_SYNC</tt> command of <tt><a href="dioctl.html">disk_ioctl</a></tt> function. Therefore, if a delayed write function is implemented, the write throughput of the filesystem will be improved.</p>
|
<p>FatFs expects delayed write function of the disk control layer. The write operation to the media does not need to be completed at return from this function by what write operation is in progress or data is only stored into the write-back cache. But write data on the <tt class="arg">buff</tt> is invalid after return from this function. The write completion request is done by <tt>CTRL_SYNC</tt> command of <tt><a href="dioctl.html">disk_ioctl</a></tt> function. Therefore, if a delayed write function is implemented, the write throughput of the filesystem will be improved.</p>
|
||||||
<p><em>Remarks: Application program MUST NOT call this function, or FAT structure on the volume can be collapsed.</em></p>
|
<p><em>Remarks: Application program MUST NOT call this function, or FAT structure on the volume can be collapsed.</em></p>
|
||||||
</div>
|
</div>
|
||||||
@@ -67,7 +67,7 @@ DRESULT disk_write (
|
|||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>This function is not needed when <tt>FF_FS_READONLY == 1</tt>.</p>
|
<p>This function is not needed when <tt><a href="config.html#fs_readonly">FF_FS_READONLY</a> == 1</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/eof.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/eof.html">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/error.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/error.html">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/lseek.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/lseek.html">
|
||||||
@@ -57,11 +57,11 @@ FRESULT f_expand (
|
|||||||
<li>No free contiguous space was found.</li>
|
<li>No free contiguous space was found.</li>
|
||||||
<li>Size of the file was not zero.</li>
|
<li>Size of the file was not zero.</li>
|
||||||
<li>The file has been opened in read-only mode.</li>
|
<li>The file has been opened in read-only mode.</li>
|
||||||
<li>Not allowable file size. (>= 4GiB on FAT volume)</li>
|
<li>Not allowable file size. (>= 4 GB on FAT volume)</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>When <tt class="arg">opt</tt> is 0, the function finds a contiguous data area and set it as suggested point for next allocation instead of allocating it to the file. The next cluster allocation is started at top of the contiguous area found by this function. Thus the write file is guaranteed be contiguous and no allocation delay until the size reaches that size at least unless any other changes to the volume is performed.</p>
|
<p>When <tt class="arg">opt</tt> is 0, the function finds a contiguous data area and set it as suggested point for next allocation instead of allocating it to the file. The next cluster allocation is started at top of the contiguous area found by this function. Thus the write file is guaranteed be contiguous and no allocation delay until the size reaches that size at least unless any other changes to the volume is performed.</p>
|
||||||
<p>The contiguous file would have an advantage at time-critical read/write operations. It eliminates some overheads in the filesystem and the storage media caused by random access due to fragmented file data. Especially FAT access for the contiguous file on the exFAT volume is completely eliminated and storage media will be accessed sequentially.</p>
|
<p>The contiguous file would have an advantage at time-critical read/write operations. It eliminates some overheads in the filesystem and the storage media caused by random access due to fragmented file data. Especially FAT access for the contiguous file on the exFAT volume is completely eliminated and storage media will be accessed sequentially.</p>
|
||||||
<p>Also the contiguous file can be easily accessed directly via low-level disk functions. But this is not recommended in consideration for future compatibility.</p>
|
<p>Also the contiguous file can be easily accessed directly via low-level disk functions. But this is not recommended in consideration for future compatibility. Use <a href="../res/app5.c">this function</a> to examine if the file is contiguous or not.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/fattime.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/fattime.html">
|
||||||
@@ -29,7 +29,7 @@ DWORD get_fattime (void);
|
|||||||
<dt>bit24:21</dt>
|
<dt>bit24:21</dt>
|
||||||
<dd>Month (1..12)</dd>
|
<dd>Month (1..12)</dd>
|
||||||
<dt>bit20:16</dt>
|
<dt>bit20:16</dt>
|
||||||
<dd>Day of the month(1..31)</dd>
|
<dd>Day of the month (1..31)</dd>
|
||||||
<dt>bit15:11</dt>
|
<dt>bit15:11</dt>
|
||||||
<dd>Hour (0..23)</dd>
|
<dd>Hour (0..23)</dd>
|
||||||
<dt>bit10:5</dt>
|
<dt>bit10:5</dt>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/fdisk.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/fdisk.html">
|
||||||
@@ -31,7 +31,7 @@ FRESULT f_fdisk (
|
|||||||
<dt>szt</dt>
|
<dt>szt</dt>
|
||||||
<dd>Pointer to the first item of the partition map table.</dd>
|
<dd>Pointer to the first item of the partition map table.</dd>
|
||||||
<dt>work</dt>
|
<dt>work</dt>
|
||||||
<dd>Pointer to the function work area. The size must be at least <tt>FF_MAX_SS</tt> bytes.</dd>
|
<dd>Pointer to the function work area. The size must be at least <tt><a href="config.html#max_ss">FF_MAX_SS</a></tt> bytes. When a null pointer is given, the function allocates a memory block for the working buffer (at only <tt><a href="config.html#use_lfn">FF_USE_LFN</a> == 3</tt>).</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -42,7 +42,8 @@ FRESULT f_fdisk (
|
|||||||
<a href="rc.html#de">FR_DISK_ERR</a>,
|
<a href="rc.html#de">FR_DISK_ERR</a>,
|
||||||
<a href="rc.html#nr">FR_NOT_READY</a>,
|
<a href="rc.html#nr">FR_NOT_READY</a>,
|
||||||
<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
|
<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
|
||||||
<a href="rc.html#ip">FR_INVALID_PARAMETER</a>
|
<a href="rc.html#ip">FR_INVALID_PARAMETER</a>,
|
||||||
|
<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -53,7 +54,7 @@ FRESULT f_fdisk (
|
|||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_FS_READOLNY == 0</tt>, <tt>FF_USE_MKFS == 1</tt> and <tt>FF_MULTI_PARTITION == 1</tt>.</p>
|
<p>Available when <tt><a href="config.html#fs_readonly">FF_FS_READOLNY</a> == 0</tt>, <tt><a href="config.html#use_mkfs">FF_USE_MKFS</a> == 1</tt> and <tt><a href="config.html#multi_partition">FF_MULTI_PARTITION</a> == 1</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="para use">
|
<div class="para use">
|
||||||
|
|||||||
+18
-15
@@ -13,11 +13,11 @@
|
|||||||
<h1>Path Names on the FatFs</h1>
|
<h1>Path Names on the FatFs</h1>
|
||||||
|
|
||||||
<div class="para doc" id="nam">
|
<div class="para doc" id="nam">
|
||||||
<h3>Format of the path names</h3>
|
<h3>Format of the Path Names</h3>
|
||||||
<p>The format of path name on the FatFs module is similer to the filename specs of DOS/Windos as follows:</p>
|
<p>The format of path name on the FatFs module is similer to the filename specs of DOS/Windos as follows:</p>
|
||||||
<pre>[<em>drive#</em>:][/]<em>directory</em>/<em>file</em></pre>
|
<pre>[<em>drive#</em>:][/]<em>directory</em>/<em>file</em></pre>
|
||||||
<p>The FatFs module supports long file name (LFN) and 8.3 format file name (SFN). The LFN can be used when (<tt><a href="config.html#use_lfn">FF_USE_LFN</a> != 0</tt>). The sub directories are separated with a \ or / in the same way as DOS/Windows API. Duplicated separators are skipped and ignored. Only a difference is that the logical drive is specified in a numeral with a colon. When drive prefix is omitted, the drive number is assumed as <em>default drive</em> (drive 0 or current drive).</p>
|
<p>The FatFs module supports long file name (LFN) and 8.3 format file name (SFN). The LFN can be used when <tt><a href="config.html#use_lfn">FF_USE_LFN</a> >= 1</tt>. The sub directories are separated with a <tt>\</tt> or <tt>/</tt> in the same way as DOS/Windows API. Duplicated separators are skipped and ignored. Only a difference is that the heading drive prefix to specify logical drive is in a numeral + colon. When drive prefix is omitted, the drive number is assumed as <em>default drive</em> (drive 0 or current drive).</p>
|
||||||
<p>Control characters (<tt>'\0'</tt> to <tt>'\x1F'</tt>) are recognized as end of the path name. Leading/embedded spaces in the path name are valid as a part of the name at LFN configuration but the space is recognized as end of the path name at non-LFN configuration. Trailing spaces and dots are ignored at both configurations.</p>
|
<p>Control characters (<tt>\0</tt> to <tt>\x1F</tt>) are recognized as end of the path name. Leading/embedded white spaces in the path name are valid as a part of the name at LFN configuration but the white space is recognized as end of the path name at non-LFN configuration. Trailing white spaces and dots are ignored at both configurations.</p>
|
||||||
<p>In default configuration (<tt><a href="config.html#fs_rpath">FF_FS_RPATH</a> == 0</tt>), it does not have a concept of current directory like OS oriented filesystem. Every object on the volume is always specified in full path name that followed from the root directory. Dot directory names (<tt>".", ".."</tt>) are not allowed. Heading separator is ignored and it can be exist or omitted. The default drive is fixed to drive 0.</p>
|
<p>In default configuration (<tt><a href="config.html#fs_rpath">FF_FS_RPATH</a> == 0</tt>), it does not have a concept of current directory like OS oriented filesystem. Every object on the volume is always specified in full path name that followed from the root directory. Dot directory names (<tt>".", ".."</tt>) are not allowed. Heading separator is ignored and it can be exist or omitted. The default drive is fixed to drive 0.</p>
|
||||||
<p>When relative path is enabled (<tt>FF_FS_RPATH >= 1</tt>), specified path is followed from the root directory if a heading separator is exist. If not, it is followed from the current directory of the drive set by <a href="chdir.html"><tt>f_chdir</tt></a> function. Dot names are also allowed for the path names. The default drive is the current drive set by <a href="chdrive.html"><tt>f_chdrive</tt></a> function.</p>
|
<p>When relative path is enabled (<tt>FF_FS_RPATH >= 1</tt>), specified path is followed from the root directory if a heading separator is exist. If not, it is followed from the current directory of the drive set by <a href="chdir.html"><tt>f_chdir</tt></a> function. Dot names are also allowed for the path names. The default drive is the current drive set by <a href="chdrive.html"><tt>f_chdrive</tt></a> function.</p>
|
||||||
<table class="lst2">
|
<table class="lst2">
|
||||||
@@ -35,34 +35,37 @@
|
|||||||
<tr><td>dir1/..</td><td>Invalid name</td><td>The current directory</td></tr>
|
<tr><td>dir1/..</td><td>Invalid name</td><td>The current directory</td></tr>
|
||||||
<tr><td>/..</td><td>Invalid name</td><td>The root directory (sticks the top level)</td></tr>
|
<tr><td>/..</td><td>Invalid name</td><td>The root directory (sticks the top level)</td></tr>
|
||||||
</table>
|
</table>
|
||||||
<p>When option <tt><a href="config.html#str_volume_id">FF_STR_VOLUME_ID</a></tt> is specified, also pre-defined arbitrary keyword instead of a numeral can be used as drive prefix. e.g. <tt>"sdcard:file1.txt"</tt>, <tt>"ram:swapfile.dat"</tt> and DOS/Windows style drive letter, of course.</p>
|
<p>Also the drive prefix can be in pre-defined arbitrary string. When the option <tt><a href="config.html#str_volume_id">FF_STR_VOLUME_ID</a> == 1</tt>, also arbitrary string volume ID can be used as drive prefix. e.g. <tt>"flash:file1.txt"</tt>, <tt>"ram:temp.dat"</tt> or <tt>"sd:"</tt>. When <tt>FF_STR_VOLUME_ID == 2</tt>, Unix style drive prefix can be used. e.g. <tt>"/flash/file1.txt"</tt>, <tt>"/ram/temp.dat"</tt> or <tt>"/usb"</tt>. However, it cannot traverse the drives such as <tt>"/flash/../ram/temp.dat"</tt>. The Unix style drive prefix may lead a confusion in identification between volume ID and file name. For instance, which does <tt>"/flash"</tt> mean, a file <tt>"flash"</tt> on the root directory without drive prefix or a drive prefix of <tt>"flash"</tt>? If the string following a heading slash matches with any volume ID, it is treated as a drive prefix.</p>
|
||||||
|
|
||||||
<p><em>Remark: In this revision, double dot name <tt>".."</tt> cannot follow the parent directory on the exFAT volume. It will work as <tt>"."</tt> and stay there.</em></p>
|
<p><em>Remark: In this revision, double dot name <tt>".."</tt> cannot follow the parent directory on the exFAT volume. It will work as <tt>"."</tt> and stay there.</em></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="para doc" id="case">
|
<div class="para doc" id="case">
|
||||||
<h3>Legal Characters and Case Sensitivity</h3>
|
<h3>Legal Characters and Case Sensitivity</h3>
|
||||||
<p>On the FAT filesystem, legal characters for object name (file/directory name) are, <tt>0-9 A-Z ! # $ % & ' ( ) - @ ^ _ ` { } ~</tt> and extended characters (<tt>\x80</tt>-<tt>\xFF</tt>). Under LFN supported system, also <tt>+ , ; = [ ]</tt> and space are legal for the object name and the white spaces and periods can be placed anywhere in the path name except for end of the object name.</p>
|
<p>On the FAT filesystem, legal characters for object name (file/directory name) are, <tt>0-9 A-Z ! # $ % & ' ( ) - @ ^ _ ` { } ~</tt> and any extended character. The valid character codes of extended characters are depends on the configured code page. Under LFN supported system, also <tt>+ , ; = [ ]</tt> and white space are legal for the object name and the white spaces and dots can be placed anywhere in the path name except for end of the name.</p>
|
||||||
<p>FAT filesystem is case-insensitive to the object names on the volume. All object names are compared in case-insensitive. For example, these three names, <tt>file.txt</tt>, <tt>File.Txt</tt> and <tt>FILE.TXT</tt>, are identical. This is applied to also extended charactres. When an object is created on the FAT volume, upper converted name is recorded to the SFN entry, and the raw name is recorded to the LFN entry.</p>
|
<p>FAT filesystem is case-insensitive to the object names on the volume. Object name on the FAT volume is compared in case-insensitive. For instance, these three names, <tt>file.txt</tt>, <tt>File.Txt</tt> and <tt>FILE.TXT</tt>, are identical. This is applied to extended charactres as well. When an object is created on the FAT volume, up converted name is recorded to the SFN entry, and the raw name is recorded to the LFN entry when LFN function is enabled.</p>
|
||||||
<p>As for the DBCS language MS-DOS, it was case-sensitive to the extended characters. To follow this specification, FatFs works with case-sensitive to the extended characters at only non-LFN with DBCS configuration (DOS/DBCS specs). But at LFN configuration, FatFs works with case-insensitive to all characters (WindowsNT specs). This can cause a problem on compatibility with Windows system when an object with extended characters is created on the volume at non-LFN and DBCS configuration; therfore the object names with DBCS extended characters should not be used on the FAT volume shared by those systems.</p>
|
<p>As for the MS-DOS and PC DOS for CJK (DOS/DBCS), extended characters are recorded to the SFN entry without up-case conversion and compared in case-sensitive. This causes a problem on compatibility with Windows system when any object with extended characters is created on the volume by DOS/DBCS system; therfore the object names with DBCS extended characters should not be used on the FAT volume shared by those systems. FatFs works with case-sensitive to the extended characters at only non-LFN with DBCS configuration (DOS/DBCS specs). But at LFN configuration, FatFs works with case-insensitive to the extended character (WindowsNT specs).</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="para doc" id="uni">
|
<div class="para doc" id="uni">
|
||||||
<h3>Unicode API</h3>
|
<h3>Unicode API</h3>
|
||||||
<p>The path names are input/output in either ANSI/OEM code or Unicode depends on the configuration options. The type of arguments which specify the path names are defined as <tt>TCHAR</tt>. It is an alias of <tt>char</tt> by default. The code set used to the path name string is ANSI/OEM specifid by <tt><a href="config.html#code_page">FF_CODE_PAGE</a></tt>. When <tt><a href="config.html#lfn_unicode">FF_LFN_UNICODE</a></tt> is set to 1, the type of the <tt>TCHAR</tt> is switched to <tt>WCHAR</tt> to support Unicode (UTF-16 encoding). In this case, the full-featured LFN specification is supported and the Unicode specific characters, such as ✝☪✡☸☭, can also be used for the path name. It also affects data types and encoding of the string I/O functions. To define literal strings, <tt>_T(s)</tt> and <tt>_TEXT(s)</tt> macro are available to select either ANSI/OEM or Unicode automatically. The code shown below is an example to define the literal strings.</p>
|
<p>The path names are input/output in either ANSI/OEM code or Unicode depends on the configuration options. The type of arguments which specifies the path names is defined as <tt>TCHAR</tt>. It is an alias of <tt>char</tt> by default and the code set used for the path name string is ANSI/OEM specifid by <tt><a href="config.html#code_page">FF_CODE_PAGE</a></tt>. When <tt><a href="config.html#lfn_unicode">FF_LFN_UNICODE</a></tt> is set to 1 or larger, the type of the <tt>TCHAR</tt> is switched to proper type to support the Unicode string. When Unicode API is specified by this option, the full-featured LFN specification is supported and the Unicode specific characters, such as ✝☪✡☸☭, can also be used for the path name. It also affects data types and encoding of the string I/O functions. To define literal strings, <tt>_T(s)</tt> and <tt>_TEXT(s)</tt> macro are available to select either ANSI/OEM or Unicode automatically. The code shown below is an example to define the literal strings.</p>
|
||||||
<pre>
|
<pre>
|
||||||
f_open(fp, "filename.txt", FA_READ); <span class="c">/* ANSI/OEM string */</span>
|
f_open(fp, "filename.txt", FA_READ); <span class="c">/* ANSI/OEM string (char) */</span>
|
||||||
f_open(fp, L"filename.txt", FA_READ); <span class="c">/* Unicode string */</span>
|
f_open(fp, L"filename.txt", FA_READ); <span class="c">/* UTF-16 string (WCHAR) */</span>
|
||||||
f_open(fp, _T("filename.txt"), FA_READ); <span class="c">/* Changed by configuration */</span>
|
f_open(fp, u8"filename.txt", FA_READ); <span class="c">/* UTF-8 string (char) */</span>
|
||||||
|
f_open(fp, U"filename.txt", FA_READ); <span class="c">/* UTF-32 string (DWORD) */</span>
|
||||||
|
f_open(fp, _T("filename.txt"), FA_READ); <span class="c">/* Changed by configuration (TCHAR) */</span>
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="para doc" id="vol">
|
<div class="para doc" id="vol">
|
||||||
<h3>Volume Management</h3>
|
<h3>Volume Management</h3>
|
||||||
<p>FatFs module needs dynamic work area, <em>filesystem object</em>, for each volume (logical drive). It is registered/unregistered to the FatFs module by <tt>f_mount</tt> function. By default, each logical drive is bound to the physical drive with the same drive number and an FAT volume on the drive is serched by the volume mount process. It reads boot sectors and checks it if it is an FAT boot sector in order of sector 0 as SFD format, 1st partition, 2nd partition, 3rd partition and 4th partition as FDISK format.</p>
|
<p>FatFs module requires dynamic work area, <em>filesystem object</em>, for each volume (logical drive). It is registered/unregistered to the FatFs module by <tt>f_mount</tt> function. By default, each logical drive is bound to the physical drive with the same drive number and an FAT volume on the drive is serched by the volume mount process. It reads boot sectors and checks it if it is an FAT boot sector in order of sector 0 as SFD format, 1st partition, 2nd partition, 3rd partition and 4th partition as FDISK format.</p>
|
||||||
<p>When <tt><a href="config.html#multi_partition">FF_MULTI_PARTITION</a> == 1</tt> is specified by configuration option, each individual logical drive is bound to the partition on the physical drive specified by volume management table. The volume management table needs to be defined by user to resolve the mappings of logical drives and partitions. Following code is an example of a volume management table.</p>
|
<p>When <tt><a href="config.html#multi_partition">FF_MULTI_PARTITION = 1</a></tt> is specified by configuration option, each individual logical drive is bound to the partition on the physical drive specified by volume management table. The volume management table needs to be defined by user to resolve the mappings of logical drives and partitions. Following code is an example of a volume management table.</p>
|
||||||
<pre>
|
<pre>
|
||||||
Example: 0:-2: are tied to three pri-partitions on the physical drive 0 (fixed drive)
|
Example: "0:", "1:" and "2:" are tied to three pri-partitions on the physical drive 0 (fixed drive)
|
||||||
3: is tied to an FAT volume on the physical drive 1 (removable drive)
|
"3:" is tied to an FAT volume on the physical drive 1 (removable drive)
|
||||||
|
|
||||||
PARTITION VolToPart[FF_VOLUMES] = {
|
PARTITION VolToPart[FF_VOLUMES] = {
|
||||||
{0, 1}, <span class="c">/* "0:" ==> Physical drive 0, 1st partition */</span>
|
{0, 1}, <span class="c">/* "0:" ==> Physical drive 0, 1st partition */</span>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ FRESULT f_findfirst (
|
|||||||
<dt>dp</dt>
|
<dt>dp</dt>
|
||||||
<dd>Pointer to the blank directory object.</dd>
|
<dd>Pointer to the blank directory object.</dd>
|
||||||
<dt>fno</dt>
|
<dt>fno</dt>
|
||||||
<dd>Pointer to the file information structure to store the information about the found item.</dd>
|
<dd>Pointer to the <a href="sfileinfo.html">file information structure</a> to store the information about the found item.</dd>
|
||||||
<dt>path</dt>
|
<dt>path</dt>
|
||||||
<dd>Pointer to the null-terminated string that specifies the <a href="filename.html">directory name</a> to be opened.</dd>
|
<dd>Pointer to the null-terminated string that specifies the <a href="filename.html">directory name</a> to be opened.</dd>
|
||||||
<dt>pattern</dt>
|
<dt>pattern</dt>
|
||||||
@@ -61,19 +61,19 @@ FRESULT f_findfirst (
|
|||||||
|
|
||||||
<div class="para desc">
|
<div class="para desc">
|
||||||
<h4>Description</h4>
|
<h4>Description</h4>
|
||||||
<p>After the directory specified by <tt class="arg">path</tt> could be opened, it starts to search the directory for items with the name specified by <tt class="arg">pattern</tt>. If the first item is found, the information about the object is stored into the file information structure. For more information about file information structure, refer to <a href="readdir.html"><tt>f_readdir</tt></a> function.</p>
|
<p>After the directory specified by <tt class="arg">path</tt> could be opened, it starts to search the directory for items with the name specified by <tt class="arg">pattern</tt>. If the first item is found, the information about the object is stored into the file information structure <tt class="arg">fno</tt>.</p>
|
||||||
<p>The matching pattern can contain wildcard characters (<tt>?</tt> and <tt>*</tt>). A <tt>?</tt> matches an any character and an <tt>*</tt> matches an any string in length of zero or longer. When support of long file name is enabled, only <tt>fname[]</tt> is tested at <tt>FF_USE_FIND == 1</tt> and also <tt>altname[]</tt> is tested at <tt>FF_USE_FIND == 2</tt>. In this revision, there are some differences listed below between FatFs and standard systems in matching condition.</p>
|
<p>The matching pattern can contain wildcard characters (<tt>?</tt> and <tt>*</tt>). A <tt>?</tt> matches an any character and an <tt>*</tt> matches an any string in length of zero or longer. When support of long file name is enabled, only <tt>fname[]</tt> is tested at <tt>FF_USE_FIND == 1</tt> and also <tt>altname[]</tt> is tested at <tt>FF_USE_FIND == 2</tt>. In this revision, there are some differences listed below between FatFs and standard systems in matching condition.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><tt>"*.*"</tt> never matches any name without extension while it matches any name with or without extension at the standard systems.</li>
|
<li><tt>"*.*"</tt> never matches any name without extension while it matches any name with or without extension at the standard systems.</li>
|
||||||
<li>Any pattern terminated with a period never matches any name while it matches any name without extensiton at the standard systems.</li>
|
<li>Any pattern terminated with a period never matches any name while it matches any name without extensiton at the standard systems.</li>
|
||||||
<li><a href="filename.html#case">DBCS extended characters</a> are compared in case-sensitive at LFN with non-Unicode configuration.</li>
|
<li><a href="filename.html#case">DBCS extended characters</a> are compared in case-sensitive at LFN with ANSI/OEM API.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>This is a wrapper function of <a href="opendir.html"><tt>f_opendir</tt></a> and <a href="readdir.html"><tt>f_readdir</tt></a> function. Available when <tt>FF_USE_FIND >= 1</tt> and <tt>FF_FS_MINIMIZE <= 1</tt>.</p>
|
<p>This is a wrapper function of <a href="opendir.html"><tt>f_opendir</tt></a> and <a href="readdir.html"><tt>f_readdir</tt></a> function. Available when <tt><a href="config.html#use_find">FF_USE_FIND</a> >= 1</tt> and <tt><a href="config.html#fs_minimize">FF_FS_MINIMIZE</a> <= 1</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ FRESULT f_findnext (
|
|||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>This is a wrapper function of <a href="readdir.html"><tt>f_readdir</tt></a> function. Available when <tt>FF_USE_FIND == 1</tt> and <tt>FF_FS_MINIMIZE <= 1</tt>.</p>
|
<p>This is a wrapper function of <a href="readdir.html"><tt>f_readdir</tt></a> function. Available when <tt><a href="config.html#use_find">FF_USE_FIND</a> == 1</tt> and <tt><a href="config.html#fs_minimize">FF_FS_MINIMIZE</a> <= 1</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/forward.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/forward.html">
|
||||||
@@ -60,7 +60,7 @@ FRESULT f_forward (
|
|||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_USE_FORWARD == 1</tt>.</p>
|
<p>Available when <tt><a href="config.html#use_forward">FF_USE_FORWARD</a> == 1</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/getcwd.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/getcwd.html">
|
||||||
@@ -50,23 +50,24 @@ FRESULT f_getcwd (
|
|||||||
|
|
||||||
<div class="para desc">
|
<div class="para desc">
|
||||||
<h4>Description</h4>
|
<h4>Description</h4>
|
||||||
<p>The <tt>f_getcwd</tt> function retrieves full path name of the current directory of the current drive. When <tt>FF_VOLUMES</tt> is larger than 1, a logical drive number is added to top of the path name.</p>
|
<p>The <tt>f_getcwd</tt> function retrieves full path name of the current directory of the current drive. When <tt><a href="config.html#volumes">FF_VOLUMES</a> >= 2</tt>, a heading drive prefix is added to the path name. The style of drive prefix depends on <tt><a href="config.html#str_volume_id">FF_STR_VOLUME_ID</a></tt>.</p>
|
||||||
<p><em>Note: In this revision, this function cannot retrieve the current directory path on the exFAT volume. It always returns the root directory path.</em></p>
|
<p><em>Note: In this revision, this function cannot retrieve the current directory path on the exFAT volume. It always returns the root directory path.</em></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_FS_RPATH == 2</tt>.</p>
|
<p>Available when <tt><a href="config.html#fs_rpath">FF_FS_RPATH</a> == 2</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="para use">
|
<div class="para use">
|
||||||
<h4>Example</h4>
|
<h4>Example</h4>
|
||||||
<pre>
|
<pre>
|
||||||
TCHAR str[256];
|
FRESULT fr;
|
||||||
|
TCHAR str[SZ_STR];
|
||||||
|
|
||||||
fr = <em>f_getcwd</em>(str, sizeof str / sizeof *str); <span class="c">/* Get current directory path */</span>
|
fr = <em>f_getcwd</em>(str, SZ_STR); <span class="c">/* Get current directory path */</span>
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/getfree.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/getfree.html">
|
||||||
@@ -31,7 +31,7 @@ FRESULT f_getfree (
|
|||||||
<dt>nclst</dt>
|
<dt>nclst</dt>
|
||||||
<dd>Pointer to the <tt>DWORD</tt> variable to store number of free clusters.</dd>
|
<dd>Pointer to the <tt>DWORD</tt> variable to store number of free clusters.</dd>
|
||||||
<dt>fatfs</dt>
|
<dt>fatfs</dt>
|
||||||
<dd>Pointer to pointer that to store a pointer to the corresponding file system object.</dd>
|
<dd>Pointer to pointer that to store a pointer to the corresponding filesystem object.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -53,13 +53,13 @@ FRESULT f_getfree (
|
|||||||
|
|
||||||
<div class="para desc">
|
<div class="para desc">
|
||||||
<h4>Descriptions</h4>
|
<h4>Descriptions</h4>
|
||||||
<p>The <tt>f_getfree</tt> function gets number of free clusters on the volume. The member <tt>csize</tt> in the file system object indicates number of sectors per cluster, so that the free space in unit of sector can be calcurated with this information. When FSINFO structure on the FAT32 volume is not in sync, this function can return an incorrect free cluster count. To avoid this problem, FatFs can be forced full FAT scan by <tt><a href="config.html#fs_nofsinfo">FF_FS_NOFSINFO</a></tt> option.</p>
|
<p>The <tt>f_getfree</tt> function gets number of free clusters on the volume. The member <tt>csize</tt> in the filesystem object indicates number of sectors per cluster, so that the free space in unit of sector can be calcurated with this information. When FSINFO structure on the FAT32 volume is not in sync, this function can return an incorrect free cluster count. To avoid this problem, FatFs can be forced full FAT scan by <tt><a href="config.html#fs_nofsinfo">FF_FS_NOFSINFO</a></tt> option.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_FS_READONLY == 0</tt> and <tt>FF_FS_MINIMIZE == 0</tt>.</p>
|
<p>Available when <tt><a href="config.html#fs_readonly">FF_FS_READONLY</a> == 0</tt> and <tt><a href="config.html#fs_minimize">FF_FS_MINIMIZE</a> == 0</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -79,8 +79,7 @@ FRESULT f_getfree (
|
|||||||
fre_sect = fre_clust * fs->csize;
|
fre_sect = fre_clust * fs->csize;
|
||||||
|
|
||||||
<span class="c">/* Print the free space (assuming 512 bytes/sector) */</span>
|
<span class="c">/* Print the free space (assuming 512 bytes/sector) */</span>
|
||||||
printf("%10lu KiB total drive space.\n%10lu KiB available.\n",
|
printf("%10lu KiB total drive space.\n%10lu KiB available.\n", tot_sect / 2, fre_sect / 2);
|
||||||
tot_sect / 2, fre_sect / 2);
|
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/getlabel.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/getlabel.html">
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<div class="para func">
|
<div class="para func">
|
||||||
<h2>f_getlabel</h2>
|
<h2>f_getlabel</h2>
|
||||||
<p>The f_getlabel function returns volume label and volume serial number of a drive.</p>
|
<p>The f_getlabel function returns volume label and volume serial number of a volume.</p>
|
||||||
<pre>
|
<pre>
|
||||||
FRESULT f_getlabel (
|
FRESULT f_getlabel (
|
||||||
const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] Drive number */</span>
|
const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] Drive number */</span>
|
||||||
@@ -29,7 +29,15 @@ FRESULT f_getlabel (
|
|||||||
<dt>path</dt>
|
<dt>path</dt>
|
||||||
<dd>Pointer to the null-terminated string that specifies the <a href="filename.html">logical drive</a>. Null-string specifies the default drive.</dd>
|
<dd>Pointer to the null-terminated string that specifies the <a href="filename.html">logical drive</a>. Null-string specifies the default drive.</dd>
|
||||||
<dt>label</dt>
|
<dt>label</dt>
|
||||||
<dd>Pointer to the buffer to store the volume label. The buffer size must be at least 24 items at <tt>FF_LFN_UNICODE == 0</tt> or 12 items at <tt>FF_LFN_UNICODE == 1</tt>. If the volume has no label, a null-string will be returned. Set null pointer if this information is not needed.</dd>
|
<dd>Pointer to the buffer to store the volume label. If the volume has no label, a null-string will be returned. Set null pointer if this information is not needed. The buffer size should be shown below at least to avoid buffer overflow.<br>
|
||||||
|
<table class="lst2">
|
||||||
|
<tr><td>Configuration</td><td>FF_FS_EXFAT == 0</td><td>FF_FS_EXFAT == 1</td></tr>
|
||||||
|
<tr><td>FF_USE_LFN == 0</td><td>12 items</td><td>-</td></tr>
|
||||||
|
<tr><td>FF_LFN_UNICODE == 0</td><td>12 items</td><td>23 items</td></tr>
|
||||||
|
<tr><td>FF_LFN_UNICODE == 1/3</td><td>12 items</td><td>12 items</td></tr>
|
||||||
|
<tr><td>FF_LFN_UNICODE == 2</td><td>34 items</td><td>34 items</td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
<dt>vsn</dt>
|
<dt>vsn</dt>
|
||||||
<dd>Pointer to the <tt>DWORD</tt> variable to store the volume serial number. Set null pointer if this information is not needed.</dd>
|
<dd>Pointer to the <tt>DWORD</tt> variable to store the volume serial number. Set null pointer if this information is not needed.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
@@ -53,14 +61,14 @@ FRESULT f_getlabel (
|
|||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_USE_LABEL == 1</tt>.</p>
|
<p>Available when <tt><a href="config.html#use_label">FF_USE_LABEL</a> == 1</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="para use">
|
<div class="para use">
|
||||||
<h4>Example</h4>
|
<h4>Example</h4>
|
||||||
<pre>
|
<pre>
|
||||||
char str[24];
|
char str[12];
|
||||||
|
|
||||||
<span class="c">/* Get volume label of the default drive */</span>
|
<span class="c">/* Get volume label of the default drive */</span>
|
||||||
<em>f_getlabel</em>("", str, 0);
|
<em>f_getlabel</em>("", str, 0);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/gets.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/gets.html">
|
||||||
@@ -29,7 +29,7 @@ TCHAR* f_gets (
|
|||||||
<dt>buff</dt>
|
<dt>buff</dt>
|
||||||
<dd>Pointer to read buffer to store the read string.</dd>
|
<dd>Pointer to read buffer to store the read string.</dd>
|
||||||
<dt>len</dt>
|
<dt>len</dt>
|
||||||
<dd>Size of the read buffer in unit of character.</dd>
|
<dd>Size of the read buffer in unit of item.</dd>
|
||||||
<dt>fp</dt>
|
<dt>fp</dt>
|
||||||
<dd>Pointer to the open file object structure.</dd>
|
<dd>Pointer to the open file object structure.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
@@ -45,13 +45,13 @@ TCHAR* f_gets (
|
|||||||
<div class="para desc">
|
<div class="para desc">
|
||||||
<h4>Description</h4>
|
<h4>Description</h4>
|
||||||
<p>The read operation continues until a <tt>'\n'</tt> is stored, reached end of the file or the buffer is filled with <tt>len - 1</tt> characters. The read string is terminated with a <tt>'\0'</tt>. When no character to read or any error occured during read operation, it returns a null pointer. The status of EOF and error can be examined with <tt>f_eof</tt> and <tt>f_error</tt> function.</p>
|
<p>The read operation continues until a <tt>'\n'</tt> is stored, reached end of the file or the buffer is filled with <tt>len - 1</tt> characters. The read string is terminated with a <tt>'\0'</tt>. When no character to read or any error occured during read operation, it returns a null pointer. The status of EOF and error can be examined with <tt>f_eof</tt> and <tt>f_error</tt> function.</p>
|
||||||
<p>When FatFs is configured to Unicode API (<tt>FF_LFN_UNICODE == 1</tt>), data types on the srting fuctions, <tt>f_putc</tt>, <tt>f_puts</tt>, <tt>f_printf</tt> and <tt>f_gets</tt>, is also switched to Unicode. The character encoding on the file to be read/written via those functions is assumed depends on <a href="config.html#strf_encode"><tt>FF_STRF_ENCODE</tt></a>.</p>
|
<p>When FatFs is configured to Unicode API (<tt><a href="config.html#lfn_unicode">FF_LFN_UNICODE</a> >= 1</tt>), data types on the srting fuctions, <tt>f_putc</tt>, <tt>f_puts</tt>, <tt>f_printf</tt> and <tt>f_gets</tt>, is also switched to Unicode. The character encoding <em>on the file</em> to be read via this function is assumed as <a href="config.html#strf_encode"><tt>FF_STRF_ENCODE</tt></a>. If the character encoding on the file differs from that on the API, it is converted in this function. In this case, input characters with wrong encoding will be lost.<p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>This is a wrapper function of <a href="read.html"><tt>f_read</tt></a> function. Available when <tt>FF_USE_STRFUNC</tt> is 1 or 2. When it is set to 2, <tt>'\r'</tt>s contained in the file are stripped out.</p>
|
<p>This is a wrapper function of <a href="read.html"><tt>f_read</tt></a> function. Available when <tt><a href="config.html#use_strfunc">FF_USE_STRFUNC</a> >= 1</tt>. When it is set to 2, <tt>'\r'</tt>s contained in the file are stripped out.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/lseek.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/lseek.html">
|
||||||
@@ -29,7 +29,7 @@ FRESULT f_lseek (
|
|||||||
<dt>fp</dt>
|
<dt>fp</dt>
|
||||||
<dd>Pointer to the open file object.</dd>
|
<dd>Pointer to the open file object.</dd>
|
||||||
<dt>ofs</dt>
|
<dt>ofs</dt>
|
||||||
<dd>Byte offset from top of the file to set read/write pointer. The data type <tt>FSIZE_t</tt> is an alias of either <tt>DWORD</tt>(32-bit) or <tt>QWORD</tt>(64-bit) depends on the configuration option <tt>FF_FS_EXFAT</tt>.</dd>
|
<dd>Byte offset from top of the file to set read/write pointer. The data type <tt>FSIZE_t</tt> is an alias of either <tt>DWORD</tt>(32-bit) or <tt>QWORD</tt>(64-bit) depends on the configuration option <tt><a href="config.html#fs_exfat">FF_FS_EXFAT</a></tt>.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -54,14 +54,14 @@ FRESULT f_lseek (
|
|||||||
<li>End of file. The specified <tt class="arg">ofs</tt> was clipped at end of the file because the file has been opened in read-only mode.</li>
|
<li>End of file. The specified <tt class="arg">ofs</tt> was clipped at end of the file because the file has been opened in read-only mode.</li>
|
||||||
<li>Disk full. There is no free space on the volume to expand the file.</li>
|
<li>Disk full. There is no free space on the volume to expand the file.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>The fast seek function enables fast backward/long seek operations without FAT access by using an on-memory CLMT (cluster link map table). It is applied to <tt>f_read</tt> and <tt>f_write</tt> function as well, however, the file size cannot be expanded by <tt>f_write</tt>, <tt>f_lseek</tt> function while the file is in fast seek mode.</p>
|
<p>The fast seek function enables fast backward/long seek operations without FAT access by using an on-memory CLMT (cluster link map table). It is applied to <tt>f_read</tt> and <tt>f_write</tt> function as well, however, the file size cannot be expanded by <tt>f_write</tt>, <tt>f_lseek</tt> function while the file is at fast seek mode.</p>
|
||||||
<p>The fast seek function is enabled when the member <tt>cltbl</tt> in the file object is not NULL. The CLMT must be created into the <tt>DWORD</tt> array prior to use the fast seek function. To create the CLMT, set address of the <tt>DWORD</tt> array to the member <tt>cltbl</tt> in the open file object, set the size of array in unit of items to the first item and call the <tt>f_lseek</tt> function with <tt class="arg">ofs</tt><tt> = CREATE_LINKMAP</tt>. After the function succeeded and CLMT is created, no FAT access is occured in subsequent <tt>f_read</tt>, <tt>f_write</tt>, <tt>f_lseek</tt> function to the file. The number of items used or required is returned into the first item of the array. The number of items to be used is (number of the file fragments + 1) * 2. For example, when the file is fragmented in 5, 12 items in the array will be used. If the function failed with <tt>FR_NOT_ENOUGH_CORE</tt>, the given array size is insufficient for the file.</p>
|
<p>The fast seek mode is enabled when the member <tt>cltbl</tt> in the file object is not NULL. The CLMT must be created into the <tt>DWORD</tt> array prior to use the fast seek function. To create the CLMT, set address of the <tt>DWORD</tt> array to the member <tt>cltbl</tt> in the open file object, set the size of array in unit of items to the first item and call the <tt>f_lseek</tt> function with <tt class="arg">ofs</tt><tt> = CREATE_LINKMAP</tt>. After the function succeeded and CLMT is created, no FAT access is occured in subsequent <tt>f_read</tt>, <tt>f_write</tt>, <tt>f_lseek</tt> function to the file. The number of items used or required is returned into the first item of the array. The number of items to be used is (number of the file fragments + 1) * 2. For example, when the file is fragmented in 5, 12 items in the array will be used. If the function failed with <tt>FR_NOT_ENOUGH_CORE</tt>, the given array size is insufficient for the file.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_FS_MINIMIZE <= 2</tt>. To use fast seek function, <tt>FF_USE_FASTSEEK</tt> needs to be set 1.</p>
|
<p>Available when <tt><a href="config.html#fs_minimize">FF_FS_MINIMIZE</a> <= 2</tt>. To use fast seek function, <tt><a href="config.html#use_fastseek">FF_USE_FASTSEEK</a></tt> needs to be set 1 to enable this feature.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -91,13 +91,13 @@ FRESULT f_lseek (
|
|||||||
res = f_open(fp, recfile, FA_CREATE_NEW | FA_WRITE); <span class="c">/* Create a file */</span>
|
res = f_open(fp, recfile, FA_CREATE_NEW | FA_WRITE); <span class="c">/* Create a file */</span>
|
||||||
|
|
||||||
res = <em>f_lseek</em>(fp, PRE_SIZE); <span class="c">/* Expand file size (cluster pre-allocation) */</span>
|
res = <em>f_lseek</em>(fp, PRE_SIZE); <span class="c">/* Expand file size (cluster pre-allocation) */</span>
|
||||||
if (res || f_tell(fp) != PRE_SIZE) ... <span class="c">/* Check if the file has been expanded */</span>
|
if (res || f_tell(fp) != PRE_SIZE) ... <span class="c">/* Check if the file has been expanded successfly */</span>
|
||||||
|
|
||||||
res = <em>f_lseek</em>(fp, DATA_START); <span class="c">/* Record data stream WITHOUT cluster allocation delay */</span>
|
res = <em>f_lseek</em>(fp, DATA_START); <span class="c">/* Record data stream WITHOUT cluster allocation delay */</span>
|
||||||
... <span class="c">/* Write operation should be aligned to sector boundary to optimize the write throughput */</span>
|
... <span class="c">/* Write operation should be aligned to sector boundary to optimize the write throughput */</span>
|
||||||
|
|
||||||
res = f_truncate(fp); <span class="c">/* Truncate unused area */</span>
|
res = f_truncate(fp); <span class="c">/* Truncate unused area */</span>
|
||||||
res = <em>f_lseek</em>(fp, 0); <span class="c">/* Put file header */</span>
|
res = <em>f_lseek</em>(fp, 0); <span class="c">/* Set file header */</span>
|
||||||
...
|
...
|
||||||
|
|
||||||
res = f_close(fp);
|
res = f_close(fp);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/mkdir.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/mkdir.html">
|
||||||
@@ -59,7 +59,7 @@ FRESULT f_mkdir (
|
|||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_FS_READONLY == 0</tt> and <tt>FF_FS_MINIMIZE == 0</tt>.</p>
|
<p>Available when <tt><a href="config.html#fs_readonly">FF_FS_READONLY</a> == 0</tt> and <tt><a href="config.html#fs_minimize">FF_FS_MINIMIZE</a> == 0</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+11
-10
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/mkfs.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/mkfs.html">
|
||||||
@@ -31,11 +31,11 @@ FRESULT f_mkfs (
|
|||||||
<dt>path</dt>
|
<dt>path</dt>
|
||||||
<dd>Pointer to the null-terminated string specifies the <a href="filename.html">logical drive</a> to be formatted. If it has no drive number in it, it means the default drive. The logical drive may or may not be mounted for the format process.</dd>
|
<dd>Pointer to the null-terminated string specifies the <a href="filename.html">logical drive</a> to be formatted. If it has no drive number in it, it means the default drive. The logical drive may or may not be mounted for the format process.</dd>
|
||||||
<dt>opt</dt>
|
<dt>opt</dt>
|
||||||
<dd>Specifies the format option in combination of <tt>FM_FAT</tt>, <tt>FM_FAT32</tt>, <tt>FM_EXFAT</tt> and bitwise-or of these three, <tt>FM_ANY</tt>. <tt>FM_EXFAT</tt> is ignored when exFAT is not enabled. These flags specify which FAT type to be created on the volume. If two or more types are specified, one out of them will be selected depends on the volume size. The flag <tt>FM_SFD</tt> specifies to place the volume on the drive in SFD format.</dd>
|
<dd>Specifies the format option in combination of <tt>FM_FAT</tt>, <tt>FM_FAT32</tt>, <tt>FM_EXFAT</tt> and bitwise-or of these three, <tt>FM_ANY</tt>. <tt>FM_EXFAT</tt> is ignored when exFAT is not enabled. These flags specify which FAT type to be created on the volume. If two or more types are specified, one out of them will be selected depends on the volume size and <tt class="arg">au</tt>. The flag <tt>FM_SFD</tt> specifies to create the volume on the drive in SFD format.</dd>
|
||||||
<dt>au</dt>
|
<dt>au</dt>
|
||||||
<dd>Specifies size of the allocation unit (cluter) in unit of byte. The valid value is <tt>n</tt> times the sector size. The <tt>n</tt> is power of 2 from 1 to 128 for FAT volume and upto 16MiB for exFAT volume. If zero is given, the default allocation unit size is selected depends on the volume size.</dd>
|
<dd>Specifies size of the allocation unit (cluter) in unit of byte. The valid value is <em>n</em> times the sector size. The <em>n</em> is power of 2 from 1 to 128 for FAT volume and upto 16MiB for exFAT volume. If zero is given, the default allocation unit size is selected depends on the volume size.</dd>
|
||||||
<dt>work</dt>
|
<dt>work</dt>
|
||||||
<dd>Pointer to the working buffer used for the format process.</dd>
|
<dd>Pointer to the working buffer used for the format process. When a null pointer is given, the function allocates a memory block for the working buffer and <tt class="arg">len</tt> has no effect (at only <tt><a href="config.html#use_lfn">FF_USE_LFN</a> == 3</tt>).</dd>
|
||||||
<dt>len</dt>
|
<dt>len</dt>
|
||||||
<dd>Size of the working buffer in unit of byte. It needs to be the sector size of the corresponding physical drive at least. Plenty of working buffer reduces number of write transactions to the drive and the format process will finish quickly.</dd>
|
<dd>Size of the working buffer in unit of byte. It needs to be the sector size of the corresponding physical drive at least. Plenty of working buffer reduces number of write transactions to the drive and the format process will finish quickly.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
@@ -50,22 +50,23 @@ FRESULT f_mkfs (
|
|||||||
<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
|
<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
|
||||||
<a href="rc.html#id">FR_INVALID_DRIVE</a>,
|
<a href="rc.html#id">FR_INVALID_DRIVE</a>,
|
||||||
<a href="rc.html#ma">FR_MKFS_ABORTED</a>,
|
<a href="rc.html#ma">FR_MKFS_ABORTED</a>,
|
||||||
<a href="rc.html#ip">FR_INVALID_PARAMETER</a>
|
<a href="rc.html#ip">FR_INVALID_PARAMETER</a>,
|
||||||
|
<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="para desc">
|
<div class="para desc">
|
||||||
<h4>Description</h4>
|
<h4>Description</h4>
|
||||||
<p>The FAT sub-type, FAT12/FAT16/FAT32, of FAT volume except exFAT is determined by only number of clusters on the volume and nothing else, according to the FAT specification issued by Microsoft. Thus which FAT sub-type is selected, is depends on the volume size and the specified cluster size. In case of the combination of FAT type and cluter size specified by argument cannot be valid on the volume, the function will fail with <tt>FR_MKFS_ABORTED</tt>.</p>
|
<p>The FAT sub-type, FAT12/FAT16/FAT32, of FAT volume except exFAT is determined by only number of clusters on the volume and nothing else, according to the FAT specification issued by Microsoft. Thus the FAT sub-type of created volume depends on the volume size and the cluster size. In case of the combination of FAT type and cluter size specified by argument cannot be valid on the volume, the function will fail with <tt>FR_MKFS_ABORTED</tt>. The minimum drive size is 128 sectors with <tt>FM_SFD</tt> option.</p>
|
||||||
<p>The allocation unit, also called <em>cluster</em>, is a unit of disk space allocation for files. When the size of allocation unit is 32768 bytes, a file with 100 bytes in size occupies 32768 bytes of disk space. The space efficiency of disk usage gets worse as increasing size of allocation unit, but, on the other hand, the read/write performance increases as the size of allocation unit. Therefore the size of allocation unit is a trade-off between space efficiency and performance. For the large storages in GB order, 32768 bytes or larger (this is automatically selected by default) is recommended for most case unless extremely many small files are created on a volume.</p>
|
<p>The allocation unit, also called <em>cluster</em>, is a unit of disk space allocation for files. When the size of allocation unit is 32768 bytes, a file with 100 bytes in size occupies 32768 bytes of disk space. The space efficiency of disk usage gets worse as increasing size of allocation unit, but, on the other hand, the read/write performance increases as the size of allocation unit. Therefore the size of allocation unit is a trade-off between space efficiency and performance. For the large storages in GB order, 32768 bytes or larger (this is automatically selected by default) is recommended for most case unless extremely many small files are created on a volume.</p>
|
||||||
<p>There are two disk formats, FDISK and SFD. The FDISK format is usually used for harddisk, MMC, SDC, CFC and U Disk. It can divide a physical drive into one or more partitions with a partition table on the MBR (maser boot record, the first sector of the physical drive). The SFD (super-floppy disk) format is non-partitioned disk format. The FAT volume starts at the first sector of the physical drive without any disk partitioning. It is usually used for floppy disk, Microdrive, optical disk and most type of super-floppy media. Some systems support only either one of the two formats and the other is not supported.</p>
|
<p>There are three disk partitioning formats, FDISK, SFD and GPT. The FDISK format is usually used for harddisk, memory card and U disk. It can divide a physical drive into one or more partitions with a partition table on the MBR (maser boot record, the first sector of the physical drive). The SFD (super-floppy disk) is non-partitioned disk format. The FAT volume starts at the first sector of the physical drive without any disk partitioning. It is usually used for floppy disk, optical disk and most super-floppy media. Some systems support only either one of the two disk formats and the other is not supported. The GPT (GUID Partition Table) is a newly defined format for large storage devices. FatFs does not support the storages with GPT.</p>
|
||||||
<p>When the logical drive to be formatted is bound to a physical drive and <tt>FM_SFD</tt> is not specified, a primary partition occupies whole drive space is created and then the FAT volume is created in it. When <tt>FM_SFD</tt> is specified, the FAT volume occupies from the first sector of the physical drive is created without partitioning.</p>
|
<p>When the logical drive to be formatted is bound to a physical drive and <tt>FM_SFD</tt> is not specified, a primary partition occupies whole drive space is created in FDISK format, and then the FAT volume is created in the partition. When <tt>FM_SFD</tt> is specified, the FAT volume occupies from the first sector of the physical drive is created in SFD format.</p>
|
||||||
<p>When the logical drive to be formatted is bound to a specific partition (1-4) by support of multiple partition (<tt><a href="config.html#multi_partition">FF_MULTI_PARTITION</a></tt>) the FAT volume is created into the partition and <tt>FM_SFD</tt> flag is ignored. The physical drive needs to be partitioned with <tt>f_fdisk</tt> function or any other partitioning tools prior to create the FAT volume with this function.</p>
|
<p>When the logical drive to be formatted is bound to a specific partition (1-4) by support of multiple partition (<tt><a href="config.html#multi_partition">FF_MULTI_PARTITION</a> == 1</tt>), the FAT volume is created on the partition and <tt>FM_SFD</tt> flag is ignored. The physical drive needs to be partitioned with <tt>f_fdisk</tt> function or any other partitioning tools prior to create the FAT volume with this function.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_FS_READOLNY == 0</tt> and <tt>FF_USE_MKFS == 1</tt>.</p>
|
<p>Available when <tt><a href="config.html#fs_readonly">FF_FS_READOLNY</a> == 0</tt> and <tt><a href="config.html#use_mkfs">FF_USE_MKFS</a> == 1</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="para use">
|
<div class="para use">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/mount.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/mount.html">
|
||||||
@@ -50,7 +50,7 @@ FRESULT f_mount (
|
|||||||
|
|
||||||
<div class="para desc">
|
<div class="para desc">
|
||||||
<h4>Description</h4>
|
<h4>Description</h4>
|
||||||
<p>FatFs needs work area (<em>filesystem object</em>) for each logical drives (FAT volumes). Prior to perform file/directory operations, a filesystem object needs to be registered with <tt>f_mount</tt> function to the logical drive. The file/directory API functions get ready to work after this procedure. If there is any open object of file or directory on the logical drive, the object will be invalidated by this function.</p>
|
<p>FatFs requires work area (<em>filesystem object</em>) for each logical drives (FAT volumes). Prior to perform file/directory operations, a filesystem object needs to be registered with <tt>f_mount</tt> function to the logical drive. The file/directory API functions get ready to work after this procedure. If there is any open object of file or directory on the logical drive, the object will be invalidated by this function.</p>
|
||||||
<p>The <tt>f_mount</tt> function registers/unregisters a filesystem object to the FatFs module as follows:</p>
|
<p>The <tt>f_mount</tt> function registers/unregisters a filesystem object to the FatFs module as follows:</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>Determines the logical drive which specified by <tt class="arg">path</tt>.</li>
|
<li>Determines the logical drive which specified by <tt class="arg">path</tt>.</li>
|
||||||
@@ -58,13 +58,14 @@ FRESULT f_mount (
|
|||||||
<li>Clears and registers the new work area to the volume if <tt class="arg">fs</tt> is not NULL.</li>
|
<li>Clears and registers the new work area to the volume if <tt class="arg">fs</tt> is not NULL.</li>
|
||||||
<li>Performs volume mount process to the volume if forced mounting is specified.</li>
|
<li>Performs volume mount process to the volume if forced mounting is specified.</li>
|
||||||
</ol>
|
</ol>
|
||||||
<p>If forced mounting is not specified (<tt>opt = 0</tt>), this function always succeeds regardless of the physical drive status. It only clears (de-initializes) the given work area and registers its address to the internal table and no activity of the physical drive in this function. To unregister the work area, specify a NULL to the <tt class="arg">fs</tt>, and then the work area can be discarded. The volume mount processes, initialize the corresponding physical drive, find the FAT volume in it and then initialize the work area, is performed in the subsequent file/directory functions when either of following conditions is true.</p>
|
<p>If forced mounting is not specified (<tt>opt = 0</tt>), this function always succeeds regardless of the physical drive status. It only clears (de-initializes) the given work area and registers its address to the internal table and no activity of the physical drive in this function. The volume mount process will be attempted on subsequent file/directroy function if the filesystem object is not initialized. (delayed mounting) The volume mount processes, initialize the corresponding physical drive, find the FAT volume in it and then initialize the work area, is performed in the subsequent file/directory functions when either of following conditions is true.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>File system object has not been initialized. It is de-initialized by <tt>f_mount</tt> function.</li>
|
<li>Filesystem object has not been initialized. It is de-initialized by <tt>f_mount</tt> function.</li>
|
||||||
<li>Physical drive is not initialized. It is de-initialized by system reset or media removal.</li>
|
<li>Physical drive is not initialized. It is de-initialized by system reset or media removal.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>If the function with forced mounting (<tt>opt = 1</tt>) failed, it means that the filesystem object has been registered successfully but the volume is currently not ready to work. The volume mount process will be attempted at subsequent file/directroy functions if the filesystem object is not initialized. (delayed mounting)</p>
|
<p>If the function with forced mounting (<tt>opt = 1</tt>) failed with <tt>FR_NOT_READY</tt>, it means that the filesystem object has been registered successfully but the volume is currently not ready to work. The volume mount process will be attempted on subsequent file/directroy function.</p>
|
||||||
<p>If implementation of the disk I/O layer lacks asynchronous media change detection, application program needs to perform <tt>f_mount</tt> function after each media change to force cleared the filesystem object.</p>
|
<p>If implementation of the disk I/O layer lacks asynchronous media change detection, application program needs to perform <tt>f_mount</tt> function after each media change to force cleared the filesystem object.</p>
|
||||||
|
<p>To unregister the work area, specify a NULL to the <tt class="arg">fs</tt>, and then the work area can be discarded.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+17
-18
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/open.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/open.html">
|
||||||
@@ -43,18 +43,17 @@ FRESULT f_open (
|
|||||||
<tr><td>FA_OPEN_APPEND</td><td>Same as <tt>FA_OPEN_ALWAYS</tt> except the read/write pointer is set end of the file.</td></tr>
|
<tr><td>FA_OPEN_APPEND</td><td>Same as <tt>FA_OPEN_ALWAYS</tt> except the read/write pointer is set end of the file.</td></tr>
|
||||||
</table>
|
</table>
|
||||||
Mode flags of POSIX fopen() corresponds to FatFs mode flags as follows:<br>
|
Mode flags of POSIX fopen() corresponds to FatFs mode flags as follows:<br>
|
||||||
<table class="lst">
|
<table class="lst2">
|
||||||
<tr><th>POSIX</th><th>FatFs</th></tr>
|
<tr><th>POSIX</th><th>FatFs</th></tr>
|
||||||
<tr><td><tt>"r"</tt></td><td><tt>FA_READ</tt></td></tr>
|
<tr><td>"r"</td><td>FA_READ</td></tr>
|
||||||
<tr><td><tt>"r+"</tt></td><td><tt>FA_READ | FA_WRITE</tt></td></tr>
|
<tr><td>"r+"</td><td>FA_READ | FA_WRITE</td></tr>
|
||||||
<tr><td><tt>"w"</tt></td><td><tt>FA_CREATE_ALWAYS | FA_WRITE</tt></td></tr>
|
<tr><td>"w"</td><td>FA_CREATE_ALWAYS | FA_WRITE</td></tr>
|
||||||
<tr><td><tt>"w+"</tt></td><td><tt>FA_CREATE_ALWAYS | FA_WRITE | FA_READ</tt></td></tr>
|
<tr><td>"w+"</td><td>FA_CREATE_ALWAYS | FA_WRITE | FA_READ</td></tr>
|
||||||
<tr><td><tt>"a"</tt></td><td><tt>FA_OPEN_APPEND | FA_WRITE</tt></td></tr>
|
<tr><td>"a"</td><td>FA_OPEN_APPEND | FA_WRITE</td></tr>
|
||||||
<tr><td><tt>"a+"</tt></td><td><tt>FA_OPEN_APPEND | FA_WRITE | FA_READ</tt></td></tr>
|
<tr><td>"a+"</td><td>FA_OPEN_APPEND | FA_WRITE | FA_READ</td></tr>
|
||||||
<tr><td><tt>"x"</tt><sup>*1</sup></td><td><tt>FA_CREATE_NEW | FA_WRITE</tt></td></tr>
|
<tr><td>"wx"</td><td>FA_CREATE_NEW | FA_WRITE</td></tr>
|
||||||
<tr><td><tt>"x+"</tt><sup>*1</sup></td><td><tt>FA_CREATE_NEW | FA_WRITE | FA_READ</tt></td></tr>
|
<tr><td>"w+x"</td><td>FA_CREATE_NEW | FA_WRITE | FA_READ</td></tr>
|
||||||
</table>
|
</table>
|
||||||
<sup>*1</sup>: glibc extension
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
@@ -94,7 +93,7 @@ Mode flags of POSIX fopen() corresponds to FatFs mode flags as follows:<br>
|
|||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Always available. Only <tt>FA_READ</tt> and <tt>FA_OPEN_EXISTING</tt> are supported when <tt>FF_FS_READONLY == 1</tt>.</p>
|
<p>Always available. Only <tt>FA_READ</tt> and <tt>FA_OPEN_EXISTING</tt> are available for the mode flags when <tt><a href="config.html#fs_readonly">FF_FS_READONLY</a> == 1</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -119,7 +118,7 @@ int main (void)
|
|||||||
fr = <em>f_open</em>(&fil, "message.txt", FA_READ);
|
fr = <em>f_open</em>(&fil, "message.txt", FA_READ);
|
||||||
if (fr) return (int)fr;
|
if (fr) return (int)fr;
|
||||||
|
|
||||||
<span class="c">/* Read all lines and display it */</span>
|
<span class="c">/* Read every line and display it */</span>
|
||||||
while (f_gets(line, sizeof line, &fil)) {
|
while (f_gets(line, sizeof line, &fil)) {
|
||||||
printf(line);
|
printf(line);
|
||||||
}
|
}
|
||||||
@@ -135,7 +134,7 @@ int main (void)
|
|||||||
|
|
||||||
int main (void)
|
int main (void)
|
||||||
{
|
{
|
||||||
FATFS fs[2]; <span class="c">/* Work area (filesystem object) for logical drives */</span>
|
FATFS fs0, fs1; <span class="c">/* Work area (filesystem object) for logical drives */</span>
|
||||||
FIL fsrc, fdst; <span class="c">/* File objects */</span>
|
FIL fsrc, fdst; <span class="c">/* File objects */</span>
|
||||||
BYTE buffer[4096]; <span class="c">/* File copy buffer */</span>
|
BYTE buffer[4096]; <span class="c">/* File copy buffer */</span>
|
||||||
FRESULT fr; <span class="c">/* FatFs function common result code */</span>
|
FRESULT fr; <span class="c">/* FatFs function common result code */</span>
|
||||||
@@ -143,8 +142,8 @@ int main (void)
|
|||||||
|
|
||||||
|
|
||||||
<span class="c">/* Register work area for each logical drive */</span>
|
<span class="c">/* Register work area for each logical drive */</span>
|
||||||
f_mount(&fs[0], "0:", 0);
|
f_mount(&fs0, "0:", 0);
|
||||||
f_mount(&fs[1], "1:", 0);
|
f_mount(&fs1, "1:", 0);
|
||||||
|
|
||||||
<span class="c">/* Open source file on the drive 1 */</span>
|
<span class="c">/* Open source file on the drive 1 */</span>
|
||||||
fr = <em>f_open</em>(&fsrc, "1:file.bin", FA_READ);
|
fr = <em>f_open</em>(&fsrc, "1:file.bin", FA_READ);
|
||||||
@@ -167,8 +166,8 @@ int main (void)
|
|||||||
f_close(&fdst);
|
f_close(&fdst);
|
||||||
|
|
||||||
<span class="c">/* Unregister work area prior to discard it */</span>
|
<span class="c">/* Unregister work area prior to discard it */</span>
|
||||||
f_mount(NULL, "0:", 0);
|
f_mount(0, "0:", 0);
|
||||||
f_mount(NULL, "1:", 0);
|
f_mount(0, "1:", 0);
|
||||||
|
|
||||||
return (int)fr;
|
return (int)fr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/opendir.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/opendir.html">
|
||||||
@@ -61,7 +61,7 @@ FRESULT f_opendir (
|
|||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_FS_MINIMIZE <= 1</tt>.</p>
|
<p>Available when <tt><a href="config.html#fs_minimize">FF_FS_MINIMIZE</a> <= 1</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+18
-13
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/printf.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/printf.html">
|
||||||
@@ -29,7 +29,7 @@ int f_printf (
|
|||||||
<dt>fp</dt>
|
<dt>fp</dt>
|
||||||
<dd>Pointer to the open file object structure.</dd>
|
<dd>Pointer to the open file object structure.</dd>
|
||||||
<dt>fmt</dt>
|
<dt>fmt</dt>
|
||||||
<dd>Pointer to the null terminated format string. The terminator charactor will not be written.</dd>
|
<dd>Pointer to the null <tt>'\0'</tt> terminated format string. The terminator character will not be output.</dd>
|
||||||
<dt>...</dt>
|
<dt>...</dt>
|
||||||
<dd>Optional arguments...</dd>
|
<dd>Optional arguments...</dd>
|
||||||
|
|
||||||
@@ -39,25 +39,28 @@ int f_printf (
|
|||||||
|
|
||||||
<div class="para ret">
|
<div class="para ret">
|
||||||
<h4>Return Values</h4>
|
<h4>Return Values</h4>
|
||||||
<p>When the function succeeded, it returns number of characters written. If the function could not write the generated string to the file due to disk full or an error, <tt>EOF (-1)</tt> will be returned.</p>
|
<p>When the string was written successfuly, it returns number of character encoding units written to the file. When the function failed due to disk full or any error, an <tt>EOF (-1)</tt> will be returned.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="para desc">
|
<div class="para desc">
|
||||||
<h4>Description</h4>
|
<h4>Description</h4>
|
||||||
<p>The format control directive is a sub-set of standard library shown as follos:</p>
|
<p>The format control directive is a sub-set of standard library shown as follows:</p>
|
||||||
<ul>
|
<pre>
|
||||||
<li>Type: <tt>c C s S d D u U x X b B</tt></li>
|
%[flag][width][type]
|
||||||
<li>Size: <tt>l L</tt></li>
|
</pre>
|
||||||
<li>Flag: <tt>0 -</tt></li>
|
<dl>
|
||||||
</ul>
|
<dt>flag</dt><dd>Padding options. A <tt>-</tt> specifies left justified. A <tt>0</tt> specifies zero padded.</dd>
|
||||||
|
<dt>width</dt><dd>Minimum width of the field, <tt>1-99</tt> or <tt>*</tt>. If the width of generated string is less than the specified value, rest field is padded with white spaces or zeros. An <tt>*</tt> specifies the value comes from an argument in int type.</dd>
|
||||||
|
<dt>type</dt><dd><tt>c s d u o x b</tt> and prefix <tt>l</tt> specify type of the argument, character, string, signed integer in decimal, unsigned integer in decimal, unsigned integer in octal, unsigned integer in hexdecimal and unsigned integer in binary respectively. If <tt>sizeof (long)</tt> is greater than <tt>sizeof (int)</tt> (this is typical of 8/16-bit systems), a prefix <tt>l</tt> needs to be explicitly specified for long integer argument. These characters except for <tt>x</tt> are case insensitive.</dd>
|
||||||
|
</dl>
|
||||||
|
<p>When FatFs is configured for Unicode API (<tt><a href="config.html#lfn_unicode">FF_LFN_UNICODE</a> >= 1</tt>), character encoding on the string fuctions, <tt>f_putc</tt>, <tt>f_puts</tt>, <tt>f_printf</tt> and <tt>f_gets</tt> function, is also switched to Unicode. The Unicode characters in multiple encoding unit, such as surrogate pair and multi-byte sequence, should not be divided into two function calls, or the character will be lost. The character encoding <em>on the file</em> to be written via this function is selected by <tt><a href="config.html#strf_encode">FF_STRF_ENCODE</a></tt>. The characters with wrong encoding or invalid for the output encoding will be lost.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>This is a wrapper function of <a href="write.html"><tt>f_write</tt></a> function. Available when <tt>FF_FS_READONLY == 0</tt> and <tt>FF_USE_STRFUNC</tt> is 1 or 2. When it is set to 2, <tt>'\n'</tt>s contained in the output are converted to <tt>'\r'+'\n'</tt>.</p>
|
<p>This is a wrapper function of <a href="write.html"><tt>f_write</tt></a> function. Available when <tt><a href="config.html#fs_readonly">FF_FS_READONLY</a> == 0</tt> and <tt><a href="config.html#use_strfunc">FF_USE_STRFUNC</a> >= 1</tt>. When <tt>FF_USE_STRFUNC == 2</tt>, <tt>'\n'</tt>s in the generated string are written as <tt>'\r'+'\n'</tt> each.</p>
|
||||||
<p>When FatFs is configured to Unicode API (<tt>FF_LFN_UNICODE == 1</tt>), data types on the srting fuctions, <tt>f_putc</tt>, <tt>f_puts</tt>, <tt>f_printf</tt> and <tt>f_gets</tt> function, is also switched to Unicode. The character encoding on the file to be read/written via those functions is selected by <tt>FF_STRF_ENCODE</tt> option.</p>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -69,16 +72,18 @@ int f_printf (
|
|||||||
<em>f_printf</em>(&fil, "%ld", 12345L); <span class="c">/* "12345" */</span>
|
<em>f_printf</em>(&fil, "%ld", 12345L); <span class="c">/* "12345" */</span>
|
||||||
<em>f_printf</em>(&fil, "%06d", 25); <span class="c">/* "000025" */</span>
|
<em>f_printf</em>(&fil, "%06d", 25); <span class="c">/* "000025" */</span>
|
||||||
<em>f_printf</em>(&fil, "%06d", -25); <span class="c">/* "000-25" */</span>
|
<em>f_printf</em>(&fil, "%06d", -25); <span class="c">/* "000-25" */</span>
|
||||||
|
<em>f_printf</em>(&fil, "%*d", 5, 100); <span class="c">/* " 100" */</span>
|
||||||
<em>f_printf</em>(&fil, "%-6d", 25); <span class="c">/* "25 " */</span>
|
<em>f_printf</em>(&fil, "%-6d", 25); <span class="c">/* "25 " */</span>
|
||||||
<em>f_printf</em>(&fil, "%u", -1); <span class="c">/* "65535" or "4294967295" */</span>
|
<em>f_printf</em>(&fil, "%u", -1); <span class="c">/* "65535" or "4294967295" */</span>
|
||||||
<em>f_printf</em>(&fil, "%04x", 0xAB3); <span class="c">/* "0ab3" */</span>
|
<em>f_printf</em>(&fil, "%04x", 0xAB3); <span class="c">/* "0ab3" */</span>
|
||||||
<em>f_printf</em>(&fil, "%08LX", 0x123ABCL); <span class="c">/* "00123ABC" */</span>
|
<em>f_printf</em>(&fil, "%08lX", 0x123ABCL); <span class="c">/* "00123ABC" */</span>
|
||||||
|
<em>f_printf</em>(&fil, "%04o", 255); <span class="c">/* "0377" */</span>
|
||||||
<em>f_printf</em>(&fil, "%016b", 0x550F); <span class="c">/* "0101010100001111" */</span>
|
<em>f_printf</em>(&fil, "%016b", 0x550F); <span class="c">/* "0101010100001111" */</span>
|
||||||
<em>f_printf</em>(&fil, "%s", "String"); <span class="c">/* "String" */</span>
|
<em>f_printf</em>(&fil, "%s", "String"); <span class="c">/* "String" */</span>
|
||||||
<em>f_printf</em>(&fil, "%8s", "abc"); <span class="c">/* " abc" */</span>
|
<em>f_printf</em>(&fil, "%8s", "abc"); <span class="c">/* " abc" */</span>
|
||||||
<em>f_printf</em>(&fil, "%-8s", "abc"); <span class="c">/* "abc " */</span>
|
<em>f_printf</em>(&fil, "%-8s", "abc"); <span class="c">/* "abc " */</span>
|
||||||
<em>f_printf</em>(&fil, "%c", 'a'); <span class="c">/* "a" */</span>
|
<em>f_printf</em>(&fil, "%c", 'a'); <span class="c">/* "a" */</span>
|
||||||
<em>f_printf</em>(&fil, "%f", 10.0); <span class="c">/* <em>f_printf</em> lacks floating point support */</span>
|
<em>f_printf</em>(&fil, "%f", 10.0); <span class="c">/* f_printf lacks floating point support */</span>
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
+10
-6
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/putc.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/putc.html">
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
<p>The f_putc funciton puts a character to the file.</p>
|
<p>The f_putc funciton puts a character to the file.</p>
|
||||||
<pre>
|
<pre>
|
||||||
int f_putc (
|
int f_putc (
|
||||||
TCHAR <span class="arg">chr</span>, <span class="c">/* [IN] A character to put */</span>
|
TCHAR <span class="arg">chr</span>, <span class="c">/* [IN] A character to write */</span>
|
||||||
FIL* <span class="arg">fp</span> <span class="c">/* [IN] File object */</span>
|
FIL* <span class="arg">fp</span> <span class="c">/* [IN] File object */</span>
|
||||||
);
|
);
|
||||||
</pre>
|
</pre>
|
||||||
@@ -26,7 +26,7 @@ int f_putc (
|
|||||||
<h4>Parameters</h4>
|
<h4>Parameters</h4>
|
||||||
<dl class="par">
|
<dl class="par">
|
||||||
<dt>chr</dt>
|
<dt>chr</dt>
|
||||||
<dd>A character to be put.</dd>
|
<dd>A character to write.</dd>
|
||||||
<dt>fp</dt>
|
<dt>fp</dt>
|
||||||
<dd>Pointer to the open file object structuer.</dd>
|
<dd>Pointer to the open file object structuer.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
@@ -35,14 +35,18 @@ int f_putc (
|
|||||||
|
|
||||||
<div class="para ret">
|
<div class="para ret">
|
||||||
<h4>Return Values</h4>
|
<h4>Return Values</h4>
|
||||||
<p>When the character was written successfuly, it returns number of characters written. When the function failed due to disk full or any error, an <tt>EOF (-1)</tt> will be returned.</p>
|
<p>When the character was written successfuly, it returns number of character encoding units written to the file. When the function failed due to disk full or any error, an <tt>EOF (-1)</tt> will be returned.</p>
|
||||||
<p>When FatFs is configured to Unicode API (<tt>FF_LFN_UNICODE == 1</tt>), character encoding on the string fuctions, <tt>f_putc</tt>, <tt>f_puts</tt>, <tt>f_printf</tt> and <tt>f_gets</tt> function, is also switched to Unicode. The character encoding on the file to be read/written via those functions is selected by <tt>FF_STRF_ENCODE</tt> option.</p>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="para desc">
|
||||||
|
<h4>Description</h4>
|
||||||
|
<p>When FatFs is configured for Unicode API (<tt><a href="config.html#lfn_unicode">FF_LFN_UNICODE</a> >= 1</tt>), character encoding on the string fuctions, <tt>f_putc</tt>, <tt>f_puts</tt>, <tt>f_printf</tt> and <tt>f_gets</tt> function, is also switched to Unicode. The character encoding <em>on the file</em> to be read/written via those functions is selected by <tt><a href="config.html#strf_encode">FF_STRF_ENCODE</a></tt>. The Unicode characters in multiple encoding unit, such as surrogate pair and multi-byte sequence, cannot be written with this function.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>This is a wrapper function of <a href="write.html"><tt>f_write</tt></a> function. Available when <tt>FF_FS_READONLY == 0</tt> and <tt>FF_USE_STRFUNC</tt> is 1 or 2. When it is set to 2, a <tt>'\n'</tt> is converted to <tt>'\r'+'\n'</tt>.</p>
|
<p>This is a wrapper function of <a href="write.html"><tt>f_write</tt></a> function. Available when <tt><a href="config.html#fs_readonly">FF_FS_READONLY</a> == 0</tt> and <tt><a href="config.html#use_strfunc">FF_USE_STRFUNC</a> >= 1</tt>. When <tt>FF_USE_STRFUNC == 2</tt>, a <tt>'\n'</tt> is output as <tt>'\r'+'\n'</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/puts.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/puts.html">
|
||||||
@@ -35,14 +35,19 @@ int f_puts (
|
|||||||
|
|
||||||
<div class="para ret">
|
<div class="para ret">
|
||||||
<h4>Return Value</h4>
|
<h4>Return Value</h4>
|
||||||
<p>When the function succeeded, it returns number of characters written. When the write operation is aborted due to disk full or any error, an <tt>EOF (-1)</tt> will be returned.</p>
|
<p>When the string was written successfuly, it returns number of character encoding units written to the file. When the function failed due to disk full or any error, an EOF (-1) will be returned.</p>
|
||||||
<p>When FatFs is configured to Unicode API (<tt>FF_LFN_UNICODE == 1</tt>), character encoding on the srting fuctions, <tt>f_putc</tt>, <tt>f_puts</tt>, <tt>f_printf</tt> and <tt>f_gets</tt> function, is also switched to Unicode. The character encoding on the file to be read/written via those functions is selected by <tt>FF_STRF_ENCODE</tt> option.</p>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="para desc">
|
||||||
|
<h4>Description</h4>
|
||||||
|
<p>When FatFs is configured for Unicode API (<tt><a href="config.html#lfn_unicode">FF_LFN_UNICODE</a> >= 1</tt>), character encoding on the string fuctions, <tt>f_putc</tt>, <tt>f_puts</tt>, <tt>f_printf</tt> and <tt>f_gets</tt> function, is also switched to Unicode. The input Unicode characters in multiple encoding unit, such as surrogate pair and multi-byte sequence, should not be divided into two function calls, or the character will be lost. The character encoding <em>on the file</em> to be written via this functions is selected by <tt><a href="config.html#strf_encode">FF_STRF_ENCODE</a></tt>. The characters with wrong encoding or invalid for the output encoding will be lost.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>This is a wrapper function of <a href="write.html"><tt>f_write</tt></a> function. Available when <tt>FF_FS_READONLY == 0</tt> and <tt>FF_USE_STRFUNC</tt> is 1 or 2. When it is set to 2, <tt>'\n'</tt>s contained in the string are converted to <tt>'\r'+'\n'</tt>.</p>
|
<p>This is a wrapper function of <a href="write.html"><tt>f_write</tt></a> function. Available when <tt><a href="config.html#fs_readonly">FF_FS_READONLY</a> == 0</tt> and <tt><a href="config.html#use_strfunc">FF_USE_STRFUNC</a> >= 1</tt>. When <tt>FF_USE_STRFUNC == 2</tt>, <tt>'\n'</tt>s contained in the input string are output as <tt>'\r'+'\n'</tt> each.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+20
-13
@@ -19,7 +19,7 @@
|
|||||||
<dd>The function succeeded.</dd>
|
<dd>The function succeeded.</dd>
|
||||||
|
|
||||||
<dt id="de">FR_DISK_ERR</dt>
|
<dt id="de">FR_DISK_ERR</dt>
|
||||||
<dd>The lower layer, <tt>disk_read</tt>, <tt>disk_write</tt> or <tt>disk_ioctl</tt> function, reported that an unrecoverable hard error occured.<br>Note that if once this error occured at any operation to an open file, the file object is aborted and all operations to the file except for close will be rejected.</dd>
|
<dd>The lower layer, <tt>disk_read</tt>, <tt>disk_write</tt> or <tt>disk_ioctl</tt> function, reported that an unrecoverable hard error occured.<br>Note that if once this error occured at any operation to an open file, the file object is aborted and any operations to the file except for close will be rejected.</dd>
|
||||||
|
|
||||||
<dt id="ie">FR_INT_ERR</dt>
|
<dt id="ie">FR_INT_ERR</dt>
|
||||||
<dd>Assertion failed. An insanity is detected in the internal process. One of the following possibilities is suspected.
|
<dd>Assertion failed. An insanity is detected in the internal process. One of the following possibilities is suspected.
|
||||||
@@ -27,6 +27,7 @@
|
|||||||
<li>Work area (file system object, file object or etc...) has been broken by stack overflow or any other tasks. This is the reason in most case.</li>
|
<li>Work area (file system object, file object or etc...) has been broken by stack overflow or any other tasks. This is the reason in most case.</li>
|
||||||
<li>There is an error of the FAT structure on the volume.</li>
|
<li>There is an error of the FAT structure on the volume.</li>
|
||||||
<li>There is a bug in the FatFs module itself.</li>
|
<li>There is a bug in the FatFs module itself.</li>
|
||||||
|
<li>Wrong lower layer implementation.</li>
|
||||||
</ul>
|
</ul>
|
||||||
Note that if once this error occured at any operation to an open file, the file object is aborted and all operations to the file except for close will be rejected.
|
Note that if once this error occured at any operation to an open file, the file object is aborted and all operations to the file except for close will be rejected.
|
||||||
</dd>
|
</dd>
|
||||||
@@ -35,20 +36,27 @@ Note that if once this error occured at any operation to an open file, the file
|
|||||||
<dd>The lower layer, <a href="dinit.html"><tt>disk_initialize</tt></a> function, reported that the storage device could not be got ready to work. One of the following possibilities is suspected.
|
<dd>The lower layer, <a href="dinit.html"><tt>disk_initialize</tt></a> function, reported that the storage device could not be got ready to work. One of the following possibilities is suspected.
|
||||||
<ul>
|
<ul>
|
||||||
<li>No medium in the drive.</li>
|
<li>No medium in the drive.</li>
|
||||||
<li>Wrong lower layer implementation for the storage device.</li>
|
<li>Wrong lower layer implementation.</li>
|
||||||
<li>Wrong hardware configuration.</li>
|
<li>Wrong hardware configuration.</li>
|
||||||
<li>The storage device is broken.</li>
|
<li>The storage device has broken.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
<dt id="nf">FR_NO_FILE</dt>
|
<dt id="nf">FR_NO_FILE</dt>
|
||||||
<dd>Could not find the file.</dd>
|
<dd>Could not find the file in the directory.</dd>
|
||||||
|
|
||||||
<dt id="np">FR_NO_PATH</dt>
|
<dt id="np">FR_NO_PATH</dt>
|
||||||
<dd>Could not find the path.</dd>
|
<dd>Could not find the path, some directory in the path name could not be found.</dd>
|
||||||
|
|
||||||
<dt id="in">FR_INVALID_NAME</dt>
|
<dt id="in">FR_INVALID_NAME</dt>
|
||||||
<dd>The given string is invalid as the <a href="filename.html">path name</a>.</dd>
|
<dd>The given string is invalid as the <a href="filename.html">path name</a>. One of the following possibilities is suspected.
|
||||||
|
<ul>
|
||||||
|
<li>There is any character not allowed for the file name.</li>
|
||||||
|
<li>The string is out of 8.3 format. (at non-LFN cfg.)</li>
|
||||||
|
<li><tt>FF_MAX_LFN</tt> is insufficient for the file name. (at LFN cfg.)</li>
|
||||||
|
<li>There is any character encoding error in the string.</li>
|
||||||
|
</ul>
|
||||||
|
</dd>
|
||||||
|
|
||||||
<dt id="dn">FR_DENIED</dt>
|
<dt id="dn">FR_DENIED</dt>
|
||||||
<dd>The required access was denied due to one of the following reasons:
|
<dd>The required access was denied due to one of the following reasons:
|
||||||
@@ -64,13 +72,13 @@ Note that if once this error occured at any operation to an open file, the file
|
|||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
<dt id="ex">FR_EXIST</dt>
|
<dt id="ex">FR_EXIST</dt>
|
||||||
<dd>Name collision. An object with the same name is already existing.</dd>
|
<dd>Name collision, an object with the same name is already existing.</dd>
|
||||||
|
|
||||||
<dt id="io">FR_INVALID_OBJECT</dt>
|
<dt id="io">FR_INVALID_OBJECT</dt>
|
||||||
<dd>The file/directory object is invalid or a null pointer is given. There are some reasons as follows:
|
<dd>The file/directory object is invalid or a null pointer is given. There are some reasons as follows:
|
||||||
<ul>
|
<ul>
|
||||||
<li>It has been closed, it has not been opened or it has been collapsed.</li>
|
<li>It has been closed, or the structure has been collapsed.</li>
|
||||||
<li>It has been invalidated by a voulme mount process. Open objects on the volume are invalidated by voulme mount process.</li>
|
<li>It has been invalidated. Open objects on the volume are invalidated by voulme mount process.</li>
|
||||||
<li>Physical drive is not ready to work due to a media removal.</li>
|
<li>Physical drive is not ready to work due to a media removal.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -85,14 +93,13 @@ Note that if once this error occured at any operation to an open file, the file
|
|||||||
<dd>Work area for the logical drive has not been registered by <tt>f_mount</tt> function.</dd>
|
<dd>Work area for the logical drive has not been registered by <tt>f_mount</tt> function.</dd>
|
||||||
|
|
||||||
<dt id="ns">FR_NO_FILESYSTEM</dt>
|
<dt id="ns">FR_NO_FILESYSTEM</dt>
|
||||||
<dd>There is no valid FAT volume on the drive.</dd>
|
<dd>There is no valid FAT volume on the drive or wrong lower layer implementation.</dd>
|
||||||
|
|
||||||
<dt id="ma">FR_MKFS_ABORTED</dt>
|
<dt id="ma">FR_MKFS_ABORTED</dt>
|
||||||
<dd>The <tt>f_mkfs</tt> function aborted before start in format due to a reason as follows:
|
<dd>The <tt>f_mkfs</tt> function aborted before start in format due to a reason as follows:
|
||||||
<ul>
|
<ul>
|
||||||
<li>It is pmpossible to formart with the given parameters.</li>
|
<li>It is impossible to format with the given parameters.</li>
|
||||||
<li>The size of volume is too small.</li>
|
<li>The size of volume is too small. 128 sectors minimum with <tt>FM_SFD</tt>.</li>
|
||||||
<li>The size of given work area is too small.</li>
|
|
||||||
<li>The partition bound to the logical drive coulud not be found. (Related option: <tt><a href="config.html#multi_partition">FF_MULTI_PARTITION</a></tt>)</li>
|
<li>The partition bound to the logical drive coulud not be found. (Related option: <tt><a href="config.html#multi_partition">FF_MULTI_PARTITION</a></tt>)</li>
|
||||||
</ul>
|
</ul>
|
||||||
</dd>
|
</dd>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/read.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/read.html">
|
||||||
@@ -34,7 +34,7 @@ FRESULT f_read (
|
|||||||
<dt>btr</dt>
|
<dt>btr</dt>
|
||||||
<dd>Number of bytes to read in range of <tt>UINT</tt> type.</dd>
|
<dd>Number of bytes to read in range of <tt>UINT</tt> type.</dd>
|
||||||
<dt>br</dt>
|
<dt>br</dt>
|
||||||
<dd>Pointer to the <tt>UINT</tt> variable to return number of bytes read. This value is always valid after the function call regardless of the return value.</dd>
|
<dd>Pointer to the <tt>UINT</tt> variable to return number of bytes read. This value is always valid after the function call regardless of the function return code.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
+11
-10
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/readdir.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/readdir.html">
|
||||||
@@ -26,9 +26,9 @@ FRESULT f_readdir (
|
|||||||
<h4>Parameters</h4>
|
<h4>Parameters</h4>
|
||||||
<dl class="par">
|
<dl class="par">
|
||||||
<dt>dp</dt>
|
<dt>dp</dt>
|
||||||
<dd>Pointer to the open directory object or null pointer.</dd>
|
<dd>Pointer to the open directory object.</dd>
|
||||||
<dt>fno</dt>
|
<dt>fno</dt>
|
||||||
<dd>Pointer to the <a href="sfileinfo.html">file information structure</a> to store the information about read item.</dd>
|
<dd>Pointer to the <a href="sfileinfo.html">file information structure</a> to store the information about read item. A null pointer rewinds the read index of the directory.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -48,20 +48,21 @@ FRESULT f_readdir (
|
|||||||
|
|
||||||
<div class="para desc">
|
<div class="para desc">
|
||||||
<h4>Description</h4>
|
<h4>Description</h4>
|
||||||
<p>The <tt>f_readdir</tt> function reads a directory item, informations about the object. All items in the directory can be read in sequence by <tt>f_readdir</tt> function calls. Dot entries (<tt>"."</tt> and <tt>".."</tt>) in the sub-directory are filtered out and they will never appear in the read items. When all directory items have been read and no item to read, a nul string is stored into the <tt>fno->fname[]</tt> without any error. When a null pointer is given to the <tt class="arg">fno</tt>, the read index of the directory object is rewinded.</p>
|
<p>The <tt>f_readdir</tt> function reads a directory item, informations about the object. Every item in the directory can be read in sequence by <tt>f_readdir</tt> function calls. Dot entries (<tt>"."</tt> and <tt>".."</tt>) in the sub-directory are filtered out and they will never appear in the read items. When all directory items have been read and no item to read, a null string is stored into the <tt>fno->fname[]</tt> without any error. When a null pointer is given to the <tt class="arg">fno</tt>, the read index of the directory object is rewinded.</p>
|
||||||
<p>When support of long file name (LFN) is enabled, a member <tt>altname[]</tt> is defined in the file information structure to store the short file name of the object. In case of the some conditions listed below, short file name is stored into the <tt>fname[]</tt> and <tt>altname[]</tt> has a null string.</p>
|
<p>When support of long file name (LFN) is enabled, a member <tt>altname[]</tt> is defined in the file information structure to store the short file name of the object. If the long file name is not accessible due to some reason listed below, short file name is stored to the <tt>fname[]</tt> and <tt>altname[]</tt> has a null string.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>The item has no long file name. (Not the case at exFAT volume)</li>
|
<li>The item has no LFN. (Not the case at exFAT volume)</li>
|
||||||
<li>Setting of <tt>FF_MAX_LFN</tt> is insufficient for the long file name. (Not the case at <tt>FF_MAX_LFN == 255</tt>)</li>
|
<li>Setting of <a href="config.html#max_lfn"><tt>FF_MAX_LFN</tt></a> is insufficient to handle the LFN. (Not the case at <tt>FF_MAX_LFN == 255</tt>)</li>
|
||||||
<li>The long file name contains any character not allowed in ANSI/OEM code. (Not the case at <tt>FF_LFN_UNICODE == 1</tt>)</li>
|
<li>Setting of <a href="config.html#lfn_buf"><tt>FF_LFN_BUF</tt></a> is insufficient to store the LFN.</li>
|
||||||
|
<li>The LFN contains some character not defined in current code page. (Not the case at <tt>FF_LFN_UNICODE >= 1</tt>)</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>There is a problem on reading a directory of exFAT volume. The exFAT does not support short file name. This means no name can be returned on the condition above. If it is the case, "?" is returned into the <tt>fname[]</tt> to indicate that the object is not accessible. To avoid this problem, configure FatFs <tt>FF_LFN_UNICODE = 1</tt> and <tt>FF_MAX_LFN = 255</tt> to support the full feature of LFN specification.</p>
|
<p>There is a problem on reading a directory of exFAT volume. The exFAT does not support short file name. This means no name can be returned on the condition above. If it is the case, "?" is returned into the <tt>fname[]</tt> to indicate that the object is not accessible. To avoid this problem, configure FatFs <tt><a href="config.html#lfn_unicode">FF_LFN_UNICODE</a> >= 1</tt> and <tt>FF_MAX_LFN == 255</tt> to support the full feature of LFN specification.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_FS_MINIMIZE <= 1</tt>.</p>
|
<p>Available when <tt><a href="config.html#fs_minimize">FF_FS_MINIMIZE</a> <= 1</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/rename.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/rename.html">
|
||||||
@@ -63,7 +63,7 @@ FRESULT f_rename (
|
|||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_FS_READONLY == 0</tt> and <tt>FF_FS_MINIMIZE == 0</tt>.</p>
|
<p>Available when <tt><a href="config.html#fs_readonly">FF_FS_READONLY</a> == 0</tt> and <tt><a href="config.html#fs_minimize">FF_FS_MINIMIZE</a> == 0</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/sdir.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/sdir.html">
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<div class="para">
|
<div class="para">
|
||||||
<h2>DIR</h2>
|
<h2>DIR</h2>
|
||||||
<p>The <tt>DIR</tt> structure is used for the work area to read a directory by <tt>f_oepndir</tt>, <tt>f_readdir</tt>, <tt>f_findfirst</tt> and <tt>f_findnext</tt> function. Application program must not modify any member in this structure, or any file on the volume can be collapsed.</p>
|
<p>The <tt>DIR</tt> structure is used for the work area to read a directory by <tt>f_oepndir</tt>, <tt>f_readdir</tt>, <tt>f_findfirst</tt> and <tt>f_findnext</tt> function. Application program <em>must not</em> modify any member in this structure, or <tt>f_readdir</tt> function will not work properly.</p>
|
||||||
<pre>
|
<pre>
|
||||||
<span class="k">typedef</span> <span class="k">struct</span> {
|
<span class="k">typedef</span> <span class="k">struct</span> {
|
||||||
FFOBJID obj; <span class="c">/* Object identifier */</span>
|
FFOBJID obj; <span class="c">/* Object identifier */</span>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/getcwd.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/getcwd.html">
|
||||||
@@ -28,7 +28,7 @@ FRESULT f_setcp (
|
|||||||
<dd>OEM code page to be used for the path name. Valid values are as follows.<br>
|
<dd>OEM code page to be used for the path name. Valid values are as follows.<br>
|
||||||
<table class="lst1">
|
<table class="lst1">
|
||||||
<tr><th>Value</th><th>Meaning</th></tr>
|
<tr><th>Value</th><th>Meaning</th></tr>
|
||||||
<tr><td>0</td><td>Initial value (non-ASCII character cannot be used)</td></tr>
|
<tr><td>0</td><td>Initial value (any extended character cannot be used)</td></tr>
|
||||||
<tr><td>437</td><td>U.S.</td></tr>
|
<tr><td>437</td><td>U.S.</td></tr>
|
||||||
<tr><td>720</td><td>Arabic</td></tr>
|
<tr><td>720</td><td>Arabic</td></tr>
|
||||||
<tr><td>737</td><td>Greek</td></tr>
|
<tr><td>737</td><td>Greek</td></tr>
|
||||||
@@ -67,13 +67,13 @@ FRESULT f_setcp (
|
|||||||
|
|
||||||
<div class="para desc">
|
<div class="para desc">
|
||||||
<h4>Description</h4>
|
<h4>Description</h4>
|
||||||
<p>The <tt>f_setcp</tt> function sets the active code page for the path name. Also code conversion of string functions will be affected by the code page when <tt>FF_LFN_UNICODE = 1</tt> and <tt>FF_STRF_ENCODE = 0</tt>. Because the initial setting of the code page is 0 and API function with non-ASCII character will not work properly. Any valid code page needs to be set on the system start-up and it should not be changed on the fly.</p>
|
<p>The <tt>f_setcp</tt> function sets the active code page for the path name. Also code conversion of string functions will be affected by the setting of code page when <tt><a href="config.html#lfn_unicode">FF_LFN_UNICODE</a> >= 1</tt> and <tt><a href="config.html#strf_encode">FF_STRF_ENCODE</a> == 0</tt>. Because the initial setting of the code page is 0 and API function with extended character will not work properly, a valid code page needs to be set on the system start-up and it should not be changed on the fly.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_CODE_PAGE == 0</tt>.</p>
|
<p>Available when <tt><a href="config.html#code_page">FF_CODE_PAGE</a> == 0</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/setlabel.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/setlabel.html">
|
||||||
@@ -49,19 +49,20 @@ FRESULT f_setlabel (
|
|||||||
|
|
||||||
<div class="para desc">
|
<div class="para desc">
|
||||||
<h4>Description</h4>
|
<h4>Description</h4>
|
||||||
<p>When the string has a drive number, the volume label will be set to the volume specified by the drive number. If not, the volume label will be set to the default drive. If length of the given volume label is zero, the volume label on the volume will be removed. The format of the volume label on the FAT volume is similar to the file name but there are some differences shown below:</p>
|
<p>When the string has a drive prefix, the volume label will be set to the volume specified by the drive prefix. Unix style volume ID cannot be used to specify the volume. If drive number is not specified, the volume label will be set to the default drive. If length of the given volume label is zero, the volume label on the volume will be removed. The format of the volume label is as shown below:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Period is not allowed.</li>
|
|
||||||
<li>Spaces can be contained anywhere in the volume label. Trailing spaces are truncated off at FAT volume.</li>
|
|
||||||
<li>Up to 11 bytes long as conversion of OEM code page at FAT volume.</li>
|
<li>Up to 11 bytes long as conversion of OEM code page at FAT volume.</li>
|
||||||
<li>Up to 11 characters long at exFAT volume. Lower case is preserved.</li>
|
<li>Up to 11 characters long at exFAT volume.</li>
|
||||||
|
<li>Allowable characters for FAT volume are: characters allowed for SFN excludes dot. Low-case characters are up converted.</li>
|
||||||
|
<li>Allowable characters for exFAT volume are: characters allowed for LFN includes dot. Low-case characters are preserved.</li>
|
||||||
|
<li>Spaces can be embedded anywhere in the volume label. Trailing spaces are truncated off at FAT volume.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>Remark: The standard system (Windows) has a problem at the volume label with a heading <tt>\xE5</tt> on the FAT volume. To avoid this problem, this function rejects such volume label as invalid name.</p>
|
<p>Remark: The standard system (Windows) has a problem at the volume label with a heading <tt>\xE5</tt> on the FAT volume. To avoid this problem, this function rejects such volume label as invalid name.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_FS_READONLY == 0</tt> and <tt>FF_USE_LABEL == 1</tt>.</p>
|
<p>Available when <tt><a href="config.html#fs_readonly">FF_FS_READONLY</a> == 0</tt> and <tt><a href="config.html#use_label">FF_USE_LABEL</a> == 1</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/sfatfs.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/sfatfs.html">
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<div class="para">
|
<div class="para">
|
||||||
<h2>FATFS</h2>
|
<h2>FATFS</h2>
|
||||||
<p>The <tt>FATFS</tt> structure (filesystem object) holds dynamic work area of individual logical drives. It is given by application program and registerd/unregisterd to the FatFs module with <tt>f_mount</tt> function. Initialization of the structure is done by volume mount process whenever necessary. Application program must not modify any member in this structure, or the FAT volume can be collapsed.</p>
|
<p>The <tt>FATFS</tt> structure (filesystem object) holds dynamic work area of individual logical drives. It is given by application program and registerd/unregisterd to the FatFs module with <tt>f_mount</tt> function. Initialization of the structure is done by volume mount process whenever necessary. Application program <em>must not</em> modify any member in this structure, or the FAT volume will be collapsed.</p>
|
||||||
<pre>
|
<pre>
|
||||||
<span class="k">typedef</span> <span class="k">struct</span> {
|
<span class="k">typedef</span> <span class="k">struct</span> {
|
||||||
BYTE fs_type; <span class="c">/* FAT type (0, FS_FAT12, FS_FAT16, FS_FAT32 or FS_EXFAT) */</span>
|
BYTE fs_type; <span class="c">/* FAT type (0, FS_FAT12, FS_FAT16, FS_FAT32 or FS_EXFAT) */</span>
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
<span class="k">#if</span> FF_MAX_SS != FF_MIN_SS
|
<span class="k">#if</span> FF_MAX_SS != FF_MIN_SS
|
||||||
WORD ssize; <span class="c">/* Sector size (512,1024,2048 or 4096) */</span>
|
WORD ssize; <span class="c">/* Sector size (512,1024,2048 or 4096) */</span>
|
||||||
<span class="k">#endif</span>
|
<span class="k">#endif</span>
|
||||||
<span class="k">#if FF_FS_EXFAT</span>
|
<span class="k">#if</span> FF_FS_EXFAT
|
||||||
BYTE* dirbuf; <span class="c">/* Directory entry block scratchpad buffer */</span>
|
BYTE* dirbuf; <span class="c">/* Directory entry block scratchpad buffer */</span>
|
||||||
<span class="k">#endif</span>
|
<span class="k">#endif</span>
|
||||||
<span class="k">#if</span> FF_FS_REENTRANT
|
<span class="k">#if</span> FF_FS_REENTRANT
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
<span class="k">#endif</span>
|
<span class="k">#endif</span>
|
||||||
<span class="k">#if</span> FF_FS_RPATH
|
<span class="k">#if</span> FF_FS_RPATH
|
||||||
DWORD cdir; <span class="c">/* Cluster number of current directory (0:root) */</span>
|
DWORD cdir; <span class="c">/* Cluster number of current directory (0:root) */</span>
|
||||||
<span class="k">#if FF_FS_EXFAT</span>
|
<span class="k">#if</span> FF_FS_EXFAT
|
||||||
DWORD cdc_scl; <span class="c">/* Containing directory start cluster (invalid when cdir is 0) */</span>
|
DWORD cdc_scl; <span class="c">/* Containing directory start cluster (invalid when cdir is 0) */</span>
|
||||||
DWORD cdc_size; <span class="c">/* b31-b8:Size of containing directory, b7-b0: Chain status */</span>
|
DWORD cdc_size; <span class="c">/* b31-b8:Size of containing directory, b7-b0: Chain status */</span>
|
||||||
DWORD cdc_ofs; <span class="c">/* Offset in the containing directory (invalid when cdir is 0) */</span>
|
DWORD cdc_ofs; <span class="c">/* Offset in the containing directory (invalid when cdir is 0) */</span>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/sfile.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/sfile.html">
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<div class="para">
|
<div class="para">
|
||||||
<h2>FIL</h2>
|
<h2>FIL</h2>
|
||||||
<p>The <tt>FIL</tt> structure (file object) holds the state of an open file. It is created by <tt>f_open</tt> function and discarded by <tt>f_close</tt> function. Application program must not modify any member in this structure except for <tt>cltbl</tt>, or any data on the FAT volume can be collapsed. Note that a sector buffer is defined in this structure at non-tiny configuration (<tt>FF_FS_TINY == 0</tt>), so that the <tt>FIL</tt> structures at that configuration should not be defined as auto variable.</p>
|
<p>The <tt>FIL</tt> structure (file object) holds the state of an open file. It is created by <tt>f_open</tt> function and discarded by <tt>f_close</tt> function. Application program <em>must not</em> modify any member in this structure except for <tt>cltbl</tt>, or the FAT volume will be collapsed. Note that a sector buffer is defined in this structure at non-tiny configuration (<tt><a href="config.html#fs_tiny">FF_FS_TINY</a> == 0</tt>), so that the <tt>FIL</tt> structures at that configuration should not be defined as auto variable.</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<span class="k">typedef</span> <span class="k">struct</span> {
|
<span class="k">typedef</span> <span class="k">struct</span> {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/sfileinfo.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/sfileinfo.html">
|
||||||
@@ -21,10 +21,10 @@
|
|||||||
WORD ftime; <span class="c">/* Last modified time */</span>
|
WORD ftime; <span class="c">/* Last modified time */</span>
|
||||||
BYTE fattrib; <span class="c">/* Attribute */</span>
|
BYTE fattrib; <span class="c">/* Attribute */</span>
|
||||||
<span class="k">#if</span> FF_USE_LFN
|
<span class="k">#if</span> FF_USE_LFN
|
||||||
TCHAR altname[13]; <span class="c">/* Alternative object name */</span>
|
TCHAR altname[FF_SFN_BUF + 1]; <span class="c">/* Alternative object name */</span>
|
||||||
TCHAR fname[FF_MAX_LFN + 1]; <span class="c">/* Primary object name */</span>
|
TCHAR fname[FF_LFN_BUF + 1]; <span class="c">/* Primary object name */</span>
|
||||||
<span class="k">#else</span>
|
<span class="k">#else</span>
|
||||||
TCHAR fname[13]; <span class="c">/* Object name */</span>
|
TCHAR fname[12 + 1]; <span class="c">/* Object name */</span>
|
||||||
<span class="k">#endif</span>
|
<span class="k">#endif</span>
|
||||||
} FILINFO;
|
} FILINFO;
|
||||||
</pre>
|
</pre>
|
||||||
@@ -57,9 +57,18 @@
|
|||||||
</dl>
|
</dl>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>fattrib</dt>
|
<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>
|
<dd>Indicates the attribute flags in combination of:<br>
|
||||||
|
<table class="lst">
|
||||||
|
<tr><th>Flag</th><th>Meaning</th></tr>
|
||||||
|
<tr><td>AM_RDO</td><td>Read-only. Write mode open and deleting is rejected.</td></tr>
|
||||||
|
<tr><td>AM_HID</td><td>Hidden. Should not be shown in normal directory listing.</td></tr>
|
||||||
|
<tr><td>AM_SYS</td><td>System. Used by system and should not be accessed.</td></tr>
|
||||||
|
<tr><td>AM_ARC</td><td>Archive. Set on new creation or any modification to the file.</td></tr>
|
||||||
|
<tr><td>AM_DIR</td><td>Directory. This is not a file but a sub-directory container.</td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
<dt>fname[]</dt>
|
<dt>fname[]</dt>
|
||||||
<dd>The null-terminated object name is stored. A null string is stored when no item to read and it indicates this structure is invalid.</dd>
|
<dd>The null-terminated object name is stored. A null string is stored when no item to read and it indicates this structure is invalid. The size of <tt>fname[]</tt> and <tt>altname[]</tt> each can be configured at LFN configuration.</dd>
|
||||||
<dt>altname[]</dt>
|
<dt>altname[]</dt>
|
||||||
<dd>Alternative object name is stored if available. This member is not available at non-LFN configuration.</dd>
|
<dd>Alternative object name is stored if available. This member is not available at non-LFN configuration.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/size.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/size.html">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/stat.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/stat.html">
|
||||||
@@ -26,7 +26,7 @@ FRESULT f_stat (
|
|||||||
<h4>Parameters</h4>
|
<h4>Parameters</h4>
|
||||||
<dl class="par">
|
<dl class="par">
|
||||||
<dt>path</dt>
|
<dt>path</dt>
|
||||||
<dd>Pointer to the null-terminated string that specifies the <a href="filename.html">object</a> to get its information.</dd>
|
<dd>Pointer to the null-terminated string that specifies the <a href="filename.html">object</a> to get its information. The object must not be the root direcotry.</dd>
|
||||||
<dt>fno</dt>
|
<dt>fno</dt>
|
||||||
<dd>Pointer to the blank <tt>FILINFO</tt> structure to store the information of the object. Set null pointer if it is not needed.</dd>
|
<dd>Pointer to the blank <tt>FILINFO</tt> structure to store the information of the object. Set null pointer if it is not needed.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
@@ -60,7 +60,7 @@ FRESULT f_stat (
|
|||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_FS_MINIMIZE == 0</tt>.</p>
|
<p>Available when <tt><a href="config.html#fs_minimize">FF_FS_MINIMIZE</a> == 0</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+26
-3
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/sync.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/sync.html">
|
||||||
@@ -44,14 +44,37 @@ FRESULT f_sync (
|
|||||||
|
|
||||||
<div class="para desc">
|
<div class="para desc">
|
||||||
<h4>Description</h4>
|
<h4>Description</h4>
|
||||||
<p>The <tt>f_sync</tt> function performs the same process as <tt>f_close</tt> function but the file is left opened and can continue read/write/seek operations to the file. This is suitable for the applications that open files for a long time in write mode, such as data logger. Performing <tt>f_sync</tt> function of periodic or immediataly after <tt>f_write</tt> function can minimize the risk of data loss due to a sudden blackout or an unintentional media removal. For more information, refer to <a href="appnote.html#critical">application note</a>.</p>
|
<p>The <tt>f_sync</tt> function performs the same process as <tt>f_close</tt> function but the file is left opened and can continue read/write/seek operations to the file. This is suitable for the applications that open files for a long time in write mode, such as data logger. Performing <tt>f_sync</tt> function in certain interval can minimize the risk of data loss due to a sudden blackout or an unintentional media removal. For more information, refer to <a href="appnote.html#critical">application note</a>.</p>
|
||||||
|
<pre>
|
||||||
|
Case 1. Normal write sequence
|
||||||
|
|
||||||
|
Time --> ↓Power off after close
|
||||||
|
OwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwC
|
||||||
|
|
||||||
|
|
||||||
|
Case 2. Without using f_sync()
|
||||||
|
|
||||||
|
Time --> ↓System crush
|
||||||
|
O<span class="e">wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww</span>
|
||||||
|
|<--------------- All data written will be lost ------------------>|
|
||||||
|
|
||||||
|
|
||||||
|
Case 3. Using f_sync()
|
||||||
|
Time --> ↓System crush
|
||||||
|
OwwwwwwwwSwwwwwwwwSwwwwwwwwSwwwwwwwwSwwwwwwwwSwwwwwwwwSwwwwwwwwS<span class="e">wwwww</span>
|
||||||
|
Data after last f_sync will be lost |<->|
|
||||||
|
O - f_open()
|
||||||
|
C - f_close()
|
||||||
|
w - f_write()
|
||||||
|
S - f_sync()
|
||||||
|
</pre>
|
||||||
<p>However there is no sense in <tt>f_sync</tt> function immediataly before <tt>f_close</tt> function because it performs <tt>f_sync</tt> function in it. In other words, the differnce between those functions is that the file object is invalidated or not.</p>
|
<p>However there is no sense in <tt>f_sync</tt> function immediataly before <tt>f_close</tt> function because it performs <tt>f_sync</tt> function in it. In other words, the differnce between those functions is that the file object is invalidated or not.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_FS_READONLY == 0</tt>.</p>
|
<p>Available when <tt><a href="config.html#fs_readonly">FF_FS_READONLY</a> == 0</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/tell.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/tell.html">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/truncate.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/truncate.html">
|
||||||
@@ -51,7 +51,7 @@ FRESULT f_truncate (
|
|||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_FS_READONLY == 0</tt> and <tt>FF_FS_MINIMIZE == 0</tt>.</p>
|
<p>Available when <tt><a href="config.html#fs_readonly">FF_FS_READONLY</a> == 0</tt> and <tt><a href="config.html#fs_minimize">FF_FS_MINIMIZE</a> == 0</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/unlink.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/unlink.html">
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<div class="para func">
|
<div class="para func">
|
||||||
<h2>f_unlink</h2>
|
<h2>f_unlink</h2>
|
||||||
<p>The f_unlink function removes a file or sub-directory.</p>
|
<p>The f_unlink function removes a file or sub-directory from the volume.</p>
|
||||||
<pre>
|
<pre>
|
||||||
FRESULT f_unlink (
|
FRESULT f_unlink (
|
||||||
const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] Object name */</span>
|
const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] Object name */</span>
|
||||||
@@ -65,7 +65,7 @@ If condition of the object to be removed is applicable to the following terms, t
|
|||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_FS_READONLY == 0</tt> and <tt>FF_FS_MINIMIZE == 0</tt>.</p>
|
<p>Available when <tt><a href="config.html#fs_readonly">FF_FS_READONLY</a> == 0</tt> and <tt><a href="config.html#fs_minimize">FF_FS_MINIMIZE</a> == 0</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/utime.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/utime.html">
|
||||||
@@ -85,7 +85,7 @@ FRESULT set_timestamp (
|
|||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_FS_READONLY == 0</tt> and <tt>FF_USE_CHMOD == 1</tt>.</p>
|
<p>Available when <tt><a href="config.html#fs_readonly">FF_FS_READONLY</a> == 0</tt> and <tt><a href="config.html#use_chmod">FF_USE_CHMOD</a> == 1</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/write.html">
|
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/write.html">
|
||||||
@@ -34,7 +34,7 @@ FRESULT f_write (
|
|||||||
<dt>btw</dt>
|
<dt>btw</dt>
|
||||||
<dd>Specifies number of bytes to write in range of <tt>UINT</tt> type.</dd>
|
<dd>Specifies number of bytes to write in range of <tt>UINT</tt> type.</dd>
|
||||||
<dt>bw</dt>
|
<dt>bw</dt>
|
||||||
<dd>Pointer to the <tt>UINT</tt> variable to return the number of bytes written. This value is always valid after the function call regardless of the return value.</dd>
|
<dd>Pointer to the <tt>UINT</tt> variable to return the number of bytes written. This value is always valid after the function call regardless of the function return code.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ FRESULT f_write (
|
|||||||
|
|
||||||
<div class="para comp">
|
<div class="para comp">
|
||||||
<h4>QuickInfo</h4>
|
<h4>QuickInfo</h4>
|
||||||
<p>Available when <tt>FF_FS_READONLY == 0</tt>.</p>
|
<p>Available when <tt><a href="config.html#fs_readonly">FF_FS_READONLY</a> == 0</tt>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+43
-30
@@ -1,65 +1,78 @@
|
|||||||
/*------------------------------------------------------------/
|
/*------------------------------------------------------------/
|
||||||
/ Remove all contents of a directory
|
/ Delete a sub-directory even if it contains any file
|
||||||
/ This function works regardless of FF_FS_RPATH.
|
/-------------------------------------------------------------/
|
||||||
/------------------------------------------------------------*/
|
/ The delete_node() function is for R0.12+.
|
||||||
|
/ It works regardless of FF_FS_RPATH.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
FILINFO fno;
|
FRESULT delete_node (
|
||||||
|
TCHAR* path, /* Path name buffer with the sub-directory to delete */
|
||||||
FRESULT empty_directory (
|
UINT sz_buff, /* Size of path name buffer (items) */
|
||||||
char* path /* Working buffer filled with start directory */
|
FILINFO* fno /* Name read buffer */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT i, j;
|
UINT i, j;
|
||||||
FRESULT fr;
|
FRESULT fr;
|
||||||
DIR dir;
|
DIR dir;
|
||||||
|
|
||||||
fr = f_opendir(&dir, path);
|
|
||||||
if (fr == FR_OK) {
|
fr = f_opendir(&dir, path); /* Open the sub-directory to make it empty */
|
||||||
for (i = 0; path[i]; i++) ;
|
if (fr != FR_OK) return fr;
|
||||||
path[i++] = '/';
|
|
||||||
|
for (i = 0; path[i]; i++) ; /* Get current path length */
|
||||||
|
path[i++] = _T('/');
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
fr = f_readdir(&dir, &fno);
|
fr = f_readdir(&dir, fno); /* Get a directory item */
|
||||||
if (fr != FR_OK || !fno.fname[0]) break;
|
if (fr != FR_OK || !fno->fname[0]) break; /* End of directory? */
|
||||||
if (_FS_RPATH && fno.fname[0] == '.') continue;
|
|
||||||
j = 0;
|
j = 0;
|
||||||
do
|
do { /* Make a path name */
|
||||||
path[i+j] = fno.fname[j];
|
if (i + j >= sz_buff) { /* Buffer over flow? */
|
||||||
while (fno.fname[j++]);
|
fr = 100; break; /* Fails with 100 when buffer overflow */
|
||||||
if (fno.fattrib & AM_DIR) {
|
|
||||||
fr = empty_directory(path);
|
|
||||||
if (fr != FR_OK) break;
|
|
||||||
}
|
}
|
||||||
|
path[i + j] = fno->fname[j];
|
||||||
|
} while (fno->fname[j++]);
|
||||||
|
if (fno->fattrib & AM_DIR) { /* Item is a sub-directory */
|
||||||
|
fr = delete_node(path, sz_buff, fno);
|
||||||
|
} else { /* Item is a file */
|
||||||
fr = f_unlink(path);
|
fr = f_unlink(path);
|
||||||
if (fr != FR_OK) break;
|
|
||||||
}
|
}
|
||||||
path[--i] = '\0';
|
if (fr != FR_OK) break;
|
||||||
closedir(&dir);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
path[--i] = 0; /* Restore the path name */
|
||||||
|
f_closedir(&dir);
|
||||||
|
|
||||||
|
if (fr == FR_OK) fr = f_unlink(path); /* Delete the empty sub-directory */
|
||||||
return fr;
|
return fr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main (void)
|
|
||||||
|
int main (void) /* How to use */
|
||||||
{
|
{
|
||||||
FRESULT fr;
|
FRESULT fr;
|
||||||
FATFS fs;
|
FATFS fs;
|
||||||
char buff[256]; /* Working buffer */
|
TCHAR buff[256];
|
||||||
|
FILINFO fno;
|
||||||
|
|
||||||
|
|
||||||
|
f_mount(&fs, _T("5:"), 0);
|
||||||
|
|
||||||
f_mount(&fs, "", 0);
|
/* Directory to be deleted */
|
||||||
|
_tcscpy(buff, _T("5:dir"));
|
||||||
|
|
||||||
strcpy(buff, "/"); /* Directory to be emptied */
|
/* Delete the directory */
|
||||||
fr = empty_directory(buff);
|
fr = delete_node(buff, sizeof buff / sizeof buff[0], &fno);
|
||||||
|
|
||||||
|
/* Check the result */
|
||||||
if (fr) {
|
if (fr) {
|
||||||
printf("Function failed. (%u)\n", fr);
|
_tprintf(_T("Failed to delete the directory. (%u)\n"), fr);
|
||||||
return fr;
|
return fr;
|
||||||
} else {
|
} else {
|
||||||
printf("All contents in the %s are successfully removed.\n", buff);
|
_tprintf(_T("The directory and the contents have successfully been deleted.\n"), buff);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/*----------------------------------------------------------------------/
|
||||||
|
/ Test if the file is contiguous /
|
||||||
|
/----------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
FRESULT test_contiguous_file (
|
||||||
|
FIL* fp, /* [IN] Open file object to be checked */
|
||||||
|
int* cont /* [OUT] 1:Contiguous, 0:Fragmented or zero-length */
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DWORD clst, clsz, step;
|
||||||
|
FSIZE_t fsz;
|
||||||
|
FRESULT fr;
|
||||||
|
|
||||||
|
|
||||||
|
*cont = 0;
|
||||||
|
fr = f_lseek(fp, 0); /* Validates and prepares the file */
|
||||||
|
if (fr != FR_OK) return fr;
|
||||||
|
|
||||||
|
#if FF_MAX_SS == FF_MIN_SS
|
||||||
|
clsz = (DWORD)fp->obj.fs->csize * FF_MAX_SS; /* Cluster size */
|
||||||
|
#else
|
||||||
|
clsz = (DWORD)fp->obj.fs->csize * fp->obj.fs->ssize;
|
||||||
|
#endif
|
||||||
|
fsz = fp->obj.objsize;
|
||||||
|
if (fsz > 0) {
|
||||||
|
clst = fp->obj.sclust - 1; /* A cluster leading the first cluster for first test */
|
||||||
|
while (fsz) {
|
||||||
|
step = (fsz >= clsz) ? clsz : (DWORD)fsz;
|
||||||
|
fr = f_lseek(fp, f_tell(fp) + step); /* Advances file pointer a cluster */
|
||||||
|
if (fr != FR_OK) return fr;
|
||||||
|
if (clst + 1 != fp->clust) break; /* Is not the cluster next to previous one? */
|
||||||
|
clst = fp->clust; fsz -= step; /* Get current cluster for next test */
|
||||||
|
}
|
||||||
|
if (fsz == 0) *cont = 1; /* All done without fail? */
|
||||||
|
}
|
||||||
|
|
||||||
|
return FR_OK;
|
||||||
|
}
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 1.9 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.2 KiB |
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 6.0 KiB |
@@ -1,3 +1,23 @@
|
|||||||
|
R0.13c (October 14, 2018)
|
||||||
|
Supported stdint.h for C99 and later. (integer.h was included in ff.h)
|
||||||
|
Fixed reading a directory gets infinite loop when the last directory entry is not empty. (appeared at R0.12)
|
||||||
|
Fixed creating a sub-directory in the fragmented sub-directory on the exFAT volume collapses FAT chain of the parent directory. (appeared at R0.12)
|
||||||
|
Fixed f_getcwd() cause output buffer overrun when the buffer has a valid drive number. (appeared at R0.13b)
|
||||||
|
|
||||||
|
R0.13b (April 07, 2018)
|
||||||
|
Added support for UTF-32 encoding on the API. (FF_LFN_UNICODE = 3)
|
||||||
|
Added support for Unix style volume prefix. (FF_STR_VOLUME_ID = 2)
|
||||||
|
Fixed accesing any object on the exFAT root directory beyond the cluster boundary can fail. (appeared at R0.12c)
|
||||||
|
Fixed f_setlabel() does not reject some invalid characters. (appeared at R0.09b)
|
||||||
|
|
||||||
|
R0.13a (October 14, 2017)
|
||||||
|
Added support for UTF-8 encoding on the API. (FF_LFN_UNICODE = 2)
|
||||||
|
Added options for file name output buffer. (FF_LFN_BUF, FF_SFN_BUF).
|
||||||
|
Added dynamic memory allocation option for working buffer of f_mkfs() and f_fdisk().
|
||||||
|
Fixed f_fdisk() and f_mkfs() create the partition table with wrong CHS parameters. (appeared at R0.09)
|
||||||
|
Fixed f_unlink() can cause lost clusters at fragmented file on the exFAT volume. (appeared at R0.12c)
|
||||||
|
Fixed f_setlabel() rejects some valid characters for exFAT volume. (appeared at R0.12)
|
||||||
|
|
||||||
R0.13 (May 21, 2017)
|
R0.13 (May 21, 2017)
|
||||||
Changed heading character of configuration keywords "_" to "FF_".
|
Changed heading character of configuration keywords "_" to "FF_".
|
||||||
Removed ASCII-only configuration, FF_CODE_PAGE = 1. Use FF_CODE_PAGE = 437 instead.
|
Removed ASCII-only configuration, FF_CODE_PAGE = 1. Use FF_CODE_PAGE = 437 instead.
|
||||||
|
|||||||
@@ -300,3 +300,31 @@ R0.13 (May 21, 2017)
|
|||||||
Fixed exFAT FAT entry can be collapsed when write or lseek operation to the existing file is done. (appeared at R0.12c)
|
Fixed exFAT FAT entry can be collapsed when write or lseek operation to the existing file is done. (appeared at R0.12c)
|
||||||
Fixed creating a file can fail when a new cluster allocation to the exFAT directory occures. (appeared at R0.12c)
|
Fixed creating a file can fail when a new cluster allocation to the exFAT directory occures. (appeared at R0.12c)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
R0.13a (October 14, 2017)
|
||||||
|
|
||||||
|
Added support for UTF-8 encoding on the API. (FF_LFN_UNICODE = 2)
|
||||||
|
Added options for file name output buffer. (FF_LFN_BUF, FF_SFN_BUF).
|
||||||
|
Added dynamic memory allocation option for working buffer of f_mkfs() and f_fdisk().
|
||||||
|
Fixed f_fdisk() and f_mkfs() create the partition table with wrong CHS parameters. (appeared at R0.09)
|
||||||
|
Fixed f_unlink() can cause lost clusters at fragmented file on the exFAT volume. (appeared at R0.12c)
|
||||||
|
Fixed f_setlabel() rejects some valid characters for exFAT volume. (appeared at R0.12)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
R0.13b (April 07, 2018)
|
||||||
|
|
||||||
|
Added support for UTF-32 encoding on the API. (FF_LFN_UNICODE = 3)
|
||||||
|
Added support for Unix style volume ID. (FF_STR_VOLUME_ID = 2)
|
||||||
|
Fixed accesing any object on the exFAT root directory beyond the cluster boundary can fail. (appeared at R0.12c)
|
||||||
|
Fixed f_setlabel() does not reject some invalid characters. (appeared at R0.09b)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
R0.13c (October 14, 2018)
|
||||||
|
Supported stdint.h for C99 and later. (integer.h was included in ff.h)
|
||||||
|
Fixed reading a directory gets infinite loop when the last directory entry is not empty. (appeared at R0.12)
|
||||||
|
Fixed creating a sub-directory in the fragmented sub-directory on the exFAT volume collapses FAT chain of the parent directory. (appeared at R0.12)
|
||||||
|
Fixed f_getcwd() cause output buffer overrun when the buffer has a valid drive number. (appeared at R0.13b)
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -1,4 +1,4 @@
|
|||||||
FatFs Module Source Files R0.13
|
FatFs Module Source Files R0.13c
|
||||||
|
|
||||||
|
|
||||||
FILES
|
FILES
|
||||||
@@ -10,7 +10,6 @@ FILES
|
|||||||
ff.h Common include file for FatFs and application module.
|
ff.h Common include file for FatFs and application module.
|
||||||
diskio.h Common include file for FatFs and disk I/O module.
|
diskio.h Common include file for FatFs and disk I/O module.
|
||||||
diskio.c An example of glue function to attach existing disk I/O module to FatFs.
|
diskio.c An example of glue function to attach existing disk I/O module to FatFs.
|
||||||
integer.h Integer type definitions for FatFs.
|
|
||||||
ffunicode.c Optional Unicode utility functions.
|
ffunicode.c Optional Unicode utility functions.
|
||||||
ffsystem.c An example of optional O/S related functions.
|
ffsystem.c An example of optional O/S related functions.
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -7,7 +7,8 @@
|
|||||||
/* storage control modules to the FatFs module with a defined API. */
|
/* storage control modules to the FatFs module with a defined API. */
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "diskio.h" /* FatFs lower layer API */
|
#include "ff.h" /* Obtains integer types */
|
||||||
|
#include "diskio.h" /* Declarations of disk functions */
|
||||||
|
|
||||||
/* Definitions of physical drive number for each drive */
|
/* Definitions of physical drive number for each drive */
|
||||||
#define DEV_RAM 0 /* Example: Map Ramdisk to physical drive 0 */
|
#define DEV_RAM 0 /* Example: Map Ramdisk to physical drive 0 */
|
||||||
@@ -143,6 +144,8 @@ DRESULT disk_read (
|
|||||||
/* Write Sector(s) */
|
/* Write Sector(s) */
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#if FF_FS_READONLY == 0
|
||||||
|
|
||||||
DRESULT disk_write (
|
DRESULT disk_write (
|
||||||
BYTE pdrv, /* Physical drive nmuber to identify the drive */
|
BYTE pdrv, /* Physical drive nmuber to identify the drive */
|
||||||
const BYTE *buff, /* Data to be written */
|
const BYTE *buff, /* Data to be written */
|
||||||
@@ -185,6 +188,7 @@ DRESULT disk_write (
|
|||||||
return RES_PARERR;
|
return RES_PARERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
|
|||||||
+5
-8
@@ -9,9 +9,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "integer.h"
|
|
||||||
|
|
||||||
|
|
||||||
/* Status of Disk Functions */
|
/* Status of Disk Functions */
|
||||||
typedef BYTE DSTATUS;
|
typedef BYTE DSTATUS;
|
||||||
|
|
||||||
@@ -46,11 +43,11 @@ DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
|
|||||||
/* Command code for disk_ioctrl fucntion */
|
/* Command code for disk_ioctrl fucntion */
|
||||||
|
|
||||||
/* Generic command (Used by FatFs) */
|
/* Generic command (Used by FatFs) */
|
||||||
#define CTRL_SYNC 0 /* Complete pending write process (needed at _FS_READONLY == 0) */
|
#define CTRL_SYNC 0 /* Complete pending write process (needed at FF_FS_READONLY == 0) */
|
||||||
#define GET_SECTOR_COUNT 1 /* Get media size (needed at _USE_MKFS == 1) */
|
#define GET_SECTOR_COUNT 1 /* Get media size (needed at FF_USE_MKFS == 1) */
|
||||||
#define GET_SECTOR_SIZE 2 /* Get sector size (needed at _MAX_SS != _MIN_SS) */
|
#define GET_SECTOR_SIZE 2 /* Get sector size (needed at FF_MAX_SS != FF_MIN_SS) */
|
||||||
#define GET_BLOCK_SIZE 3 /* Get erase block size (needed at _USE_MKFS == 1) */
|
#define GET_BLOCK_SIZE 3 /* Get erase block size (needed at FF_USE_MKFS == 1) */
|
||||||
#define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */
|
#define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at FF_USE_TRIM == 1) */
|
||||||
|
|
||||||
/* Generic command (Not used by FatFs) */
|
/* Generic command (Not used by FatFs) */
|
||||||
#define CTRL_POWER 5 /* Get/Set power status */
|
#define CTRL_POWER 5 /* Get/Set power status */
|
||||||
|
|||||||
+1092
-736
File diff suppressed because it is too large
Load Diff
+63
-22
@@ -1,8 +1,8 @@
|
|||||||
/*----------------------------------------------------------------------------/
|
/*----------------------------------------------------------------------------/
|
||||||
/ FatFs - Generic FAT Filesystem module R0.13 /
|
/ FatFs - Generic FAT Filesystem module R0.13c /
|
||||||
/-----------------------------------------------------------------------------/
|
/-----------------------------------------------------------------------------/
|
||||||
/
|
/
|
||||||
/ Copyright (C) 2017, ChaN, all right reserved.
|
/ Copyright (C) 2018, ChaN, all right reserved.
|
||||||
/
|
/
|
||||||
/ FatFs module is an open source software. Redistribution and use of FatFs in
|
/ FatFs module is an open source software. Redistribution and use of FatFs in
|
||||||
/ source and binary forms, with or without modification, are permitted provided
|
/ source and binary forms, with or without modification, are permitted provided
|
||||||
@@ -20,13 +20,12 @@
|
|||||||
|
|
||||||
|
|
||||||
#ifndef FF_DEFINED
|
#ifndef FF_DEFINED
|
||||||
#define FF_DEFINED 87030 /* Revision ID */
|
#define FF_DEFINED 86604 /* Revision ID */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "integer.h" /* Basic integer types */
|
|
||||||
#include "ffconf.h" /* FatFs configuration options */
|
#include "ffconf.h" /* FatFs configuration options */
|
||||||
|
|
||||||
#if FF_DEFINED != FFCONF_DEF
|
#if FF_DEFINED != FFCONF_DEF
|
||||||
@@ -34,6 +33,30 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* Integer types used for FatFs API */
|
||||||
|
|
||||||
|
#if defined(_WIN32) /* Main development platform */
|
||||||
|
#define FF_INTDEF 2
|
||||||
|
#include <windows.h>
|
||||||
|
typedef unsigned __int64 QWORD;
|
||||||
|
#elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__cplusplus) /* C99 or later */
|
||||||
|
#define FF_INTDEF 2
|
||||||
|
#include <stdint.h>
|
||||||
|
typedef unsigned int UINT; /* int must be 16-bit or 32-bit */
|
||||||
|
typedef unsigned char BYTE; /* char must be 8-bit */
|
||||||
|
typedef uint16_t WORD; /* 16-bit unsigned integer */
|
||||||
|
typedef uint16_t WCHAR; /* 16-bit unsigned integer */
|
||||||
|
typedef uint32_t DWORD; /* 32-bit unsigned integer */
|
||||||
|
typedef uint64_t QWORD; /* 64-bit unsigned integer */
|
||||||
|
#else /* Earlier than C99 */
|
||||||
|
#define FF_INTDEF 1
|
||||||
|
typedef unsigned int UINT; /* int must be 16-bit or 32-bit */
|
||||||
|
typedef unsigned char BYTE; /* char must be 8-bit */
|
||||||
|
typedef unsigned short WORD; /* 16-bit unsigned integer */
|
||||||
|
typedef unsigned short WCHAR; /* 16-bit unsigned integer */
|
||||||
|
typedef unsigned long DWORD; /* 32-bit unsigned integer */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Definitions of volume management */
|
/* Definitions of volume management */
|
||||||
|
|
||||||
@@ -45,24 +68,39 @@ typedef struct {
|
|||||||
extern PARTITION VolToPart[]; /* Volume - Partition resolution table */
|
extern PARTITION VolToPart[]; /* Volume - Partition resolution table */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if FF_STR_VOLUME_ID
|
||||||
|
#ifndef FF_VOLUME_STRS
|
||||||
|
extern const char* VolumeStr[FF_VOLUMES]; /* User defied volume ID */
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Type of path name strings on FatFs API */
|
/* Type of path name strings on FatFs API */
|
||||||
|
|
||||||
#if FF_LFN_UNICODE && FF_USE_LFN /* Unicode (UTF-16) string */
|
|
||||||
#ifndef _INC_TCHAR
|
#ifndef _INC_TCHAR
|
||||||
|
#define _INC_TCHAR
|
||||||
|
|
||||||
|
#if FF_USE_LFN && FF_LFN_UNICODE == 1 /* Unicode in UTF-16 encoding */
|
||||||
typedef WCHAR TCHAR;
|
typedef WCHAR TCHAR;
|
||||||
#define _T(x) L ## x
|
#define _T(x) L ## x
|
||||||
#define _TEXT(x) L ## x
|
#define _TEXT(x) L ## x
|
||||||
#define _INC_TCHAR
|
#elif FF_USE_LFN && FF_LFN_UNICODE == 2 /* Unicode in UTF-8 encoding */
|
||||||
#endif
|
typedef char TCHAR;
|
||||||
#else /* ANSI/OEM string */
|
#define _T(x) u8 ## x
|
||||||
#ifndef _INC_TCHAR
|
#define _TEXT(x) u8 ## x
|
||||||
|
#elif FF_USE_LFN && FF_LFN_UNICODE == 3 /* Unicode in UTF-32 encoding */
|
||||||
|
typedef DWORD TCHAR;
|
||||||
|
#define _T(x) U ## x
|
||||||
|
#define _TEXT(x) U ## x
|
||||||
|
#elif FF_USE_LFN && (FF_LFN_UNICODE < 0 || FF_LFN_UNICODE > 3)
|
||||||
|
#error Wrong FF_LFN_UNICODE setting
|
||||||
|
#else /* ANSI/OEM code in SBCS/DBCS */
|
||||||
typedef char TCHAR;
|
typedef char TCHAR;
|
||||||
#define _T(x) x
|
#define _T(x) x
|
||||||
#define _TEXT(x) x
|
#define _TEXT(x) x
|
||||||
#define _INC_TCHAR
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -70,8 +108,8 @@ typedef char TCHAR;
|
|||||||
/* Type of file size variables */
|
/* Type of file size variables */
|
||||||
|
|
||||||
#if FF_FS_EXFAT
|
#if FF_FS_EXFAT
|
||||||
#if !FF_USE_LFN
|
#if FF_INTDEF != 2
|
||||||
#error LFN must be enabled when enable exFAT
|
#error exFAT feature wants C99 or later
|
||||||
#endif
|
#endif
|
||||||
typedef QWORD FSIZE_t;
|
typedef QWORD FSIZE_t;
|
||||||
#else
|
#else
|
||||||
@@ -83,8 +121,8 @@ typedef DWORD FSIZE_t;
|
|||||||
/* Filesystem object structure (FATFS) */
|
/* Filesystem object structure (FATFS) */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
BYTE fs_type; /* Filesystem type (0:N/A) */
|
BYTE fs_type; /* Filesystem type (0:not mounted) */
|
||||||
BYTE pdrv; /* Physical drive number */
|
BYTE pdrv; /* Associated physical drive */
|
||||||
BYTE n_fats; /* Number of FATs (1 or 2) */
|
BYTE n_fats; /* Number of FATs (1 or 2) */
|
||||||
BYTE wflag; /* win[] flag (b0:dirty) */
|
BYTE wflag; /* win[] flag (b0:dirty) */
|
||||||
BYTE fsi_flag; /* FSINFO flags (b7:disabled, b0:dirty) */
|
BYTE fsi_flag; /* FSINFO flags (b7:disabled, b0:dirty) */
|
||||||
@@ -121,6 +159,9 @@ typedef struct {
|
|||||||
DWORD fatbase; /* FAT base sector */
|
DWORD fatbase; /* FAT base sector */
|
||||||
DWORD dirbase; /* Root directory base sector/cluster */
|
DWORD dirbase; /* Root directory base sector/cluster */
|
||||||
DWORD database; /* Data base sector */
|
DWORD database; /* Data base sector */
|
||||||
|
#if FF_FS_EXFAT
|
||||||
|
DWORD bitbase; /* Allocation bitmap base sector */
|
||||||
|
#endif
|
||||||
DWORD winsect; /* Current sector appearing in the win[] */
|
DWORD winsect; /* Current sector appearing in the win[] */
|
||||||
BYTE win[FF_MAX_SS]; /* Disk access window for Directory, FAT (and file data at tiny cfg) */
|
BYTE win[FF_MAX_SS]; /* Disk access window for Directory, FAT (and file data at tiny cfg) */
|
||||||
} FATFS;
|
} FATFS;
|
||||||
@@ -133,7 +174,7 @@ typedef struct {
|
|||||||
FATFS* fs; /* Pointer to the hosting volume of this object */
|
FATFS* fs; /* Pointer to the hosting volume of this object */
|
||||||
WORD id; /* Hosting volume mount ID */
|
WORD id; /* Hosting volume mount ID */
|
||||||
BYTE attr; /* Object attribute */
|
BYTE attr; /* Object attribute */
|
||||||
BYTE stat; /* Object chain status (b1-0: =0:not contiguous, =2:contiguous, =3:flagmented in this session, b2:sub-directory stretched) */
|
BYTE stat; /* Object chain status (b1-0: =0:not contiguous, =2:contiguous, =3:fragmented in this session, b2:sub-directory stretched) */
|
||||||
DWORD sclust; /* Object data start cluster (0:no cluster or root directory) */
|
DWORD sclust; /* Object data start cluster (0:no cluster or root directory) */
|
||||||
FSIZE_t objsize; /* Object size (valid when sclust != 0) */
|
FSIZE_t objsize; /* Object size (valid when sclust != 0) */
|
||||||
#if FF_FS_EXFAT
|
#if FF_FS_EXFAT
|
||||||
@@ -200,10 +241,10 @@ typedef struct {
|
|||||||
WORD ftime; /* Modified time */
|
WORD ftime; /* Modified time */
|
||||||
BYTE fattrib; /* File attribute */
|
BYTE fattrib; /* File attribute */
|
||||||
#if FF_USE_LFN
|
#if FF_USE_LFN
|
||||||
TCHAR altname[13]; /* Altenative file name */
|
TCHAR altname[FF_SFN_BUF + 1];/* Altenative file name */
|
||||||
TCHAR fname[FF_MAX_LFN + 1]; /* Primary file name */
|
TCHAR fname[FF_LFN_BUF + 1]; /* Primary file name */
|
||||||
#else
|
#else
|
||||||
TCHAR fname[13]; /* File name */
|
TCHAR fname[12 + 1]; /* File name */
|
||||||
#endif
|
#endif
|
||||||
} FILINFO;
|
} FILINFO;
|
||||||
|
|
||||||
@@ -264,7 +305,7 @@ FRESULT f_getfree (const TCHAR* path, DWORD* nclst, FATFS** fatfs); /* Get numbe
|
|||||||
FRESULT f_getlabel (const TCHAR* path, TCHAR* label, DWORD* vsn); /* Get volume label */
|
FRESULT f_getlabel (const TCHAR* path, TCHAR* label, DWORD* vsn); /* Get volume label */
|
||||||
FRESULT f_setlabel (const TCHAR* label); /* Set volume label */
|
FRESULT f_setlabel (const TCHAR* label); /* Set volume label */
|
||||||
FRESULT f_forward (FIL* fp, UINT(*func)(const BYTE*,UINT), UINT btf, UINT* bf); /* Forward data to the stream */
|
FRESULT f_forward (FIL* fp, UINT(*func)(const BYTE*,UINT), UINT btf, UINT* bf); /* Forward data to the stream */
|
||||||
FRESULT f_expand (FIL* fp, FSIZE_t szf, BYTE opt); /* Allocate a contiguous block to the file */
|
FRESULT f_expand (FIL* fp, FSIZE_t fsz, BYTE opt); /* Allocate a contiguous block to the file */
|
||||||
FRESULT f_mount (FATFS* fs, const TCHAR* path, BYTE opt); /* Mount/Unmount a logical drive */
|
FRESULT f_mount (FATFS* fs, const TCHAR* path, BYTE opt); /* Mount/Unmount a logical drive */
|
||||||
FRESULT f_mkfs (const TCHAR* path, BYTE opt, DWORD au, void* work, UINT len); /* Create a FAT volume */
|
FRESULT f_mkfs (const TCHAR* path, BYTE opt, DWORD au, void* work, UINT len); /* Create a FAT volume */
|
||||||
FRESULT f_fdisk (BYTE pdrv, const DWORD* szt, void* work); /* Divide a physical drive into some partitions */
|
FRESULT f_fdisk (BYTE pdrv, const DWORD* szt, void* work); /* Divide a physical drive into some partitions */
|
||||||
@@ -299,10 +340,10 @@ DWORD get_fattime (void);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* LFN support functions */
|
/* LFN support functions */
|
||||||
#if FF_USE_LFN /* Code conversion (defined in unicode.c) */
|
#if FF_USE_LFN >= 1 /* Code conversion (defined in unicode.c) */
|
||||||
WCHAR ff_oem2uni (WCHAR oem, WORD cp); /* OEM code to Unicode conversion */
|
WCHAR ff_oem2uni (WCHAR oem, WORD cp); /* OEM code to Unicode conversion */
|
||||||
WCHAR ff_uni2oem (WCHAR uni, WORD cp); /* Unicode to OEM code conversion */
|
WCHAR ff_uni2oem (DWORD uni, WORD cp); /* Unicode to OEM code conversion */
|
||||||
WCHAR ff_wtoupper (WCHAR uni); /* Unicode upper-case conversion */
|
DWORD ff_wtoupper (DWORD uni); /* Unicode upper-case conversion */
|
||||||
#endif
|
#endif
|
||||||
#if FF_USE_LFN == 3 /* Dynamic memory allocation */
|
#if FF_USE_LFN == 3 /* Dynamic memory allocation */
|
||||||
void* ff_memalloc (UINT msize); /* Allocate memory block */
|
void* ff_memalloc (UINT msize); /* Allocate memory block */
|
||||||
|
|||||||
+47
-28
@@ -1,8 +1,8 @@
|
|||||||
/*---------------------------------------------------------------------------/
|
/*---------------------------------------------------------------------------/
|
||||||
/ FatFs - Configuration file
|
/ FatFs Functional Configurations
|
||||||
/---------------------------------------------------------------------------*/
|
/---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#define FFCONF_DEF 87030 /* Revision ID */
|
#define FFCONF_DEF 86604 /* Revision ID */
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------/
|
/*---------------------------------------------------------------------------/
|
||||||
/ Function Configurations
|
/ Function Configurations
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
#define FF_FS_MINIMIZE 0
|
#define FF_FS_MINIMIZE 0
|
||||||
/* This option defines minimization level to remove some basic API functions.
|
/* This option defines minimization level to remove some basic API functions.
|
||||||
/
|
/
|
||||||
/ 0: All basic functions are enabled.
|
/ 0: Basic functions are fully enabled.
|
||||||
/ 1: f_stat(), f_getfree(), f_unlink(), f_mkdir(), f_truncate() and f_rename()
|
/ 1: f_stat(), f_getfree(), f_unlink(), f_mkdir(), f_truncate() and f_rename()
|
||||||
/ are removed.
|
/ are removed.
|
||||||
/ 2: f_opendir(), f_readdir() and f_closedir() are removed in addition to 1.
|
/ 2: f_opendir(), f_readdir() and f_closedir() are removed in addition to 1.
|
||||||
@@ -106,32 +106,47 @@
|
|||||||
/ 2: Enable LFN with dynamic working buffer on the STACK.
|
/ 2: Enable LFN with dynamic working buffer on the STACK.
|
||||||
/ 3: Enable LFN with dynamic working buffer on the HEAP.
|
/ 3: Enable LFN with dynamic working buffer on the HEAP.
|
||||||
/
|
/
|
||||||
/ To enable the LFN, Unicode handling functions (option/unicode.c) must be added
|
/ To enable the LFN, ffunicode.c needs to be added to the project. The LFN function
|
||||||
/ to the project. The working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and
|
/ requiers certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and
|
||||||
/ additional 608 bytes at exFAT enabled. FF_MAX_LFN can be in range from 12 to 255.
|
/ additional (FF_MAX_LFN + 44) / 15 * 32 bytes when exFAT is enabled.
|
||||||
/ It should be set 255 to support full featured LFN operations.
|
/ The FF_MAX_LFN defines size of the working buffer in UTF-16 code unit and it can
|
||||||
|
/ be in range of 12 to 255. It is recommended to be set 255 to fully support LFN
|
||||||
|
/ specification.
|
||||||
/ When use stack for the working buffer, take care on stack overflow. When use heap
|
/ When use stack for the working buffer, take care on stack overflow. When use heap
|
||||||
/ memory for the working buffer, memory management functions, ff_memalloc() and
|
/ memory for the working buffer, memory management functions, ff_memalloc() and
|
||||||
/ ff_memfree(), must be added to the project. */
|
/ ff_memfree() in ffsystem.c, need to be added to the project. */
|
||||||
|
|
||||||
|
|
||||||
#define FF_LFN_UNICODE 0
|
#define FF_LFN_UNICODE 0
|
||||||
/* This option switches character encoding on the API, 0:ANSI/OEM or 1:UTF-16,
|
/* This option switches the character encoding on the API when LFN is enabled.
|
||||||
/ when LFN is enabled. Also behavior of string I/O functions will be affected by
|
/
|
||||||
/ this option. When LFN is not enabled, this option has no effect.
|
/ 0: ANSI/OEM in current CP (TCHAR = char)
|
||||||
*/
|
/ 1: Unicode in UTF-16 (TCHAR = WCHAR)
|
||||||
|
/ 2: Unicode in UTF-8 (TCHAR = char)
|
||||||
|
/ 3: Unicode in UTF-32 (TCHAR = DWORD)
|
||||||
|
/
|
||||||
|
/ Also behavior of string I/O functions will be affected by this option.
|
||||||
|
/ When LFN is not enabled, this option has no effect. */
|
||||||
|
|
||||||
|
|
||||||
|
#define FF_LFN_BUF 255
|
||||||
|
#define FF_SFN_BUF 12
|
||||||
|
/* This set of options defines size of file name members in the FILINFO structure
|
||||||
|
/ which is used to read out directory items. These values should be suffcient for
|
||||||
|
/ the file names to read. The maximum possible length of the read file name depends
|
||||||
|
/ on character encoding. When LFN is not enabled, these options have no effect. */
|
||||||
|
|
||||||
|
|
||||||
#define FF_STRF_ENCODE 3
|
#define FF_STRF_ENCODE 3
|
||||||
/* When FF_LFN_UNICODE = 1 with LFN enabled, string I/O functions, f_gets(),
|
/* When FF_LFN_UNICODE >= 1 with LFN enabled, string I/O functions, f_gets(),
|
||||||
/ f_putc(), f_puts and f_printf() convert the character encoding in it.
|
/ f_putc(), f_puts and f_printf() convert the character encoding in it.
|
||||||
/ This option selects assumption of character encoding ON THE FILE to be
|
/ This option selects assumption of character encoding ON THE FILE to be
|
||||||
/ read/written via those functions.
|
/ read/written via those functions.
|
||||||
/
|
/
|
||||||
/ 0: ANSI/OEM
|
/ 0: ANSI/OEM in current CP
|
||||||
/ 1: UTF-16LE
|
/ 1: Unicode in UTF-16LE
|
||||||
/ 2: UTF-16BE
|
/ 2: Unicode in UTF-16BE
|
||||||
/ 3: UTF-8
|
/ 3: Unicode in UTF-8
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -154,11 +169,16 @@
|
|||||||
|
|
||||||
#define FF_STR_VOLUME_ID 0
|
#define FF_STR_VOLUME_ID 0
|
||||||
#define FF_VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3"
|
#define FF_VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3"
|
||||||
/* FF_STR_VOLUME_ID switches string support for volume ID.
|
/* FF_STR_VOLUME_ID switches support for volume ID in arbitrary strings.
|
||||||
/ When FF_STR_VOLUME_ID is set to 1, also pre-defined strings can be used as drive
|
/ When FF_STR_VOLUME_ID is set to 1 or 2, arbitrary strings can be used as drive
|
||||||
/ number in the path name. FF_VOLUME_STRS defines the drive ID strings for each
|
/ number in the path name. FF_VOLUME_STRS defines the volume ID strings for each
|
||||||
/ logical drives. Number of items must be equal to FF_VOLUMES. Valid characters for
|
/ logical drives. Number of items must not be less than FF_VOLUMES. Valid
|
||||||
/ the drive ID strings are: A-Z and 0-9. */
|
/ characters for the volume ID strings are A-Z, a-z and 0-9, however, they are
|
||||||
|
/ compared in case-insensitive. If FF_STR_VOLUME_ID >= 1 and FF_VOLUME_STRS is
|
||||||
|
/ not defined, a user defined volume string table needs to be defined as:
|
||||||
|
/
|
||||||
|
/ const char* VolumeStr[FF_VOLUMES] = {"ram","flash","sd","usb",...
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define FF_MULTI_PARTITION 0
|
#define FF_MULTI_PARTITION 0
|
||||||
@@ -212,17 +232,17 @@
|
|||||||
|
|
||||||
#define FF_FS_EXFAT 0
|
#define FF_FS_EXFAT 0
|
||||||
/* This option switches support for exFAT filesystem. (0:Disable or 1:Enable)
|
/* This option switches support for exFAT filesystem. (0:Disable or 1:Enable)
|
||||||
/ When enable exFAT, also LFN needs to be enabled.
|
/ To enable exFAT, also LFN needs to be enabled. (FF_USE_LFN >= 1)
|
||||||
/ Note that enabling exFAT discards ANSI C (C89) compatibility. */
|
/ Note that enabling exFAT discards ANSI C (C89) compatibility. */
|
||||||
|
|
||||||
|
|
||||||
#define FF_FS_NORTC 0
|
#define FF_FS_NORTC 0
|
||||||
#define FF_NORTC_MON 5
|
#define FF_NORTC_MON 1
|
||||||
#define FF_NORTC_MDAY 1
|
#define FF_NORTC_MDAY 1
|
||||||
#define FF_NORTC_YEAR 2017
|
#define FF_NORTC_YEAR 2018
|
||||||
/* The option FF_FS_NORTC switches timestamp functiton. If the system does not have
|
/* The option FF_FS_NORTC switches timestamp functiton. If the system does not have
|
||||||
/ any RTC function or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable
|
/ any RTC function or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable
|
||||||
/ the timestamp function. All objects modified by FatFs will have a fixed timestamp
|
/ the timestamp function. Every object modified by FatFs will have a fixed timestamp
|
||||||
/ defined by FF_NORTC_MON, FF_NORTC_MDAY and FF_NORTC_YEAR in local time.
|
/ defined by FF_NORTC_MON, FF_NORTC_MDAY and FF_NORTC_YEAR in local time.
|
||||||
/ To enable timestamp function (FF_FS_NORTC = 0), get_fattime() function need to be
|
/ To enable timestamp function (FF_FS_NORTC = 0), get_fattime() function need to be
|
||||||
/ added to the project to read current time form real-time clock. FF_NORTC_MON,
|
/ added to the project to read current time form real-time clock. FF_NORTC_MON,
|
||||||
@@ -242,6 +262,7 @@
|
|||||||
/ lock control is independent of re-entrancy. */
|
/ lock control is independent of re-entrancy. */
|
||||||
|
|
||||||
|
|
||||||
|
/* #include <somertos.h> // O/S definitions */
|
||||||
#define FF_FS_REENTRANT 0
|
#define FF_FS_REENTRANT 0
|
||||||
#define FF_FS_TIMEOUT 1000
|
#define FF_FS_TIMEOUT 1000
|
||||||
#define FF_SYNC_t HANDLE
|
#define FF_SYNC_t HANDLE
|
||||||
@@ -262,8 +283,6 @@
|
|||||||
/ SemaphoreHandle_t and etc. A header file for O/S definitions needs to be
|
/ SemaphoreHandle_t and etc. A header file for O/S definitions needs to be
|
||||||
/ included somewhere in the scope of ff.h. */
|
/ included somewhere in the scope of ff.h. */
|
||||||
|
|
||||||
/* #include <windows.h> // O/S definitions */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*--- End of configuration options ---*/
|
/*--- End of configuration options ---*/
|
||||||
|
|||||||
+8
-9
@@ -1,20 +1,19 @@
|
|||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
/* Sample code of OS dependent controls for FatFs */
|
/* Sample Code of OS Dependent Functions for FatFs */
|
||||||
/* (C)ChaN, 2017 */
|
/* (C)ChaN, 2018 */
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
#include "ff.h"
|
#include "ff.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if FF_USE_LFN == 3 /* Dynamic memory allocation */
|
#if FF_USE_LFN == 3 /* Dynamic memory allocation */
|
||||||
|
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
/* Allocate a memory block */
|
/* Allocate a memory block */
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
void* ff_memalloc ( /* Returns pointer to the allocated memory block (null on not enough core) */
|
void* ff_memalloc ( /* Returns pointer to the allocated memory block (null if not enough core) */
|
||||||
UINT msize /* Number of bytes to allocate */
|
UINT msize /* Number of bytes to allocate */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -27,7 +26,7 @@ void* ff_memalloc ( /* Returns pointer to the allocated memory block (null on no
|
|||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
void ff_memfree (
|
void ff_memfree (
|
||||||
void* mblock /* Pointer to the memory block to free */
|
void* mblock /* Pointer to the memory block to free (nothing to do if null) */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
free(mblock); /* Free the memory block with POSIX API */
|
free(mblock); /* Free the memory block with POSIX API */
|
||||||
@@ -40,19 +39,19 @@ void ff_memfree (
|
|||||||
#if FF_FS_REENTRANT /* Mutal exclusion */
|
#if FF_FS_REENTRANT /* Mutal exclusion */
|
||||||
|
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
/* Create a Synchronization Object
|
/* Create a Synchronization Object */
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
/* This function is called in f_mount() function to create a new
|
/* This function is called in f_mount() function to create a new
|
||||||
/ synchronization object for the volume, such as semaphore and mutex.
|
/ synchronization object for the volume, such as semaphore and mutex.
|
||||||
/ When a 0 is returned, the f_mount() function fails with FR_INT_ERR.
|
/ When a 0 is returned, the f_mount() function fails with FR_INT_ERR.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//const osMutexDef_t Mutex[FF_VOLUMES]; /* CMSIS-RTOS */
|
//const osMutexDef_t Mutex[FF_VOLUMES]; /* Table of CMSIS-RTOS mutex */
|
||||||
|
|
||||||
|
|
||||||
int ff_cre_syncobj ( /* 1:Function succeeded, 0:Could not create the sync object */
|
int ff_cre_syncobj ( /* 1:Function succeeded, 0:Could not create the sync object */
|
||||||
BYTE vol, /* Corresponding volume (logical drive number) */
|
BYTE vol, /* Corresponding volume (logical drive number) */
|
||||||
FF_SYNC_t *sobj /* Pointer to return the created sync object */
|
FF_SYNC_t* sobj /* Pointer to return the created sync object */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
/* Win32 */
|
/* Win32 */
|
||||||
@@ -74,7 +73,7 @@ int ff_cre_syncobj ( /* 1:Function succeeded, 0:Could not create the sync object
|
|||||||
// return (int)(*sobj != NULL);
|
// return (int)(*sobj != NULL);
|
||||||
|
|
||||||
/* CMSIS-RTOS */
|
/* CMSIS-RTOS */
|
||||||
// *sobj = osMutexCreate(Mutex + vol);
|
// *sobj = osMutexCreate(&Mutex[vol]);
|
||||||
// return (int)(*sobj != NULL);
|
// return (int)(*sobj != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+157
-126
@@ -1,5 +1,5 @@
|
|||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
/* Unicode handling functions for FatFs R0.13+ */
|
/* Unicode handling functions for FatFs R0.13c */
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
/* This module will occupy a huge memory in the .const section when the /
|
/* This module will occupy a huge memory in the .const section when the /
|
||||||
/ FatFs is configured for LFN with DBCS. If the system has any Unicode /
|
/ FatFs is configured for LFN with DBCS. If the system has any Unicode /
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
/ that function to avoid silly memory consumption. /
|
/ that function to avoid silly memory consumption. /
|
||||||
/-------------------------------------------------------------------------*/
|
/-------------------------------------------------------------------------*/
|
||||||
/*
|
/*
|
||||||
/ Copyright (C) 2017, ChaN, all right reserved.
|
/ Copyright (C) 2018, ChaN, all right reserved.
|
||||||
/
|
/
|
||||||
/ FatFs module is an open source software. Redistribution and use of FatFs in
|
/ FatFs module is an open source software. Redistribution and use of FatFs in
|
||||||
/ source and binary forms, with or without modification, are permitted provided
|
/ source and binary forms, with or without modification, are permitted provided
|
||||||
@@ -25,7 +25,11 @@
|
|||||||
|
|
||||||
#include "ff.h"
|
#include "ff.h"
|
||||||
|
|
||||||
#if FF_USE_LFN
|
#if FF_USE_LFN /* This module will be blanked at non-LFN configuration */
|
||||||
|
|
||||||
|
#if FF_DEFINED != 86604 /* Revision ID */
|
||||||
|
#error Wrong include file (ff.h).
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MERGE2(a, b) a ## b
|
#define MERGE2(a, b) a ## b
|
||||||
#define CVTBL(tbl, cp) MERGE2(tbl, cp)
|
#define CVTBL(tbl, cp) MERGE2(tbl, cp)
|
||||||
@@ -36,8 +40,7 @@
|
|||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#if FF_CODE_PAGE == 932 || FF_CODE_PAGE == 0 /* Japanese */
|
#if FF_CODE_PAGE == 932 || FF_CODE_PAGE == 0 /* Japanese */
|
||||||
static
|
static const WCHAR uni2oem932[] = { /* Unicode --> Shift_JIS pairs */
|
||||||
const WCHAR uni2oem932[] = { /* Unicode --> Shift_JIS pairs */
|
|
||||||
0x00A7, 0x8198, 0x00A8, 0x814E, 0x00B0, 0x818B, 0x00B1, 0x817D, 0x00B4, 0x814C, 0x00B6, 0x81F7, 0x00D7, 0x817E, 0x00F7, 0x8180,
|
0x00A7, 0x8198, 0x00A8, 0x814E, 0x00B0, 0x818B, 0x00B1, 0x817D, 0x00B4, 0x814C, 0x00B6, 0x81F7, 0x00D7, 0x817E, 0x00F7, 0x8180,
|
||||||
0x0391, 0x839F, 0x0392, 0x83A0, 0x0393, 0x83A1, 0x0394, 0x83A2, 0x0395, 0x83A3, 0x0396, 0x83A4, 0x0397, 0x83A5, 0x0398, 0x83A6,
|
0x0391, 0x839F, 0x0392, 0x83A0, 0x0393, 0x83A1, 0x0394, 0x83A2, 0x0395, 0x83A3, 0x0396, 0x83A4, 0x0397, 0x83A5, 0x0398, 0x83A6,
|
||||||
0x0399, 0x83A7, 0x039A, 0x83A8, 0x039B, 0x83A9, 0x039C, 0x83AA, 0x039D, 0x83AB, 0x039E, 0x83AC, 0x039F, 0x83AD, 0x03A0, 0x83AE,
|
0x0399, 0x83A7, 0x039A, 0x83A8, 0x039B, 0x83A9, 0x039C, 0x83AA, 0x039D, 0x83AB, 0x039E, 0x83AC, 0x039F, 0x83AD, 0x03A0, 0x83AE,
|
||||||
@@ -964,8 +967,7 @@ const WCHAR uni2oem932[] = { /* Unicode --> Shift_JIS pairs */
|
|||||||
0xFFE1, 0x8192, 0xFFE2, 0x81CA, 0xFFE3, 0x8150, 0xFFE4, 0xFA55, 0xFFE5, 0x818F, 0, 0
|
0xFFE1, 0x8192, 0xFFE2, 0x81CA, 0xFFE3, 0x8150, 0xFFE4, 0xFA55, 0xFFE5, 0x818F, 0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
static
|
static const WCHAR oem2uni932[] = { /* Shift_JIS --> Unicode pairs */
|
||||||
const WCHAR oem2uni932[] = { /* Shift_JIS --> Unicode pairs */
|
|
||||||
0x00A1, 0xFF61, 0x00A2, 0xFF62, 0x00A3, 0xFF63, 0x00A4, 0xFF64, 0x00A5, 0xFF65, 0x00A6, 0xFF66, 0x00A7, 0xFF67, 0x00A8, 0xFF68,
|
0x00A1, 0xFF61, 0x00A2, 0xFF62, 0x00A3, 0xFF63, 0x00A4, 0xFF64, 0x00A5, 0xFF65, 0x00A6, 0xFF66, 0x00A7, 0xFF67, 0x00A8, 0xFF68,
|
||||||
0x00A9, 0xFF69, 0x00AA, 0xFF6A, 0x00AB, 0xFF6B, 0x00AC, 0xFF6C, 0x00AD, 0xFF6D, 0x00AE, 0xFF6E, 0x00AF, 0xFF6F, 0x00B0, 0xFF70,
|
0x00A9, 0xFF69, 0x00AA, 0xFF6A, 0x00AB, 0xFF6B, 0x00AC, 0xFF6C, 0x00AD, 0xFF6D, 0x00AE, 0xFF6E, 0x00AF, 0xFF6F, 0x00B0, 0xFF70,
|
||||||
0x00B1, 0xFF71, 0x00B2, 0xFF72, 0x00B3, 0xFF73, 0x00B4, 0xFF74, 0x00B5, 0xFF75, 0x00B6, 0xFF76, 0x00B7, 0xFF77, 0x00B8, 0xFF78,
|
0x00B1, 0xFF71, 0x00B2, 0xFF72, 0x00B3, 0xFF73, 0x00B4, 0xFF74, 0x00B5, 0xFF75, 0x00B6, 0xFF76, 0x00B7, 0xFF77, 0x00B8, 0xFF78,
|
||||||
@@ -1894,8 +1896,7 @@ const WCHAR oem2uni932[] = { /* Shift_JIS --> Unicode pairs */
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if FF_CODE_PAGE == 936 || FF_CODE_PAGE == 0 /* Simplified Chinese */
|
#if FF_CODE_PAGE == 936 || FF_CODE_PAGE == 0 /* Simplified Chinese */
|
||||||
static
|
static const WCHAR uni2oem936[] = { /* Unicode --> GBK pairs */
|
||||||
const WCHAR uni2oem936[] = { /* Unicode --> GBK pairs */
|
|
||||||
0x00A4, 0xA1E8, 0x00A7, 0xA1EC, 0x00A8, 0xA1A7, 0x00B0, 0xA1E3, 0x00B1, 0xA1C0, 0x00B7, 0xA1A4, 0x00D7, 0xA1C1, 0x00E0, 0xA8A4,
|
0x00A4, 0xA1E8, 0x00A7, 0xA1EC, 0x00A8, 0xA1A7, 0x00B0, 0xA1E3, 0x00B1, 0xA1C0, 0x00B7, 0xA1A4, 0x00D7, 0xA1C1, 0x00E0, 0xA8A4,
|
||||||
0x00E1, 0xA8A2, 0x00E8, 0xA8A8, 0x00E9, 0xA8A6, 0x00EA, 0xA8BA, 0x00EC, 0xA8AC, 0x00ED, 0xA8AA, 0x00F2, 0xA8B0, 0x00F3, 0xA8AE,
|
0x00E1, 0xA8A2, 0x00E8, 0xA8A8, 0x00E9, 0xA8A6, 0x00EA, 0xA8BA, 0x00EC, 0xA8AC, 0x00ED, 0xA8AA, 0x00F2, 0xA8B0, 0x00F3, 0xA8AE,
|
||||||
0x00F7, 0xA1C2, 0x00F9, 0xA8B4, 0x00FA, 0xA8B2, 0x00FC, 0xA8B9, 0x0101, 0xA8A1, 0x0113, 0xA8A5, 0x011B, 0xA8A7, 0x012B, 0xA8A9,
|
0x00F7, 0xA1C2, 0x00F9, 0xA8B4, 0x00FA, 0xA8B2, 0x00FC, 0xA8B9, 0x0101, 0xA8A1, 0x0113, 0xA8A5, 0x011B, 0xA8A7, 0x012B, 0xA8A9,
|
||||||
@@ -4623,8 +4624,7 @@ const WCHAR uni2oem936[] = { /* Unicode --> GBK pairs */
|
|||||||
0, 0
|
0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
static
|
static const WCHAR oem2uni936[] = { /* GBK --> Unicode pairs */
|
||||||
const WCHAR oem2uni936[] = { /* GBK --> Unicode pairs */
|
|
||||||
0x0080, 0x20AC, 0x8140, 0x4E02, 0x8141, 0x4E04, 0x8142, 0x4E05, 0x8143, 0x4E06, 0x8144, 0x4E0F, 0x8145, 0x4E12, 0x8146, 0x4E17,
|
0x0080, 0x20AC, 0x8140, 0x4E02, 0x8141, 0x4E04, 0x8142, 0x4E05, 0x8143, 0x4E06, 0x8144, 0x4E0F, 0x8145, 0x4E12, 0x8146, 0x4E17,
|
||||||
0x8147, 0x4E1F, 0x8148, 0x4E20, 0x8149, 0x4E21, 0x814A, 0x4E23, 0x814B, 0x4E26, 0x814C, 0x4E29, 0x814D, 0x4E2E, 0x814E, 0x4E2F,
|
0x8147, 0x4E1F, 0x8148, 0x4E20, 0x8149, 0x4E21, 0x814A, 0x4E23, 0x814B, 0x4E26, 0x814C, 0x4E29, 0x814D, 0x4E2E, 0x814E, 0x4E2F,
|
||||||
0x814F, 0x4E31, 0x8150, 0x4E33, 0x8151, 0x4E35, 0x8152, 0x4E37, 0x8153, 0x4E3C, 0x8154, 0x4E40, 0x8155, 0x4E41, 0x8156, 0x4E42,
|
0x814F, 0x4E31, 0x8150, 0x4E33, 0x8151, 0x4E35, 0x8152, 0x4E37, 0x8153, 0x4E3C, 0x8154, 0x4E40, 0x8155, 0x4E41, 0x8156, 0x4E42,
|
||||||
@@ -7354,8 +7354,7 @@ const WCHAR oem2uni936[] = { /* GBK --> Unicode pairs */
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if FF_CODE_PAGE == 949 || FF_CODE_PAGE == 0 /* Korean */
|
#if FF_CODE_PAGE == 949 || FF_CODE_PAGE == 0 /* Korean */
|
||||||
static
|
static const WCHAR uni2oem949[] = { /* Unicode --> Korean pairs */
|
||||||
const WCHAR uni2oem949[] = { /* Unicode --> Korean pairs */
|
|
||||||
0x00A1, 0xA2AE, 0x00A4, 0xA2B4, 0x00A7, 0xA1D7, 0x00A8, 0xA1A7, 0x00AA, 0xA8A3, 0x00AD, 0xA1A9, 0x00AE, 0xA2E7, 0x00B0, 0xA1C6,
|
0x00A1, 0xA2AE, 0x00A4, 0xA2B4, 0x00A7, 0xA1D7, 0x00A8, 0xA1A7, 0x00AA, 0xA8A3, 0x00AD, 0xA1A9, 0x00AE, 0xA2E7, 0x00B0, 0xA1C6,
|
||||||
0x00B1, 0xA1BE, 0x00B2, 0xA9F7, 0x00B3, 0xA9F8, 0x00B4, 0xA2A5, 0x00B6, 0xA2D2, 0x00B7, 0xA1A4, 0x00B8, 0xA2AC, 0x00B9, 0xA9F6,
|
0x00B1, 0xA1BE, 0x00B2, 0xA9F7, 0x00B3, 0xA9F8, 0x00B4, 0xA2A5, 0x00B6, 0xA2D2, 0x00B7, 0xA1A4, 0x00B8, 0xA2AC, 0x00B9, 0xA9F6,
|
||||||
0x00BA, 0xA8AC, 0x00BC, 0xA8F9, 0x00BD, 0xA8F6, 0x00BE, 0xA8FA, 0x00BF, 0xA2AF, 0x00C6, 0xA8A1, 0x00D0, 0xA8A2, 0x00D7, 0xA1BF,
|
0x00BA, 0xA8AC, 0x00BC, 0xA8F9, 0x00BD, 0xA8F6, 0x00BE, 0xA8FA, 0x00BF, 0xA2AF, 0x00C6, 0xA8A1, 0x00D0, 0xA8A2, 0x00D7, 0xA1BF,
|
||||||
@@ -9490,8 +9489,7 @@ const WCHAR uni2oem949[] = { /* Unicode --> Korean pairs */
|
|||||||
0, 0
|
0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
static
|
static const WCHAR oem2uni949[] = { /* Korean --> Unicode pairs */
|
||||||
const WCHAR oem2uni949[] = { /* Korean --> Unicode pairs */
|
|
||||||
0x8141, 0xAC02, 0x8142, 0xAC03, 0x8143, 0xAC05, 0x8144, 0xAC06, 0x8145, 0xAC0B, 0x8146, 0xAC0C, 0x8147, 0xAC0D, 0x8148, 0xAC0E,
|
0x8141, 0xAC02, 0x8142, 0xAC03, 0x8143, 0xAC05, 0x8144, 0xAC06, 0x8145, 0xAC0B, 0x8146, 0xAC0C, 0x8147, 0xAC0D, 0x8148, 0xAC0E,
|
||||||
0x8149, 0xAC0F, 0x814A, 0xAC18, 0x814B, 0xAC1E, 0x814C, 0xAC1F, 0x814D, 0xAC21, 0x814E, 0xAC22, 0x814F, 0xAC23, 0x8150, 0xAC25,
|
0x8149, 0xAC0F, 0x814A, 0xAC18, 0x814B, 0xAC1E, 0x814C, 0xAC1F, 0x814D, 0xAC21, 0x814E, 0xAC22, 0x814F, 0xAC23, 0x8150, 0xAC25,
|
||||||
0x8151, 0xAC26, 0x8152, 0xAC27, 0x8153, 0xAC28, 0x8154, 0xAC29, 0x8155, 0xAC2A, 0x8156, 0xAC2B, 0x8157, 0xAC2E, 0x8158, 0xAC32,
|
0x8151, 0xAC26, 0x8152, 0xAC27, 0x8153, 0xAC28, 0x8154, 0xAC29, 0x8155, 0xAC2A, 0x8156, 0xAC2B, 0x8157, 0xAC2E, 0x8158, 0xAC32,
|
||||||
@@ -11628,8 +11626,7 @@ const WCHAR oem2uni949[] = { /* Korean --> Unicode pairs */
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if FF_CODE_PAGE == 950 || FF_CODE_PAGE == 0 /* Traditional Chinese */
|
#if FF_CODE_PAGE == 950 || FF_CODE_PAGE == 0 /* Traditional Chinese */
|
||||||
static
|
static const WCHAR uni2oem950[] = { /* Unicode --> Big5 pairs */
|
||||||
const WCHAR uni2oem950[] = { /* Unicode --> Big5 pairs */
|
|
||||||
0x00A7, 0xA1B1, 0x00AF, 0xA1C2, 0x00B0, 0xA258, 0x00B1, 0xA1D3, 0x00B7, 0xA150, 0x00D7, 0xA1D1, 0x00F7, 0xA1D2, 0x02C7, 0xA3BE,
|
0x00A7, 0xA1B1, 0x00AF, 0xA1C2, 0x00B0, 0xA258, 0x00B1, 0xA1D3, 0x00B7, 0xA150, 0x00D7, 0xA1D1, 0x00F7, 0xA1D2, 0x02C7, 0xA3BE,
|
||||||
0x02C9, 0xA3BC, 0x02CA, 0xA3BD, 0x02CB, 0xA3BF, 0x02CD, 0xA1C5, 0x02D9, 0xA3BB, 0x0391, 0xA344, 0x0392, 0xA345, 0x0393, 0xA346,
|
0x02C9, 0xA3BC, 0x02CA, 0xA3BD, 0x02CB, 0xA3BF, 0x02CD, 0xA1C5, 0x02D9, 0xA3BB, 0x0391, 0xA344, 0x0392, 0xA345, 0x0393, 0xA346,
|
||||||
0x0394, 0xA347, 0x0395, 0xA348, 0x0396, 0xA349, 0x0397, 0xA34A, 0x0398, 0xA34B, 0x0399, 0xA34C, 0x039A, 0xA34D, 0x039B, 0xA34E,
|
0x0394, 0xA347, 0x0395, 0xA348, 0x0396, 0xA349, 0x0397, 0xA34A, 0x0398, 0xA34B, 0x0399, 0xA34C, 0x039A, 0xA34D, 0x039B, 0xA34E,
|
||||||
@@ -13320,8 +13317,7 @@ const WCHAR uni2oem950[] = { /* Unicode --> Big5 pairs */
|
|||||||
0xFF5C, 0xA155, 0xFF5D, 0xA162, 0xFF5E, 0xA1E3, 0xFFE0, 0xA246, 0xFFE1, 0xA247, 0xFFE3, 0xA1C3, 0xFFE5, 0xA244, 0, 0
|
0xFF5C, 0xA155, 0xFF5D, 0xA162, 0xFF5E, 0xA1E3, 0xFFE0, 0xA246, 0xFFE1, 0xA247, 0xFFE3, 0xA1C3, 0xFFE5, 0xA244, 0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
static
|
static const WCHAR oem2uni950[] = { /* Big5 --> Unicode pairs */
|
||||||
const WCHAR oem2uni950[] = { /* Big5 --> Unicode pairs */
|
|
||||||
0xA140, 0x3000, 0xA141, 0xFF0C, 0xA142, 0x3001, 0xA143, 0x3002, 0xA144, 0xFF0E, 0xA145, 0x2027, 0xA146, 0xFF1B, 0xA147, 0xFF1A,
|
0xA140, 0x3000, 0xA141, 0xFF0C, 0xA142, 0x3001, 0xA143, 0x3002, 0xA144, 0xFF0E, 0xA145, 0x2027, 0xA146, 0xFF1B, 0xA147, 0xFF1A,
|
||||||
0xA148, 0xFF1F, 0xA149, 0xFF01, 0xA14A, 0xFE30, 0xA14B, 0x2026, 0xA14C, 0x2025, 0xA14D, 0xFE50, 0xA14E, 0xFE51, 0xA14F, 0xFE52,
|
0xA148, 0xFF1F, 0xA149, 0xFF01, 0xA14A, 0xFE30, 0xA14B, 0x2026, 0xA14C, 0x2025, 0xA14D, 0xFE50, 0xA14E, 0xFE51, 0xA14F, 0xFE52,
|
||||||
0xA150, 0x00B7, 0xA151, 0xFE54, 0xA152, 0xFE55, 0xA153, 0xFE56, 0xA154, 0xFE57, 0xA155, 0xFF5C, 0xA156, 0x2013, 0xA157, 0xFE31,
|
0xA150, 0x00B7, 0xA151, 0xFE54, 0xA152, 0xFE55, 0xA153, 0xFE56, 0xA154, 0xFE57, 0xA155, 0xFF5C, 0xA156, 0x2013, 0xA157, 0xFE31,
|
||||||
@@ -15014,8 +15010,7 @@ const WCHAR oem2uni950[] = { /* Big5 --> Unicode pairs */
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if FF_CODE_PAGE == 437 || FF_CODE_PAGE == 0
|
#if FF_CODE_PAGE == 437 || FF_CODE_PAGE == 0
|
||||||
static
|
static const WCHAR uc437[] = { /* CP437(U.S.) to Unicode conversion table */
|
||||||
const WCHAR uc437[] = { /* CP437(U.S.) to Unicode conversion table */
|
|
||||||
0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5,
|
0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5,
|
||||||
0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, 0x00FF, 0x00D6, 0x00DC, 0x00A2, 0x00A3, 0x00A5, 0x20A7, 0x0192,
|
0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, 0x00FF, 0x00D6, 0x00DC, 0x00A2, 0x00A3, 0x00A5, 0x20A7, 0x0192,
|
||||||
0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
|
0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
|
||||||
@@ -15027,8 +15022,7 @@ const WCHAR uc437[] = { /* CP437(U.S.) to Unicode conversion table */
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#if FF_CODE_PAGE == 720 || FF_CODE_PAGE == 0
|
#if FF_CODE_PAGE == 720 || FF_CODE_PAGE == 0
|
||||||
static
|
static const WCHAR uc720[] = { /* CP720(Arabic) to Unicode conversion table */
|
||||||
const WCHAR uc720[] = { /* CP720(Arabic) to Unicode conversion table */
|
|
||||||
0x0000, 0x0000, 0x00E9, 0x00E2, 0x0000, 0x00E0, 0x0000, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x0000, 0x0000, 0x0000,
|
0x0000, 0x0000, 0x00E9, 0x00E2, 0x0000, 0x00E0, 0x0000, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x0000, 0x0000, 0x0000,
|
||||||
0x0000, 0x0651, 0x0652, 0x00F4, 0x00A4, 0x0640, 0x00FB, 0x00F9, 0x0621, 0x0622, 0x0623, 0x0624, 0x00A3, 0x0625, 0x0626, 0x0627,
|
0x0000, 0x0651, 0x0652, 0x00F4, 0x00A4, 0x0640, 0x00FB, 0x00F9, 0x0621, 0x0622, 0x0623, 0x0624, 0x00A3, 0x0625, 0x0626, 0x0627,
|
||||||
0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F, 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x00AB, 0x00BB,
|
0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F, 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x00AB, 0x00BB,
|
||||||
@@ -15040,8 +15034,7 @@ const WCHAR uc720[] = { /* CP720(Arabic) to Unicode conversion table */
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#if FF_CODE_PAGE == 737 || FF_CODE_PAGE == 0
|
#if FF_CODE_PAGE == 737 || FF_CODE_PAGE == 0
|
||||||
static
|
static const WCHAR uc737[] = { /* CP737(Greek) to Unicode conversion table */
|
||||||
const WCHAR uc737[] = { /* CP737(Greek) to Unicode conversion table */
|
|
||||||
0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, 0x03A0,
|
0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, 0x03A0,
|
||||||
0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8,
|
0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8,
|
||||||
0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, 0x03C0, 0x03C1, 0x03C3, 0x03C2, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8,
|
0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, 0x03C0, 0x03C1, 0x03C3, 0x03C2, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8,
|
||||||
@@ -15053,8 +15046,7 @@ const WCHAR uc737[] = { /* CP737(Greek) to Unicode conversion table */
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#if FF_CODE_PAGE == 771 || FF_CODE_PAGE == 0
|
#if FF_CODE_PAGE == 771 || FF_CODE_PAGE == 0
|
||||||
static
|
static const WCHAR uc771[] = { /* CP771(KBL) to Unicode conversion table */
|
||||||
const WCHAR uc771[] = { /* CP771(KBL) to Unicode conversion table */
|
|
||||||
0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
|
0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
|
||||||
0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F,
|
0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F,
|
||||||
0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F,
|
0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F,
|
||||||
@@ -15066,8 +15058,7 @@ const WCHAR uc771[] = { /* CP771(KBL) to Unicode conversion table */
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#if FF_CODE_PAGE == 775 || FF_CODE_PAGE == 0
|
#if FF_CODE_PAGE == 775 || FF_CODE_PAGE == 0
|
||||||
static
|
static const WCHAR uc775[] = { /* CP775(Baltic) to Unicode conversion table */
|
||||||
const WCHAR uc775[] = { /* CP775(Baltic) to Unicode conversion table */
|
|
||||||
0x0106, 0x00FC, 0x00E9, 0x0101, 0x00E4, 0x0123, 0x00E5, 0x0107, 0x0142, 0x0113, 0x0156, 0x0157, 0x012B, 0x0179, 0x00C4, 0x00C5,
|
0x0106, 0x00FC, 0x00E9, 0x0101, 0x00E4, 0x0123, 0x00E5, 0x0107, 0x0142, 0x0113, 0x0156, 0x0157, 0x012B, 0x0179, 0x00C4, 0x00C5,
|
||||||
0x00C9, 0x00E6, 0x00C6, 0x014D, 0x00F6, 0x0122, 0x00A2, 0x015A, 0x015B, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x00D7, 0x00A4,
|
0x00C9, 0x00E6, 0x00C6, 0x014D, 0x00F6, 0x0122, 0x00A2, 0x015A, 0x015B, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x00D7, 0x00A4,
|
||||||
0x0100, 0x012A, 0x00F3, 0x017B, 0x017C, 0x017A, 0x201D, 0x00A6, 0x00A9, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x0141, 0x00AB, 0x00BB,
|
0x0100, 0x012A, 0x00F3, 0x017B, 0x017C, 0x017A, 0x201D, 0x00A6, 0x00A9, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x0141, 0x00AB, 0x00BB,
|
||||||
@@ -15079,8 +15070,7 @@ const WCHAR uc775[] = { /* CP775(Baltic) to Unicode conversion table */
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#if FF_CODE_PAGE == 850 || FF_CODE_PAGE == 0
|
#if FF_CODE_PAGE == 850 || FF_CODE_PAGE == 0
|
||||||
static
|
static const WCHAR uc850[] = { /* CP850(Latin 1) to Unicode conversion table */
|
||||||
const WCHAR uc850[] = { /* CP850(Latin 1) to Unicode conversion table */
|
|
||||||
0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5,
|
0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5,
|
||||||
0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, 0x00FF, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x00D7, 0x0192,
|
0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, 0x00FF, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x00D7, 0x0192,
|
||||||
0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
|
0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
|
||||||
@@ -15092,8 +15082,7 @@ const WCHAR uc850[] = { /* CP850(Latin 1) to Unicode conversion table */
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#if FF_CODE_PAGE == 852 || FF_CODE_PAGE == 0
|
#if FF_CODE_PAGE == 852 || FF_CODE_PAGE == 0
|
||||||
static
|
static const WCHAR uc852[] = { /* CP852(Latin 2) to Unicode conversion table */
|
||||||
const WCHAR uc852[] = { /* CP852(Latin 2) to Unicode conversion table */
|
|
||||||
0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x016F, 0x0107, 0x00E7, 0x0142, 0x00EB, 0x0150, 0x0151, 0x00EE, 0x0179, 0x00C4, 0x0106,
|
0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x016F, 0x0107, 0x00E7, 0x0142, 0x00EB, 0x0150, 0x0151, 0x00EE, 0x0179, 0x00C4, 0x0106,
|
||||||
0x00C9, 0x0139, 0x013A, 0x00F4, 0x00F6, 0x013D, 0x013E, 0x015A, 0x015B, 0x00D6, 0x00DC, 0x0164, 0x0165, 0x0141, 0x00D7, 0x010D,
|
0x00C9, 0x0139, 0x013A, 0x00F4, 0x00F6, 0x013D, 0x013E, 0x015A, 0x015B, 0x00D6, 0x00DC, 0x0164, 0x0165, 0x0141, 0x00D7, 0x010D,
|
||||||
0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x0104, 0x0105, 0x017D, 0x017E, 0x0118, 0x0119, 0x00AC, 0x017A, 0x010C, 0x015F, 0x00AB, 0x00BB,
|
0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x0104, 0x0105, 0x017D, 0x017E, 0x0118, 0x0119, 0x00AC, 0x017A, 0x010C, 0x015F, 0x00AB, 0x00BB,
|
||||||
@@ -15105,8 +15094,7 @@ const WCHAR uc852[] = { /* CP852(Latin 2) to Unicode conversion table */
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#if FF_CODE_PAGE == 855 || FF_CODE_PAGE == 0
|
#if FF_CODE_PAGE == 855 || FF_CODE_PAGE == 0
|
||||||
static
|
static const WCHAR uc855[] = { /* CP855(Cyrillic) to Unicode conversion table */
|
||||||
const WCHAR uc855[] = { /* CP855(Cyrillic) to Unicode conversion table */
|
|
||||||
0x0452, 0x0402, 0x0453, 0x0403, 0x0451, 0x0401, 0x0454, 0x0404, 0x0455, 0x0405, 0x0456, 0x0406, 0x0457, 0x0407, 0x0458, 0x0408,
|
0x0452, 0x0402, 0x0453, 0x0403, 0x0451, 0x0401, 0x0454, 0x0404, 0x0455, 0x0405, 0x0456, 0x0406, 0x0457, 0x0407, 0x0458, 0x0408,
|
||||||
0x0459, 0x0409, 0x045A, 0x040A, 0x045B, 0x040B, 0x045C, 0x040C, 0x045E, 0x040E, 0x045F, 0x040F, 0x044E, 0x042E, 0x044A, 0x042A,
|
0x0459, 0x0409, 0x045A, 0x040A, 0x045B, 0x040B, 0x045C, 0x040C, 0x045E, 0x040E, 0x045F, 0x040F, 0x044E, 0x042E, 0x044A, 0x042A,
|
||||||
0x0430, 0x0410, 0x0431, 0x0411, 0x0446, 0x0426, 0x0434, 0x0414, 0x0435, 0x0415, 0x0444, 0x0424, 0x0433, 0x0413, 0x00AB, 0x00BB,
|
0x0430, 0x0410, 0x0431, 0x0411, 0x0446, 0x0426, 0x0434, 0x0414, 0x0435, 0x0415, 0x0444, 0x0424, 0x0433, 0x0413, 0x00AB, 0x00BB,
|
||||||
@@ -15118,8 +15106,7 @@ const WCHAR uc855[] = { /* CP855(Cyrillic) to Unicode conversion table */
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#if FF_CODE_PAGE == 857 || FF_CODE_PAGE == 0
|
#if FF_CODE_PAGE == 857 || FF_CODE_PAGE == 0
|
||||||
static
|
static const WCHAR uc857[] = { /* CP857(Turkish) to Unicode conversion table */
|
||||||
const WCHAR uc857[] = { /* CP857(Turkish) to Unicode conversion table */
|
|
||||||
0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x0131, 0x00C4, 0x00C5,
|
0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x0131, 0x00C4, 0x00C5,
|
||||||
0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, 0x0130, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x015E, 0x015F,
|
0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, 0x0130, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x015E, 0x015F,
|
||||||
0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x011E, 0x011F, 0x00BF, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
|
0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x011E, 0x011F, 0x00BF, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
|
||||||
@@ -15131,8 +15118,7 @@ const WCHAR uc857[] = { /* CP857(Turkish) to Unicode conversion table */
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#if FF_CODE_PAGE == 860 || FF_CODE_PAGE == 0
|
#if FF_CODE_PAGE == 860 || FF_CODE_PAGE == 0
|
||||||
static
|
static const WCHAR uc860[] = { /* CP860(Portuguese) to Unicode conversion table */
|
||||||
const WCHAR uc860[] = { /* CP860(Portuguese) to Unicode conversion table */
|
|
||||||
0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E3, 0x00E0, 0x00C1, 0x00E7, 0x00EA, 0x00CA, 0x00E8, 0x00CD, 0x00D4, 0x00EC, 0x00C3, 0x00C2,
|
0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E3, 0x00E0, 0x00C1, 0x00E7, 0x00EA, 0x00CA, 0x00E8, 0x00CD, 0x00D4, 0x00EC, 0x00C3, 0x00C2,
|
||||||
0x00C9, 0x00C0, 0x00C8, 0x00F4, 0x00F5, 0x00F2, 0x00DA, 0x00F9, 0x00CC, 0x00D5, 0x00DC, 0x00A2, 0x00A3, 0x00D9, 0x20A7, 0x00D3,
|
0x00C9, 0x00C0, 0x00C8, 0x00F4, 0x00F5, 0x00F2, 0x00DA, 0x00F9, 0x00CC, 0x00D5, 0x00DC, 0x00A2, 0x00A3, 0x00D9, 0x20A7, 0x00D3,
|
||||||
0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x00D2, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
|
0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x00D2, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
|
||||||
@@ -15144,8 +15130,7 @@ const WCHAR uc860[] = { /* CP860(Portuguese) to Unicode conversion table */
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#if FF_CODE_PAGE == 861 || FF_CODE_PAGE == 0
|
#if FF_CODE_PAGE == 861 || FF_CODE_PAGE == 0
|
||||||
static
|
static const WCHAR uc861[] = { /* CP861(Icelandic) to Unicode conversion table */
|
||||||
const WCHAR uc861[] = { /* CP861(Icelandic) to Unicode conversion table */
|
|
||||||
0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E6, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00D0, 0x00F0, 0x00DE, 0x00C4, 0x00C5,
|
0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E6, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00D0, 0x00F0, 0x00DE, 0x00C4, 0x00C5,
|
||||||
0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00FE, 0x00FB, 0x00DD, 0x00FD, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x20A7, 0x0192,
|
0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00FE, 0x00FB, 0x00DD, 0x00FD, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x20A7, 0x0192,
|
||||||
0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00C1, 0x00CD, 0x00D3, 0x00DA, 0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
|
0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00C1, 0x00CD, 0x00D3, 0x00DA, 0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
|
||||||
@@ -15157,8 +15142,7 @@ const WCHAR uc861[] = { /* CP861(Icelandic) to Unicode conversion table */
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#if FF_CODE_PAGE == 862 || FF_CODE_PAGE == 0
|
#if FF_CODE_PAGE == 862 || FF_CODE_PAGE == 0
|
||||||
static
|
static const WCHAR uc862[] = { /* CP862(Hebrew) to Unicode conversion table */
|
||||||
const WCHAR uc862[] = { /* CP862(Hebrew) to Unicode conversion table */
|
|
||||||
0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF,
|
0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF,
|
||||||
0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7, 0x05E8, 0x05E9, 0x05EA, 0x00A2, 0x00A3, 0x00A5, 0x20A7, 0x0192,
|
0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7, 0x05E8, 0x05E9, 0x05EA, 0x00A2, 0x00A3, 0x00A5, 0x20A7, 0x0192,
|
||||||
0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
|
0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
|
||||||
@@ -15170,8 +15154,7 @@ const WCHAR uc862[] = { /* CP862(Hebrew) to Unicode conversion table */
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#if FF_CODE_PAGE == 863 || FF_CODE_PAGE == 0
|
#if FF_CODE_PAGE == 863 || FF_CODE_PAGE == 0
|
||||||
static
|
static const WCHAR uc863[] = { /* CP863(Canadian French) to Unicode conversion table */
|
||||||
const WCHAR uc863[] = { /* CP863(Canadian French) to Unicode conversion table */
|
|
||||||
0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00C2, 0x00E0, 0x00B6, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x2017, 0x00C0,
|
0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00C2, 0x00E0, 0x00B6, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x2017, 0x00C0,
|
||||||
0x00C9, 0x00C8, 0x00CA, 0x00F4, 0x00CB, 0x00CF, 0x00FB, 0x00F9, 0x00A4, 0x00D4, 0x00DC, 0x00A2, 0x00A3, 0x00D9, 0x00DB, 0x0192,
|
0x00C9, 0x00C8, 0x00CA, 0x00F4, 0x00CB, 0x00CF, 0x00FB, 0x00F9, 0x00A4, 0x00D4, 0x00DC, 0x00A2, 0x00A3, 0x00D9, 0x00DB, 0x0192,
|
||||||
0x00A6, 0x00B4, 0x00F3, 0x00FA, 0x00A8, 0x00BB, 0x00B3, 0x00AF, 0x00CE, 0x3210, 0x00AC, 0x00BD, 0x00BC, 0x00BE, 0x00AB, 0x00BB,
|
0x00A6, 0x00B4, 0x00F3, 0x00FA, 0x00A8, 0x00BB, 0x00B3, 0x00AF, 0x00CE, 0x3210, 0x00AC, 0x00BD, 0x00BC, 0x00BE, 0x00AB, 0x00BB,
|
||||||
@@ -15183,8 +15166,7 @@ const WCHAR uc863[] = { /* CP863(Canadian French) to Unicode conversion table *
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#if FF_CODE_PAGE == 864 || FF_CODE_PAGE == 0
|
#if FF_CODE_PAGE == 864 || FF_CODE_PAGE == 0
|
||||||
static
|
static const WCHAR uc864[] = { /* CP864(Arabic) to Unicode conversion table */
|
||||||
const WCHAR uc864[] = { /* CP864(Arabic) to Unicode conversion table */
|
|
||||||
0x00B0, 0x00B7, 0x2219, 0x221A, 0x2592, 0x2500, 0x2502, 0x253C, 0x2524, 0x252C, 0x251C, 0x2534, 0x2510, 0x250C, 0x2514, 0x2518,
|
0x00B0, 0x00B7, 0x2219, 0x221A, 0x2592, 0x2500, 0x2502, 0x253C, 0x2524, 0x252C, 0x251C, 0x2534, 0x2510, 0x250C, 0x2514, 0x2518,
|
||||||
0x03B2, 0x221E, 0x03C6, 0x00B1, 0x00BD, 0x00BC, 0x2248, 0x00AB, 0x00BB, 0xFEF7, 0xFEF8, 0x0000, 0x0000, 0xFEFB, 0xFEFC, 0x0000,
|
0x03B2, 0x221E, 0x03C6, 0x00B1, 0x00BD, 0x00BC, 0x2248, 0x00AB, 0x00BB, 0xFEF7, 0xFEF8, 0x0000, 0x0000, 0xFEFB, 0xFEFC, 0x0000,
|
||||||
0x00A0, 0x00AD, 0xFE82, 0x00A3, 0x00A4, 0xFE84, 0x0000, 0x20AC, 0xFE8E, 0xFE8F, 0xFE95, 0xFE99, 0x060C, 0xFE9D, 0xFEA1, 0xFEA5,
|
0x00A0, 0x00AD, 0xFE82, 0x00A3, 0x00A4, 0xFE84, 0x0000, 0x20AC, 0xFE8E, 0xFE8F, 0xFE95, 0xFE99, 0x060C, 0xFE9D, 0xFEA1, 0xFEA5,
|
||||||
@@ -15196,8 +15178,7 @@ const WCHAR uc864[] = { /* CP864(Arabic) to Unicode conversion table */
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#if FF_CODE_PAGE == 865 || FF_CODE_PAGE == 0
|
#if FF_CODE_PAGE == 865 || FF_CODE_PAGE == 0
|
||||||
static
|
static const WCHAR uc865[] = { /* CP865(Nordic) to Unicode conversion table */
|
||||||
const WCHAR uc865[] = { /* CP865(Nordic) to Unicode conversion table */
|
|
||||||
0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5,
|
0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5,
|
||||||
0x00C5, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, 0x00FF, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x20A7, 0x0192,
|
0x00C5, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, 0x00FF, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x20A7, 0x0192,
|
||||||
0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00A4,
|
0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00A4,
|
||||||
@@ -15209,8 +15190,7 @@ const WCHAR uc865[] = { /* CP865(Nordic) to Unicode conversion table */
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#if FF_CODE_PAGE == 866 || FF_CODE_PAGE == 0
|
#if FF_CODE_PAGE == 866 || FF_CODE_PAGE == 0
|
||||||
static
|
static const WCHAR uc866[] = { /* CP866(Russian) to Unicode conversion table */
|
||||||
const WCHAR uc866[] = { /* CP866(Russian) to Unicode conversion table */
|
|
||||||
0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
|
0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
|
||||||
0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F,
|
0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F,
|
||||||
0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F,
|
0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F,
|
||||||
@@ -15222,8 +15202,7 @@ const WCHAR uc866[] = { /* CP866(Russian) to Unicode conversion table */
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#if FF_CODE_PAGE == 869 || FF_CODE_PAGE == 0
|
#if FF_CODE_PAGE == 869 || FF_CODE_PAGE == 0
|
||||||
static
|
static const WCHAR uc869[] = { /* CP869(Greek 2) to Unicode conversion table */
|
||||||
const WCHAR uc869[] = { /* CP869(Greek 2) to Unicode conversion table */
|
|
||||||
0x00B7, 0x00B7, 0x00B7, 0x00B7, 0x00B7, 0x00B7, 0x0386, 0x00B7, 0x00B7, 0x00AC, 0x00A6, 0x2018, 0x2019, 0x0388, 0x2015, 0x0389,
|
0x00B7, 0x00B7, 0x00B7, 0x00B7, 0x00B7, 0x00B7, 0x0386, 0x00B7, 0x00B7, 0x00AC, 0x00A6, 0x2018, 0x2019, 0x0388, 0x2015, 0x0389,
|
||||||
0x038A, 0x03AA, 0x038C, 0x00B7, 0x00B7, 0x038E, 0x03AB, 0x00A9, 0x038F, 0x00B2, 0x00B3, 0x03AC, 0x00A3, 0x03AD, 0x03AE, 0x03AF,
|
0x038A, 0x03AA, 0x038C, 0x00B7, 0x00B7, 0x038E, 0x03AB, 0x00A9, 0x038F, 0x00B2, 0x00B3, 0x03AC, 0x00A3, 0x03AD, 0x03AE, 0x03AF,
|
||||||
0x03CA, 0x0390, 0x03CC, 0x03CD, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x00BD, 0x0398, 0x0399, 0x00AB, 0x00BB,
|
0x03CA, 0x0390, 0x03CC, 0x03CD, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x00BD, 0x0398, 0x0399, 0x00AB, 0x00BB,
|
||||||
@@ -15245,7 +15224,7 @@ const WCHAR uc869[] = { /* CP869(Greek 2) to Unicode conversion table */
|
|||||||
|
|
||||||
#if FF_CODE_PAGE != 0 && FF_CODE_PAGE < 900
|
#if FF_CODE_PAGE != 0 && FF_CODE_PAGE < 900
|
||||||
WCHAR ff_uni2oem ( /* Returns OEM code character, zero on error */
|
WCHAR ff_uni2oem ( /* Returns OEM code character, zero on error */
|
||||||
WCHAR uni, /* Unicode character to be converted */
|
DWORD uni, /* UTF-16 encoded character to be converted */
|
||||||
WORD cp /* Code page for the conversion */
|
WORD cp /* Code page for the conversion */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -15253,15 +15232,16 @@ WCHAR ff_uni2oem ( /* Returns OEM code character, zero on error */
|
|||||||
const WCHAR *p = CVTBL(uc, FF_CODE_PAGE);
|
const WCHAR *p = CVTBL(uc, FF_CODE_PAGE);
|
||||||
|
|
||||||
|
|
||||||
if (uni < 0x80) { /* ASCII char */
|
if (uni < 0x80) { /* ASCII? */
|
||||||
c = uni;
|
c = (WCHAR)uni;
|
||||||
|
|
||||||
} else { /* Non-ASCII char */
|
} else { /* Non-ASCII */
|
||||||
if (cp == FF_CODE_PAGE) { /* Is it a valid code page? */
|
if (uni < 0x10000 && cp == FF_CODE_PAGE) { /* Is it in BMP and valid code page? */
|
||||||
for (c = 0; c < 0x80 && uni != p[c]; c++) ;
|
for (c = 0; c < 0x80 && uni != p[c]; c++) ;
|
||||||
c = (c + 0x80) & 0xFF;
|
c = (c + 0x80) & 0xFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15274,7 +15254,7 @@ WCHAR ff_oem2uni ( /* Returns Unicode character, zero on error */
|
|||||||
const WCHAR *p = CVTBL(uc, FF_CODE_PAGE);
|
const WCHAR *p = CVTBL(uc, FF_CODE_PAGE);
|
||||||
|
|
||||||
|
|
||||||
if (oem < 0x80) { /* ASCII char */
|
if (oem < 0x80) { /* ASCII? */
|
||||||
c = oem;
|
c = oem;
|
||||||
|
|
||||||
} else { /* Extended char */
|
} else { /* Extended char */
|
||||||
@@ -15282,6 +15262,7 @@ WCHAR ff_oem2uni ( /* Returns Unicode character, zero on error */
|
|||||||
if (oem < 0x100) c = p[oem - 0x80];
|
if (oem < 0x100) c = p[oem - 0x80];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15294,29 +15275,30 @@ WCHAR ff_oem2uni ( /* Returns Unicode character, zero on error */
|
|||||||
/* DBCS fixed code page */
|
/* DBCS fixed code page */
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#if FF_CODE_PAGE != 0 && FF_CODE_PAGE >= 900
|
#if FF_CODE_PAGE >= 900
|
||||||
WCHAR ff_uni2oem ( /* Returns OEM code character, zero on error */
|
WCHAR ff_uni2oem ( /* Returns OEM code character, zero on error */
|
||||||
WCHAR uni, /* Unicode character to be converted */
|
DWORD uni, /* UTF-16 encoded character to be converted */
|
||||||
WORD cp /* Code page for the conversion */
|
WORD cp /* Code page for the conversion */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const WCHAR *p;
|
const WCHAR *p;
|
||||||
WCHAR c = 0;
|
WCHAR c = 0, uc;
|
||||||
UINT i, n, li, hi;
|
UINT i = 0, n, li, hi;
|
||||||
|
|
||||||
|
|
||||||
if (uni < 0x80) { /* ASCII char */
|
if (uni < 0x80) { /* ASCII? */
|
||||||
c = uni;
|
c = (WCHAR)uni;
|
||||||
|
|
||||||
} else { /* Non-ASCII char */
|
} else { /* Non-ASCII */
|
||||||
if (cp == FF_CODE_PAGE) { /* Is it a valid code page? */
|
if (uni < 0x10000 && cp == FF_CODE_PAGE) { /* Is it in BMP and valid code page? */
|
||||||
|
uc = (WCHAR)uni;
|
||||||
p = CVTBL(uni2oem, FF_CODE_PAGE);
|
p = CVTBL(uni2oem, FF_CODE_PAGE);
|
||||||
hi = sizeof CVTBL(uni2oem, FF_CODE_PAGE) / 4 - 1;
|
hi = sizeof CVTBL(uni2oem, FF_CODE_PAGE) / 4 - 1;
|
||||||
li = 0;
|
li = 0;
|
||||||
for (n = 16; n; n--) {
|
for (n = 16; n; n--) {
|
||||||
i = li + (hi - li) / 2;
|
i = li + (hi - li) / 2;
|
||||||
if (uni == p[i * 2]) break;
|
if (uc == p[i * 2]) break;
|
||||||
if (uni > p[i * 2]) {
|
if (uc > p[i * 2]) {
|
||||||
li = i;
|
li = i;
|
||||||
} else {
|
} else {
|
||||||
hi = i;
|
hi = i;
|
||||||
@@ -15325,6 +15307,7 @@ WCHAR ff_uni2oem ( /* Returns OEM code character, zero on error */
|
|||||||
if (n != 0) c = p[i * 2 + 1];
|
if (n != 0) c = p[i * 2 + 1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15336,14 +15319,14 @@ WCHAR ff_oem2uni ( /* Returns Unicode character, zero on error */
|
|||||||
{
|
{
|
||||||
const WCHAR *p;
|
const WCHAR *p;
|
||||||
WCHAR c = 0;
|
WCHAR c = 0;
|
||||||
UINT i, n, li, hi;
|
UINT i = 0, n, li, hi;
|
||||||
|
|
||||||
|
|
||||||
if (oem < 0x80) { /* ASCII char */
|
if (oem < 0x80) { /* ASCII? */
|
||||||
c = oem;
|
c = oem;
|
||||||
|
|
||||||
} else { /* Extended char */
|
} else { /* Extended char */
|
||||||
if (cp == FF_CODE_PAGE) { /* Is it a valid code page? */
|
if (cp == FF_CODE_PAGE) { /* Is it valid code page? */
|
||||||
p = CVTBL(oem2uni, FF_CODE_PAGE);
|
p = CVTBL(oem2uni, FF_CODE_PAGE);
|
||||||
hi = sizeof CVTBL(oem2uni, FF_CODE_PAGE) / 4 - 1;
|
hi = sizeof CVTBL(oem2uni, FF_CODE_PAGE) / 4 - 1;
|
||||||
li = 0;
|
li = 0;
|
||||||
@@ -15359,6 +15342,7 @@ WCHAR ff_oem2uni ( /* Returns Unicode character, zero on error */
|
|||||||
if (n != 0) c = p[i * 2 + 1];
|
if (n != 0) c = p[i * 2 + 1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -15372,44 +15356,46 @@ WCHAR ff_oem2uni ( /* Returns Unicode character, zero on error */
|
|||||||
#if FF_CODE_PAGE == 0
|
#if FF_CODE_PAGE == 0
|
||||||
|
|
||||||
static const WORD cp_code[] = { 437, 720, 737, 771, 775, 850, 852, 855, 857, 860, 861, 862, 863, 864, 865, 866, 869, 0};
|
static const WORD cp_code[] = { 437, 720, 737, 771, 775, 850, 852, 855, 857, 860, 861, 862, 863, 864, 865, 866, 869, 0};
|
||||||
static const WCHAR *const cp_table[] = {uc437, uc720, uc737, uc771, uc775, uc850, uc852, uc855, uc857, uc860, uc861, uc862, uc863, uc864, uc865, uc866, uc869, 0};
|
static const WCHAR* const cp_table[] = {uc437, uc720, uc737, uc771, uc775, uc850, uc852, uc855, uc857, uc860, uc861, uc862, uc863, uc864, uc865, uc866, uc869, 0};
|
||||||
|
|
||||||
|
|
||||||
WCHAR ff_uni2oem ( /* Returns OEM code character, zero on error */
|
WCHAR ff_uni2oem ( /* Returns OEM code character, zero on error */
|
||||||
WCHAR uni, /* Unicode character to be converted */
|
DWORD uni, /* UTF-16 encoded character to be converted */
|
||||||
WORD cp /* Code page for the conversion */
|
WORD cp /* Code page for the conversion */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const WCHAR *p;
|
const WCHAR *p;
|
||||||
WCHAR c = 0;
|
WCHAR c = 0, uc;
|
||||||
UINT i, n, li, hi;
|
UINT i, n, li, hi;
|
||||||
|
|
||||||
|
|
||||||
if (uni < 0x80) { /* ASCII char */
|
if (uni < 0x80) { /* ASCII? */
|
||||||
c = uni;
|
c = (WCHAR)uni;
|
||||||
|
|
||||||
} else { /* Non-ASCII char */
|
} else { /* Non-ASCII */
|
||||||
|
if (uni < 0x10000) { /* Is it in BMP? */
|
||||||
|
uc = (WCHAR)uni;
|
||||||
p = 0;
|
p = 0;
|
||||||
if (cp < 900) { /* SBCS */
|
if (cp < 900) { /* SBCS */
|
||||||
for (i = 0; cp_code[i] != 0 && cp_code[i] != cp; i++) ; /* Get table */
|
for (i = 0; cp_code[i] != 0 && cp_code[i] != cp; i++) ; /* Get conversion table */
|
||||||
p = cp_table[i];
|
p = cp_table[i];
|
||||||
if (p) { /* Is it a valid CP ? */
|
if (p) { /* Is it valid code page ? */
|
||||||
for (c = 0; c < 0x80 && uni != p[c]; c++) ; /* Find OEM code in the table */
|
for (c = 0; c < 0x80 && uc != p[c]; c++) ; /* Find OEM code in the table */
|
||||||
c = (c + 0x80) & 0xFF;
|
c = (c + 0x80) & 0xFF;
|
||||||
}
|
}
|
||||||
} else { /* DBCS */
|
} else { /* DBCS */
|
||||||
switch (cp) {
|
switch (cp) { /* Get conversion table */
|
||||||
case 932 : p = uni2oem932; hi = sizeof uni2oem932 / 4 - 1; break;
|
case 932 : p = uni2oem932; hi = sizeof uni2oem932 / 4 - 1; break;
|
||||||
case 936 : p = uni2oem936; hi = sizeof uni2oem936 / 4 - 1; break;
|
case 936 : p = uni2oem936; hi = sizeof uni2oem936 / 4 - 1; break;
|
||||||
case 949 : p = uni2oem949; hi = sizeof uni2oem949 / 4 - 1; break;
|
case 949 : p = uni2oem949; hi = sizeof uni2oem949 / 4 - 1; break;
|
||||||
case 950 : p = uni2oem950; hi = sizeof uni2oem950 / 4 - 1; break;
|
case 950 : p = uni2oem950; hi = sizeof uni2oem950 / 4 - 1; break;
|
||||||
}
|
}
|
||||||
if (p) { /* Is it a valid code page? */
|
if (p) { /* Is it valid code page? */
|
||||||
li = 0;
|
li = 0;
|
||||||
for (n = 16; n; n--) { /* Find OEM code */
|
for (n = 16; n; n--) { /* Find OEM code */
|
||||||
i = li + (hi - li) / 2;
|
i = li + (hi - li) / 2;
|
||||||
if (uni == p[i * 2]) break;
|
if (uc == p[i * 2]) break;
|
||||||
if (uni > p[i * 2]) {
|
if (uc > p[i * 2]) {
|
||||||
li = i;
|
li = i;
|
||||||
} else {
|
} else {
|
||||||
hi = i;
|
hi = i;
|
||||||
@@ -15419,12 +15405,14 @@ WCHAR ff_uni2oem ( /* Returns OEM code character, zero on error */
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WCHAR ff_oem2uni ( /* Returns Unicode character, zero on error */
|
WCHAR ff_oem2uni ( /* Returns Unicode character, zero on error */
|
||||||
WCHAR oem, /* OEM code to be converted */
|
WCHAR oem, /* OEM code to be converted (DBC if >=0x100) */
|
||||||
WORD cp /* Code page for the conversion */
|
WORD cp /* Code page for the conversion */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -15433,7 +15421,7 @@ WCHAR ff_oem2uni ( /* Returns Unicode character, zero on error */
|
|||||||
UINT i, n, li, hi;
|
UINT i, n, li, hi;
|
||||||
|
|
||||||
|
|
||||||
if (oem < 0x80) { /* ASCII char */
|
if (oem < 0x80) { /* ASCII? */
|
||||||
c = oem;
|
c = oem;
|
||||||
|
|
||||||
} else { /* Extended char */
|
} else { /* Extended char */
|
||||||
@@ -15466,6 +15454,7 @@ WCHAR ff_oem2uni ( /* Returns Unicode character, zero on error */
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -15476,54 +15465,94 @@ WCHAR ff_oem2uni ( /* Returns Unicode character, zero on error */
|
|||||||
/* Unicode up-case conversion */
|
/* Unicode up-case conversion */
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
WCHAR ff_wtoupper ( /* Returns up-converted character */
|
DWORD ff_wtoupper ( /* Returns up-converted code point */
|
||||||
WCHAR uni /* Unicode character to be upper converted (BMP only) */
|
DWORD uni /* Unicode code point to be up-converted */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
/* Compressed upper conversion table */
|
const WORD *p;
|
||||||
static const WCHAR cvt1[] = { /* U+0000 - U+0FFF */
|
WORD uc, bc, nc, cmd;
|
||||||
|
static const WORD cvt1[] = { /* Compressed up conversion table for U+0000 - U+0FFF */
|
||||||
/* Basic Latin */
|
/* Basic Latin */
|
||||||
0x0061,0x031A,
|
0x0061,0x031A,
|
||||||
/* Latin-1 Supplement */
|
/* Latin-1 Supplement */
|
||||||
0x00E0,0x0317, 0x00F8,0x0307, 0x00FF,0x0001,0x0178,
|
0x00E0,0x0317,
|
||||||
|
0x00F8,0x0307,
|
||||||
|
0x00FF,0x0001,0x0178,
|
||||||
/* Latin Extended-A */
|
/* Latin Extended-A */
|
||||||
0x0100,0x0130, 0x0132,0x0106, 0x0139,0x0110, 0x014A,0x012E, 0x0179,0x0106,
|
0x0100,0x0130,
|
||||||
|
0x0132,0x0106,
|
||||||
|
0x0139,0x0110,
|
||||||
|
0x014A,0x012E,
|
||||||
|
0x0179,0x0106,
|
||||||
/* Latin Extended-B */
|
/* Latin Extended-B */
|
||||||
0x0180,0x004D,0x0243,0x0181,0x0182,0x0182,0x0184,0x0184,0x0186,0x0187,0x0187,0x0189,0x018A,0x018B,0x018B,0x018D,0x018E,0x018F,0x0190,0x0191,0x0191,0x0193,0x0194,0x01F6,0x0196,0x0197,0x0198,0x0198,0x023D,0x019B,0x019C,0x019D,0x0220,0x019F,0x01A0,0x01A0,0x01A2,0x01A2,0x01A4,0x01A4,0x01A6,0x01A7,0x01A7,0x01A9,0x01AA,0x01AB,0x01AC,0x01AC,0x01AE,0x01AF,0x01AF,0x01B1,0x01B2,0x01B3,0x01B3,0x01B5,0x01B5,0x01B7,0x01B8,0x01B8,0x01BA,0x01BB,0x01BC,0x01BC,0x01BE,0x01F7,0x01C0,0x01C1,0x01C2,0x01C3,0x01C4,0x01C5,0x01C4,0x01C7,0x01C8,0x01C7,0x01CA,0x01CB,0x01CA,
|
0x0180,0x004D,0x0243,0x0181,0x0182,0x0182,0x0184,0x0184,0x0186,0x0187,0x0187,0x0189,0x018A,0x018B,0x018B,0x018D,0x018E,0x018F,0x0190,0x0191,0x0191,0x0193,0x0194,0x01F6,0x0196,0x0197,0x0198,0x0198,0x023D,0x019B,0x019C,0x019D,0x0220,0x019F,0x01A0,0x01A0,0x01A2,0x01A2,0x01A4,0x01A4,0x01A6,0x01A7,0x01A7,0x01A9,0x01AA,0x01AB,0x01AC,0x01AC,0x01AE,0x01AF,0x01AF,0x01B1,0x01B2,0x01B3,0x01B3,0x01B5,0x01B5,0x01B7,0x01B8,0x01B8,0x01BA,0x01BB,0x01BC,0x01BC,0x01BE,0x01F7,0x01C0,0x01C1,0x01C2,0x01C3,0x01C4,0x01C5,0x01C4,0x01C7,0x01C8,0x01C7,0x01CA,0x01CB,0x01CA,
|
||||||
0x01CD,0x0110, 0x01DD,0x0001,0x018E, 0x01DE,0x0112, 0x01F3,0x0003,0x01F1,0x01F4,0x01F4, 0x01F8,0x0128,
|
0x01CD,0x0110,
|
||||||
0x0222,0x0112, 0x023A,0x0009,0x2C65,0x023B,0x023B,0x023D,0x2C66,0x023F,0x0240,0x0241,0x0241, 0x0246,0x010A,
|
0x01DD,0x0001,0x018E,
|
||||||
|
0x01DE,0x0112,
|
||||||
|
0x01F3,0x0003,0x01F1,0x01F4,0x01F4,
|
||||||
|
0x01F8,0x0128,
|
||||||
|
0x0222,0x0112,
|
||||||
|
0x023A,0x0009,0x2C65,0x023B,0x023B,0x023D,0x2C66,0x023F,0x0240,0x0241,0x0241,
|
||||||
|
0x0246,0x010A,
|
||||||
/* IPA Extensions */
|
/* IPA Extensions */
|
||||||
0x0253,0x0040,0x0181,0x0186,0x0255,0x0189,0x018A,0x0258,0x018F,0x025A,0x0190,0x025C,0x025D,0x025E,0x025F,0x0193,0x0261,0x0262,0x0194,0x0264,0x0265,0x0266,0x0267,0x0197,0x0196,0x026A,0x2C62,0x026C,0x026D,0x026E,0x019C,0x0270,0x0271,0x019D,0x0273,0x0274,0x019F,0x0276,0x0277,0x0278,0x0279,0x027A,0x027B,0x027C,0x2C64,0x027E,0x027F,0x01A6,0x0281,0x0282,0x01A9,0x0284,0x0285,0x0286,0x0287,0x01AE,0x0244,0x01B1,0x01B2,0x0245,0x028D,0x028E,0x028F,0x0290,0x0291,0x01B7,
|
0x0253,0x0040,0x0181,0x0186,0x0255,0x0189,0x018A,0x0258,0x018F,0x025A,0x0190,0x025C,0x025D,0x025E,0x025F,0x0193,0x0261,0x0262,0x0194,0x0264,0x0265,0x0266,0x0267,0x0197,0x0196,0x026A,0x2C62,0x026C,0x026D,0x026E,0x019C,0x0270,0x0271,0x019D,0x0273,0x0274,0x019F,0x0276,0x0277,0x0278,0x0279,0x027A,0x027B,0x027C,0x2C64,0x027E,0x027F,0x01A6,0x0281,0x0282,0x01A9,0x0284,0x0285,0x0286,0x0287,0x01AE,0x0244,0x01B1,0x01B2,0x0245,0x028D,0x028E,0x028F,0x0290,0x0291,0x01B7,
|
||||||
/* Greek, Coptic */
|
/* Greek, Coptic */
|
||||||
0x037B,0x0003,0x03FD,0x03FE,0x03FF, 0x03AC,0x0004,0x0386,0x0388,0x0389,0x038A, 0x03B1,0x0311,
|
0x037B,0x0003,0x03FD,0x03FE,0x03FF,
|
||||||
0x03C2,0x0002,0x03A3,0x03A3, 0x03C4,0x0308, 0x03CC,0x0003,0x038C,0x038E,0x038F, 0x03D8,0x0118,
|
0x03AC,0x0004,0x0386,0x0388,0x0389,0x038A,
|
||||||
|
0x03B1,0x0311,
|
||||||
|
0x03C2,0x0002,0x03A3,0x03A3,
|
||||||
|
0x03C4,0x0308,
|
||||||
|
0x03CC,0x0003,0x038C,0x038E,0x038F,
|
||||||
|
0x03D8,0x0118,
|
||||||
0x03F2,0x000A,0x03F9,0x03F3,0x03F4,0x03F5,0x03F6,0x03F7,0x03F7,0x03F9,0x03FA,0x03FA,
|
0x03F2,0x000A,0x03F9,0x03F3,0x03F4,0x03F5,0x03F6,0x03F7,0x03F7,0x03F9,0x03FA,0x03FA,
|
||||||
/* Cyrillic */
|
/* Cyrillic */
|
||||||
0x0430,0x0320, 0x0450,0x0710, 0x0460,0x0122, 0x048A,0x0136, 0x04C1,0x010E, 0x04CF,0x0001,0x04C0, 0x04D0,0x0144,
|
0x0430,0x0320,
|
||||||
|
0x0450,0x0710,
|
||||||
|
0x0460,0x0122,
|
||||||
|
0x048A,0x0136,
|
||||||
|
0x04C1,0x010E,
|
||||||
|
0x04CF,0x0001,0x04C0,
|
||||||
|
0x04D0,0x0144,
|
||||||
/* Armenian */
|
/* Armenian */
|
||||||
0x0561,0x0426,
|
0x0561,0x0426,
|
||||||
|
|
||||||
0x0000
|
0x0000 /* EOT */
|
||||||
};
|
};
|
||||||
static const WCHAR cvt2[] = { /* U+1000 - U+FFFF */
|
static const WORD cvt2[] = { /* Compressed up conversion table for U+1000 - U+FFFF */
|
||||||
/* Phonetic Extensions */
|
/* Phonetic Extensions */
|
||||||
0x1D7D,0x0001,0x2C63,
|
0x1D7D,0x0001,0x2C63,
|
||||||
/* Latin Extended Additional */
|
/* Latin Extended Additional */
|
||||||
0x1E00,0x0196, 0x1EA0,0x015A,
|
0x1E00,0x0196,
|
||||||
|
0x1EA0,0x015A,
|
||||||
/* Greek Extended */
|
/* Greek Extended */
|
||||||
0x1F00,0x0608, 0x1F10,0x0606, 0x1F20,0x0608, 0x1F30,0x0608, 0x1F40,0x0606,
|
0x1F00,0x0608,
|
||||||
0x1F51,0x0007,0x1F59,0x1F52,0x1F5B,0x1F54,0x1F5D,0x1F56,0x1F5F, 0x1F60,0x0608,
|
0x1F10,0x0606,
|
||||||
|
0x1F20,0x0608,
|
||||||
|
0x1F30,0x0608,
|
||||||
|
0x1F40,0x0606,
|
||||||
|
0x1F51,0x0007,0x1F59,0x1F52,0x1F5B,0x1F54,0x1F5D,0x1F56,0x1F5F,
|
||||||
|
0x1F60,0x0608,
|
||||||
0x1F70,0x000E,0x1FBA,0x1FBB,0x1FC8,0x1FC9,0x1FCA,0x1FCB,0x1FDA,0x1FDB,0x1FF8,0x1FF9,0x1FEA,0x1FEB,0x1FFA,0x1FFB,
|
0x1F70,0x000E,0x1FBA,0x1FBB,0x1FC8,0x1FC9,0x1FCA,0x1FCB,0x1FDA,0x1FDB,0x1FF8,0x1FF9,0x1FEA,0x1FEB,0x1FFA,0x1FFB,
|
||||||
0x1F80,0x0608, 0x1F90,0x0608, 0x1FA0,0x0608, 0x1FB0,0x0004,0x1FB8,0x1FB9,0x1FB2,0x1FBC,
|
0x1F80,0x0608,
|
||||||
0x1FCC,0x0001,0x1FC3, 0x1FD0,0x0602, 0x1FE0,0x0602, 0x1FE5,0x0001,0x1FEC, 0x1FF3,0x0001,0x1FFC,
|
0x1F90,0x0608,
|
||||||
|
0x1FA0,0x0608,
|
||||||
|
0x1FB0,0x0004,0x1FB8,0x1FB9,0x1FB2,0x1FBC,
|
||||||
|
0x1FCC,0x0001,0x1FC3,
|
||||||
|
0x1FD0,0x0602,
|
||||||
|
0x1FE0,0x0602,
|
||||||
|
0x1FE5,0x0001,0x1FEC,
|
||||||
|
0x1FF3,0x0001,0x1FFC,
|
||||||
/* Letterlike Symbols */
|
/* Letterlike Symbols */
|
||||||
0x214E,0x0001,0x2132,
|
0x214E,0x0001,0x2132,
|
||||||
/* Number forms */
|
/* Number forms */
|
||||||
0x2170,0x0210, 0x2184,0x0001,0x2183,
|
0x2170,0x0210,
|
||||||
|
0x2184,0x0001,0x2183,
|
||||||
/* Enclosed Alphanumerics */
|
/* Enclosed Alphanumerics */
|
||||||
0x24D0,0x051A, 0x2C30,0x042F,
|
0x24D0,0x051A,
|
||||||
|
0x2C30,0x042F,
|
||||||
/* Latin Extended-C */
|
/* Latin Extended-C */
|
||||||
0x2C60,0x0102, 0x2C67,0x0106, 0x2C75,0x0102,
|
0x2C60,0x0102,
|
||||||
|
0x2C67,0x0106, 0x2C75,0x0102,
|
||||||
/* Coptic */
|
/* Coptic */
|
||||||
0x2C80,0x0164,
|
0x2C80,0x0164,
|
||||||
/* Georgian Supplement */
|
/* Georgian Supplement */
|
||||||
@@ -15531,36 +15560,38 @@ WCHAR ff_wtoupper ( /* Returns up-converted character */
|
|||||||
/* Full-width */
|
/* Full-width */
|
||||||
0xFF41,0x031A,
|
0xFF41,0x031A,
|
||||||
|
|
||||||
0x0000
|
0x0000 /* EOT */
|
||||||
};
|
};
|
||||||
const WCHAR *p;
|
|
||||||
WCHAR bc, nc, cmd;
|
|
||||||
|
|
||||||
|
|
||||||
p = uni < 0x1000 ? cvt1 : cvt2;
|
if (uni < 0x10000) { /* Is it in BMP? */
|
||||||
|
uc = (WORD)uni;
|
||||||
|
p = uc < 0x1000 ? cvt1 : cvt2;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
bc = *p++; /* Get block base */
|
bc = *p++; /* Get the block base */
|
||||||
if (!bc || uni < bc) break;
|
if (bc == 0 || uc < bc) break; /* Not matched? */
|
||||||
nc = *p++; cmd = nc >> 8; nc &= 0xFF; /* Get processing command and block size */
|
nc = *p++; cmd = nc >> 8; nc &= 0xFF; /* Get processing command and block size */
|
||||||
if (uni < bc + nc) { /* In the block? */
|
if (uc < bc + nc) { /* In the block? */
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case 0: uni = p[uni - bc]; break; /* Table conversion */
|
case 0: uc = p[uc - bc]; break; /* Table conversion */
|
||||||
case 1: uni -= (uni - bc) & 1; break; /* Case pairs */
|
case 1: uc -= (uc - bc) & 1; break; /* Case pairs */
|
||||||
case 2: uni -= 16; break; /* Shift -16 */
|
case 2: uc -= 16; break; /* Shift -16 */
|
||||||
case 3: uni -= 32; break; /* Shift -32 */
|
case 3: uc -= 32; break; /* Shift -32 */
|
||||||
case 4: uni -= 48; break; /* Shift -48 */
|
case 4: uc -= 48; break; /* Shift -48 */
|
||||||
case 5: uni -= 26; break; /* Shift -26 */
|
case 5: uc -= 26; break; /* Shift -26 */
|
||||||
case 6: uni += 8; break; /* Shift +8 */
|
case 6: uc += 8; break; /* Shift +8 */
|
||||||
case 7: uni -= 80; break; /* Shift -80 */
|
case 7: uc -= 80; break; /* Shift -80 */
|
||||||
case 8: uni -= 0x1C60; break; /* Shift -0x1C60 */
|
case 8: uc -= 0x1C60; break; /* Shift -0x1C60 */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!cmd) p += nc;
|
if (cmd == 0) p += nc; /* Skip table if needed */
|
||||||
|
}
|
||||||
|
uni = uc;
|
||||||
}
|
}
|
||||||
|
|
||||||
return uni;
|
return uni;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* #if _USE_LFN */
|
#endif /* #if FF_USE_LFN */
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
/*-------------------------------------------*/
|
|
||||||
/* Integer type definitions for FatFs module */
|
|
||||||
/*-------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef FF_INTEGER
|
|
||||||
#define FF_INTEGER
|
|
||||||
|
|
||||||
#ifdef _WIN32 /* FatFs development platform */
|
|
||||||
|
|
||||||
#include <windows.h>
|
|
||||||
#include <tchar.h>
|
|
||||||
typedef unsigned __int64 QWORD;
|
|
||||||
|
|
||||||
|
|
||||||
#else /* Embedded platform */
|
|
||||||
|
|
||||||
/* These types MUST be 16-bit or 32-bit */
|
|
||||||
typedef int INT;
|
|
||||||
typedef unsigned int UINT;
|
|
||||||
|
|
||||||
/* 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 32-bit */
|
|
||||||
typedef long LONG;
|
|
||||||
typedef unsigned long DWORD;
|
|
||||||
|
|
||||||
/* This type MUST be 64-bit (Remove this for ANSI C (C89) compatibility) */
|
|
||||||
typedef unsigned long long QWORD;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
Reference in New Issue
Block a user