mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 09:38:32 -04:00
This commit is contained in:
parent
ef57fa8947
commit
61dacf99ab
98 changed files with 45478 additions and 0 deletions
189
Demo/Common/FileSystem/FatFs-0.7e/doc/en/appnote.html
Normal file
189
Demo/Common/FileSystem/FatFs-0.7e/doc/en/appnote.html
Normal file
|
@ -0,0 +1,189 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs Module Application Note</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>FatFs Module Application Note</h1>
|
||||
<hr>
|
||||
|
||||
<div class="para">
|
||||
<h3>Considerations on porting to various platform</h3>
|
||||
<p>The FatFs module is assuming following terms on portability.</p>
|
||||
<ul>
|
||||
<li>ANSI C<br>
|
||||
The FatFs module is a middleware that written in ANSI C. There is no platform dependence, so long as the compiler is in compliance with ANSI C.</li>
|
||||
<li>Size of integer types<br>
|
||||
The FatFs module assumes that size of char/short/long are 8/16/32-bit and int is 16 or 32 bit. These correspondence are defined in integer.h. This will not be a problem on most compilers. When any conflict with existing definitions is occured, you must resolve it with care.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h3>Memory Usage (R0.07e)</h3>
|
||||
<table class="lst2">
|
||||
<tr><th></th><th>AVR</th><th>H8/300H</th><th>PIC</th><th>TLCS-870/C</th><th>V850ES</th><th>SH2</th><th>ARM7TDMI</th><th>x86</th></tr>
|
||||
<tr><td>Compiler</td><td>WinAVR(gcc)</td><td>CH38</td><td>C30(gcc)</td><td>CC870C</td><td>CA850</td><td>SHC</td><td>WinARM(gcc)</td><td>VC6</td></tr>
|
||||
<tr><td>_WORD_ACCESS</td><td>1</td><td>0</td><td>0</td><td>1</td><td>1</td><td>0</td><td>0</td><td>1</td></tr>
|
||||
<tr class="lst3"><td>text (Full, R/W)</td><td>12194</td><td>10559</td><td>10924</td><td>15229</td><td>7686</td><td>8727</td><td>10564</td><td>7342</td></tr>
|
||||
<tr> <td>text (Min, R/W)</td><td>7988</td><td>6903</td><td>7108</td><td>9960</td><td>4884</td><td>5651</td><td>6544</td><td>4764</td></tr>
|
||||
<tr><td>text (Full, R/O)</td><td>5532</td><td>4753</td><td>5020</td><td>6760</td><td>3462</td><td>3777</td><td>4624</td><td>3316</td></tr>
|
||||
<tr> <td>text (Min, R/O)</td><td>4040</td><td>3631</td><td>3736</td><td>5083</td><td>2556</td><td>2907</td><td>3284</td><td>2510</td></tr>
|
||||
<tr><td>bss</td><td>D*2 + 2</td><td>D*4 + 2</td><td>D*2 + 2</td><td>D*2 + 2</td><td>D*4 + 2</td><td>D*4 + 2</td><td>D*4 + 2</td><td>D*4 + 2</td></tr>
|
||||
<tr><td>Work area<br>(_FS_TINY == 0)</td><td>D*560 +<br>F*544</td><td>D*560 +<br>F*550</td><td>D*560 +<br>F*544</td><td></td><td>D*560 +<br>F*550</td><td>D*560 +<br>F*550</td><td>D*560 +<br>F*550</td><td>D*560 +<br>F*550</td></tr>
|
||||
<tr><td>Work area<br>(_FS_TINY == 1)</td><td>D*560 +<br>F*32</td><td>D*560 +<br>F*36</td><td>D*560 +<br>F*32</td><td>D*560 +<br>F*32</td><td>D*560 +<br>F*36</td><td>D*560 +<br>F*36</td><td>D*560 +<br>F*36</td><td>D*560 +<br>F*36</td></tr>
|
||||
</table>
|
||||
<p>These are the memory usage on some target systems with following condition. The memory sizes are in unit of byte, D means number of volumes and F means number of open files. All samples are optimezed in code size.</p>
|
||||
<pre>
|
||||
_FS_READONLY 0 (R/W), 1 (R/O)
|
||||
_FS_MINIMIZE 0 (Full function), 3 (Minimized function)
|
||||
_USE_STRFUNC 0 (Disable string functions)
|
||||
_USE_MKFS 0 (Disable f_mkfs function)
|
||||
_USE_FORWARD 0 (Disable f_forward function)
|
||||
_CODE_PAGE 932 (Japanese Shift-JIS)
|
||||
_USE_LFN 0 (Disable LFN)
|
||||
_LFN_UNICODE 0 (Disable Unicode API)
|
||||
_MAX_SS 512 (Single sector size)
|
||||
_FS_RPATH 0 (Disable relative path)
|
||||
_MULTI_PARTITION 0 (Single partition per drive)
|
||||
_FS_REENTRANT 0 (Disable reentrancy)
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h3>Module Size Reduction</h3>
|
||||
<p>Follwing table shows which function is removed by configuration options for the module size reduction.</p>
|
||||
<table class="lst2">
|
||||
<tr><td rowspan="2">Function</td><td colspan="3">_FS_MINIMIZE</td><td>_FS_READONLY</td><td>_USE_STRFUNC</td><td>_FS_RPATH</td><td>_USE_MKFS</td><td>_USE_FORWARD</td></tr>
|
||||
<tr><td>1</td><td>2</td><td>3</td><td>1</td><td>0</td><td>0</td><td>0</td><td>0</td></tr>
|
||||
<tr class="lst3"><td>f_mount</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
|
||||
<tr><td>f_open</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
|
||||
<tr><td>f_close</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
|
||||
<tr><td>f_read</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
|
||||
<tr><td>f_write</td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td></tr>
|
||||
<tr><td>f_sync</td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td></tr>
|
||||
<tr><td>f_lseek</td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td></tr>
|
||||
<tr><td>f_opendir</td><td></td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td></tr>
|
||||
<tr><td>f_readdir</td><td></td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td></tr>
|
||||
<tr><td>f_stat</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td></tr>
|
||||
<tr><td>f_getfree</td><td>x</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td></tr>
|
||||
<tr><td>f_truncate</td><td>x</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td></tr>
|
||||
<tr><td>f_unlink</td><td>x</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td></tr>
|
||||
<tr><td>f_mkdir</td><td>x</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td></tr>
|
||||
<tr><td>f_chmod</td><td>x</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td></tr>
|
||||
<tr><td>f_utime</td><td>x</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td></tr>
|
||||
<tr><td>f_rename</td><td>x</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td></tr>
|
||||
<tr><td>f_chdir</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td></tr>
|
||||
<tr><td>f_chdrive</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td></tr>
|
||||
<tr><td>f_mkfs</td><td></td><td></td><td></td><td>x</td><td></td><td></td><td>x</td><td></td></tr>
|
||||
<tr><td>f_forward</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>x</td></tr>
|
||||
<tr><td>f_putc</td><td></td><td></td><td></td><td>x</td><td>x</td><td></td><td></td><td></td></tr>
|
||||
<tr><td>f_puts</td><td></td><td></td><td></td><td>x</td><td>x</td><td></td><td></td><td></td></tr>
|
||||
<tr><td>f_printf</td><td></td><td></td><td></td><td>x</td><td>x</td><td></td><td></td><td></td></tr>
|
||||
<tr><td>f_gets</td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h3>Long File Name</h3>
|
||||
<p>The FatFs module supports long file name (LFN) from revision 0.07. The two different file names, SFN and LFN, of a file is transparent in the file functions except for f_readdir function. To enable LFN feature, set <tt>_USE_LFN</tt> to 1 or 2, and add a Unicode code conversion function ff_convert and ff_wtoupper to the project. This function is available in <tt>cc*.c</tt>. The LFN feature requiers a certain working buffer in addition. The buffer size can be configured by <tt>_MAX_LFN</tt> corresponding to the available memory size. The size of long file name will reach up to 255 characters so that the <tt>_MAX_LFN</tt> should be set to 255 for full featured LFN operation. When the size of working buffer is insufficient for the given file name, the file function will fail with <tt>FR_INVALID_NAME</tt>. When enable the LFN feature with re-entrant feature, <tt>_USE_LFN</tt> must be set to 2. In this case, the file funciton allocates the working buffer on the stack. The working buffer occupies <tt>(_MAX_LFN + 1) * 2</tt> bytes so that the caller's stack must be a sufficient size considering the working buffer.</p>
|
||||
<table class="lst2 rset">
|
||||
<caption>LFN cfg on ARM7</caption>
|
||||
<tr><th>Code page</th><th>ROM size [bytes]</th></tr>
|
||||
<tr><td>SBCS</td><td>+3721</td></tr>
|
||||
<tr><td>932(Shift-JIS)</td><td>+62609</td></tr>
|
||||
<tr><td>936(GBK)</td><td>+177797</td></tr>
|
||||
<tr><td>949(Korean)</td><td>+139857</td></tr>
|
||||
<tr><td>950(Big5)</td><td>+111497</td></tr>
|
||||
</table>
|
||||
<p>When the LFN feature is enabled, the module size will be increased depends on the selected code page. Right table shows the difference in module size when LFN is enabled with some code pages. We are the Japanese, Chinese and Korean have tens of thousands of characters. Unfortunately, it requires a huge OEM-Unicode bidirectional conversion table and the module size will be drastically increased that shown in the table. As the result, the FatFs with LFN will not able to be implemented to most 8-bit microcontrollers including AVR. <small>This is the reason why I had not been interested in implementing the LFN feature for a long time :-)</small></p>
|
||||
<p>Note that the LFN feature on the FAT file system is a patent of Microsoft Corporation. When enable it on the commercial products, a license from Microsoft may be required depends on the final destination.</p>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h3>Re-entrancy</h3>
|
||||
<p>The file operations to the different volume can always work simultaneously regardless of re-entrancy setting. The re-entrancy to the same volume can be enabled with <tt>_FS_REENTRANT</tt> option. In this case, also the OS dependent synchronization object control functions, ff_cre_syncobj, ff_del_syncobj, ff_req_grant and ff_rel_grant must be added to the project. The sample code with documentation is available in <tt>syncobj.c</tt>.</p>
|
||||
<p>When a file function is called while the volume is in use by any other task, the access is blocked until the task leaves file function. If wait time exceeded a period defined by <tt>_TIMEOUT</tt>, the file function will abort with <tt>FR_TIMEOUT</tt>. The timeout feature might not be supported on some RTOS.</p>
|
||||
<p>There is an exception on f_mount and f_mkfs function. These functions are not re-entrant to the same volume. When use these functions, all other task must close the corresponding file on the volume and avoid to access the volume.</p>
|
||||
<p>Note that this section describes on the re-entrancy of the FatFs module itself. There is no assumtion on the re-entrancy of low level disk I/O module.</p>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h3>Duplicated file access</h3>
|
||||
<p>FatFs module does not support the shareing controls of duplicated file access. It is permitted when open method to the file is only read mode. The duplicated open in write mode to a file is always prohibited and open file must not be renamed, deleted, otherwise the FAT structure on the volume can be collapted.</p>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h3>Performance effective file access</h3>
|
||||
<p>For good performance on reading/writing files on the small embedded system, application programmer should consider what process is done in the FatFs module. The file data on the disk is transferred in following sequence by f_read function.</p>
|
||||
<p>Figure 1. Sector miss-aligned read (short)<br>
|
||||
<img src="../img/f1.png" width="490" height="73" alt="">
|
||||
</p>
|
||||
<p>Figure 2. Sector miss-aligned read (long)<br>
|
||||
<img src="../img/f2.png" width="490" height="140" alt="">
|
||||
</p>
|
||||
<p>Figure 3. Sector aligned read<br>
|
||||
<img src="../img/f3.png" width="490" height="119" alt="">
|
||||
</p>
|
||||
<p>The file I/O buffer means a sector buffer to read/write a partial data on the sector. The sector buffer is either file private sector buffer on each file object or shared sector buffer on the file system object. The buffer configuration option <tt>_FS_TINY</tt> determins which sector buffer is used for the file data transfer. When tiny buffer (1) is selected, data memory consumption is reduced 512 bytes each file object. In this case, FatFs module uses only a sector buffer on the file system object for file data transfer and FAT/directory access. The disadvantage of the tiny buffer configuration is: the FAT data cached in the sector buffer will be lost by file data transfer and it must be reloaded at every cluster boundary. However it will be suitable for most application from view point of the decent performance and low memory comsumption.</p>
|
||||
<p>Figure 1 shows that partial sector data is transferred via the file I/O buffer. On long data transfer shown in Figure 2, middle of transfer data that covers one or more sector is transferred to application buffer directly. Figure 3 shows that the case of entier transfer data is aligned to the sector boundary. In this case, file I/O buffer is not used. On the direct transfer, the maximum extent of sectors are read with disk_read function at a time but the multi sector transfer never across the cluster boundary even if it is contiguous.</p>
|
||||
<p>Therefore taking effort to sector aligned read/write accesss avoids 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 on the tiny configuration so that it can achieve same performance as non tiny configuration with small memory footprint.</p>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h3>Critical Section</h3>
|
||||
<p>When write operation to the FAT file system is interrupted due to any accidental failure, such as sudden blackout, incorrect disk removal and unrecoverable disk error, the FAT structure can be collapted. Following images shows the critical section on the FatFs application.</p>
|
||||
<div class="lset">
|
||||
Figure 4. Long critical section<br>
|
||||
<img src="../img/f4.png" width="320" height="436" alt="fig.4">
|
||||
</div>
|
||||
<div class="lset">
|
||||
Figure 5. Minimized critical section<br>
|
||||
<img src="../img/f5.png" width="320" height="436" alt="fig.5">
|
||||
</div>
|
||||
<br class="clr">
|
||||
<p>An interruption in the red section can cause a cross link; as a result, the file/directory being changed may be lost. There is one or more possibility listed below when an interruption in the yellow section is occured.</p>
|
||||
<ul>
|
||||
<li>File data being rewrited is collapted.</li>
|
||||
<li>A file being appended returns initial state.</li>
|
||||
<li>A file created as new is gone.</li>
|
||||
<li>A file created as new or in overwritten remains with length of zero.</li>
|
||||
<li>Efficiency of disk use gets worse due to lost chain.</li>
|
||||
</ul>
|
||||
<p>Each case does not affect the files that not in write mode open. To minimize risk of data loss, the critical section can be minimized like shown in Figure 5 by minimizing the time that file is opened in write mode or using f_sync function properly.</p>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h3>Unicode API</h3>
|
||||
<p>FatFs supports OEM code set on the API in default but FatFs can also switch the code set to Unicode. For more information, refer to the description in the <a href="filename.html">file name</a>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h3>About FatFs License</h3>
|
||||
<p>This is a copy of the FatFs license document that included in the source codes.</p>
|
||||
<pre>/*----------------------------------------------------------------------------/
|
||||
/ FatFs - FAT file system module R0.07e (C)ChaN, 2009
|
||||
/-----------------------------------------------------------------------------/
|
||||
/ FatFs module is a generic FAT file system module for small embedded systems.
|
||||
/ This is a free software that opened for education, research and commercial
|
||||
/ developments under license policy of following trems.
|
||||
/
|
||||
/ Copyright (C) 2009, ChaN, all right reserved.
|
||||
/
|
||||
/ * The FatFs module is a free software and there is NO WARRANTY.
|
||||
/ * No restriction on use. You can use, modify and redistribute it for
|
||||
/ personal, non-profit or commercial products UNDER YOUR RESPONSIBILITY.
|
||||
/ * Redistributions of source code must retain the above copyright notice.
|
||||
/
|
||||
/-----------------------------------------------------------------------------/</pre>
|
||||
<p>Therefore FatFs license is one of the BSD-style license but there is a big difference. Because FatFs is for embedded projects, the conditions for redistributions in binary form, such as embedded code, hex file and binary library, are not specified to increase its usability. The documentation of the distributions need not include about FatFs and its license document, and it may also. Of course FatFs is compatible with the projects under GNU GPL. When redistribute it with any modification, the license can also be changed to GNU GPL or BSD license.</p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
87
Demo/Common/FileSystem/FatFs-0.7e/doc/en/chdir.html
Normal file
87
Demo/Common/FileSystem/FatFs-0.7e/doc/en/chdir.html
Normal file
|
@ -0,0 +1,87 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_chdir</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_chdir</h2>
|
||||
<p>The f_chdir function changes the current directory of a drive.</p>
|
||||
<pre>
|
||||
FRESULT f_chdir (
|
||||
const XCHAR* <em>Path</em> /* Pointer to the path name */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>Path</dt>
|
||||
<dd>Pointer to the null-terminated string that specifies a <a href="filename.html">directory</a> to go.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>The function succeeded.</dd>
|
||||
<dt>FR_NO_PATH</dt>
|
||||
<dd>Could not find the path.</dd>
|
||||
<dt>FR_INVALID_NAME</dt>
|
||||
<dd>The path name is invalid.</dd>
|
||||
<dt>FR_INVALID_DRIVE</dt>
|
||||
<dd>The drive number is invalid.</dd>
|
||||
<dt>FR_NOT_READY</dt>
|
||||
<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
|
||||
<dt>FR_DISK_ERR</dt>
|
||||
<dd>The function failed due to an error in the disk function.</dd>
|
||||
<dt>FR_INT_ERR</dt>
|
||||
<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
|
||||
<dt>FR_NOT_ENABLED</dt>
|
||||
<dd>The logical drive has no work area.</dd>
|
||||
<dt>FR_NO_FILESYSTEM</dt>
|
||||
<dd>There is no valid FAT volume on the disk.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The f_chdir function changes the current directory of the logical drive. The current directory of a drive is initialized to the root directory when the drive is auto-mounted. Note that the current directory is retained in the each file system object so that it also affects other tasks that using the drive.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Available when <tt>_FS_RPATH == 1</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Example</h4>
|
||||
<pre>
|
||||
// Change current direcoty of the current drive (dir1 under root dir)
|
||||
f_chdir("/dir1");
|
||||
|
||||
// Change current direcoty of drive 2 (parent dir)
|
||||
f_chdir("2:..");
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="chdrive.html">f_chdrive</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
61
Demo/Common/FileSystem/FatFs-0.7e/doc/en/chdrive.html
Normal file
61
Demo/Common/FileSystem/FatFs-0.7e/doc/en/chdrive.html
Normal file
|
@ -0,0 +1,61 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_chdrive</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_chdrive</h2>
|
||||
<p>The f_chdrive function changes the current drive.</p>
|
||||
<pre>
|
||||
FRESULT f_chdrive (
|
||||
BYTE <em>Drive</em> /* Logical drive number */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>Drive</dt>
|
||||
<dd>Specifies the <a href="filename.html">logical drive number</a> to be set as the current drive.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>The function succeeded.</dd>
|
||||
<dt>FR_INVALID_DRIVE</dt>
|
||||
<dd>The drive number is invalid.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The f_chdrive function changes the current drive. The initial value of the current drive number is 0. Note that the current drive is retained in a static variable so that it also affects other tasks that using the file functions.</p>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Available when <tt>_FS_RPATH == 1</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="chdir.html">f_chdir</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
97
Demo/Common/FileSystem/FatFs-0.7e/doc/en/chmod.html
Normal file
97
Demo/Common/FileSystem/FatFs-0.7e/doc/en/chmod.html
Normal file
|
@ -0,0 +1,97 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_chmod</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_chmod</h2>
|
||||
<p>The f_chmod function changes the attribute of a file or directory.</p>
|
||||
<pre>
|
||||
FRESULT f_chmod (
|
||||
const XCHAR* <em>FileName</em>, /* Pointer to the file or directory */
|
||||
BYTE <em>Attribute</em>, /* Attribute flags */
|
||||
BYTE <em>AttributeMask</em> /* Attribute masks */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>FileName</dt>
|
||||
<dd>Pointer to the null-terminated string that specifies a <a href="filename.html">file or directory</a> to be changed</dd>
|
||||
<dt>Attribute</dt>
|
||||
<dd>Attribute flags to be set in one or more combination of the following flags. The specified flags are set and others are cleard.<br>
|
||||
<table class="lst">
|
||||
<tr><th>Attribute</th><th>Description</th></tr>
|
||||
<tr><td>AM_RDO</td><td>Read only</td></tr>
|
||||
<tr><td>AM_ARC</td><td>Archive</td></tr>
|
||||
<tr><td>AM_SYS</td><td>System</td></tr>
|
||||
<tr><td>AM_HID</td><td>Hidden</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
<dt>AttributeMask</dt>
|
||||
<dd>Attribute mask that specifies which attribute is changed. The specified aattributes are set or cleard.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>The function succeeded.</dd>
|
||||
<dt>FR_NO_FILE</dt>
|
||||
<dd>Could not find the file.</dd>
|
||||
<dt>FR_NO_PATH</dt>
|
||||
<dd>Could not find the path.</dd>
|
||||
<dt>FR_INVALID_NAME</dt>
|
||||
<dd>The file name is invalid.</dd>
|
||||
<dt>FR_INVALID_DRIVE</dt>
|
||||
<dd>The drive number is invalid.</dd>
|
||||
<dt>FR_NOT_READY</dt>
|
||||
<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
|
||||
<dt>FR_WRITE_PROTECTED</dt>
|
||||
<dd>The medium is write protected.</dd>
|
||||
<dt>FR_DISK_ERR</dt>
|
||||
<dd>The function failed due to an error in the disk function.</dd>
|
||||
<dt>FR_INT_ERR</dt>
|
||||
<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
|
||||
<dt>FR_NOT_ENABLED</dt>
|
||||
<dd>The logical drive has no work area.</dd>
|
||||
<dt>FR_NO_FILESYSTEM</dt>
|
||||
<dd>There is no valid FAT volume on the disk.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The f_chmod function changes the attribute of a file or directory.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_FS_MINIMIZE == 0</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Example</h4>
|
||||
<pre>
|
||||
// Set read-only flag, clear archive flag and others are retained.
|
||||
f_chmod("file.txt", AR_RDO, AR_RDO | AR_ARC);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
68
Demo/Common/FileSystem/FatFs-0.7e/doc/en/close.html
Normal file
68
Demo/Common/FileSystem/FatFs-0.7e/doc/en/close.html
Normal file
|
@ -0,0 +1,68 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_close</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_close</h2>
|
||||
<p>The f_close function closes an open file.</p>
|
||||
<pre>
|
||||
FRESULT f_close (
|
||||
FIL* <em>FileObject</em> /* Pointer to the file object structure */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameter</h4>
|
||||
<dl class="par">
|
||||
<dt>FileObject</dt>
|
||||
<dd>Pointer to the open file object structure to be closed.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>The file object has been closed successfuly.</dd>
|
||||
<dt>FR_DISK_ERR</dt>
|
||||
<dd>The function failed due to an error in the disk function.</dd>
|
||||
<dt>FR_INT_ERR</dt>
|
||||
<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
|
||||
<dt>FR_NOT_READY</dt>
|
||||
<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
|
||||
<dt>FR_INVALID_OBJECT</dt>
|
||||
<dd>The file object is invalid.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The f_close function closes an open file object. If any data has been written to the file, the cached information of the file is written back to the disk. After the function succeeded, the file object is no longer valid and it can be discarded. If the file object has been opened in read-only mode, it may be discarded without closing process by this function.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Always available.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="read.html">f_read</a>, <a href="write.html">f_write</a>, <a href="sync.html">f_sync</a>, <a href="sfile.html">FIL</a>, <a href="sfatfs.html">FATFS</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
45
Demo/Common/FileSystem/FatFs-0.7e/doc/en/dinit.html
Normal file
45
Demo/Common/FileSystem/FatFs-0.7e/doc/en/dinit.html
Normal file
|
@ -0,0 +1,45 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - disk_initialize</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>disk_initialize</h2>
|
||||
<p>The disk_initialize function initializes the disk drive.</p>
|
||||
<pre>
|
||||
DSTATUS disk_initialize (
|
||||
BYTE <em>Drive</em> /* Physical drive number */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameter</h4>
|
||||
<dl class="par">
|
||||
<dt>Drive</dt>
|
||||
<dd>Specifies the physical drive number to initialize.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<p>This function returns a disk status as the result. For details of the disk status, refer to the <a href="dstat.html">disk_status</a> function.</p>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The disk_initialize function initializes a physical drive. When the function succeeded, <tt>STA_NOINIT</tt> flag in the return value is cleard.</p>
|
||||
<p>This function is called from volume mount process in the FatFs module to manage the media change. <em>Application program must not call this function while FatFs module is active, or FAT structure on the volume can be collapted. To re-initialize the file system, use f_mount function.</em></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
68
Demo/Common/FileSystem/FatFs-0.7e/doc/en/dioctl.html
Normal file
68
Demo/Common/FileSystem/FatFs-0.7e/doc/en/dioctl.html
Normal file
|
@ -0,0 +1,68 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - disk_ioctl</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>disk_ioctl</h2>
|
||||
<p>The disk_ioctl function cntrols device specified features and miscellaneous functions other than disk read/write.</p>
|
||||
<pre>
|
||||
DRESULT disk_ioctl (
|
||||
BYTE <em>Drive</em>, /* Drive number */
|
||||
BYTE <em>Command</em>, /* Control command code */
|
||||
void* <em>Buffer</em> /* Data transfer buffer */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>Drive</dt>
|
||||
<dd>Specifies the drive number (0-9).</dd>
|
||||
<dt>Command</dt>
|
||||
<dd>Specifies the command code.</dd>
|
||||
<dt>Buffer</dt>
|
||||
<dd>Pointer to the parameter buffer depends on the command code. When it is not used, specify a NULL pointer.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Value</h4>
|
||||
<dl class="ret">
|
||||
<dt>RES_OK (0)</dt>
|
||||
<dd>The function succeeded.</dd>
|
||||
<dt>RES_ERROR</dt>
|
||||
<dd>Any error occured.</dd>
|
||||
<dt>RES_PARERR</dt>
|
||||
<dd>Invalid command code.</dd>
|
||||
<dt>RES_NOTRDY</dt>
|
||||
<dd>The disk drive has not been initialized.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The FatFs module uses only device independent commands described below. Any device dependent function is not used.</p>
|
||||
<table class="lst">
|
||||
<tr><th>Command</th><th>Description</th></tr>
|
||||
<tr><td>CTRL_SYNC</td><td>Make sure that the disk drive has finished pending write process. When the disk I/O module has a write back cache, flush the dirty sector immediately. This command is not required in read-only configuration.</p>
|
||||
</td></tr>
|
||||
<tr><td>GET_SECTOR_SIZE</td><td>Returns sector size of the drive into the WORD variable pointed by Buffer. This command is not required in single sector size configuration, _MAX_SS is 512.</td></tr>
|
||||
<tr><td>GET_SECTOR_COUNT</td><td>Returns total sectors on the drive into the DWORD variable pointed by Buffer. This command is used in only f_mkfs function.</td></tr>
|
||||
<tr><td>GET_BLOCK_SIZE</td><td>Returns erase block size of the memory array in unit of sector into the DWORD variable pointed by Buffer. When the erase block size is unknown or magnetic disk device, return 1. This command is used in only f_mkfs function.</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
58
Demo/Common/FileSystem/FatFs-0.7e/doc/en/dread.html
Normal file
58
Demo/Common/FileSystem/FatFs-0.7e/doc/en/dread.html
Normal file
|
@ -0,0 +1,58 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - disk_read</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>disk_read</h2>
|
||||
<p>The disk_read function reads sector(s) from the disk drive.</p>
|
||||
<pre>
|
||||
DRESULT disk_read (
|
||||
BYTE <em>Drive</em>, /* Physical drive number */
|
||||
BYTE* <em>Buffer</em>, /* Pointer to the read data buffer */
|
||||
DWORD <em>SectorNumber</em>, /* Start sector number */
|
||||
BYTE <em>SectorCount</em> /* Number of sectros to read */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>Drive</dt>
|
||||
<dd>Specifies the physical drive number.</dd>
|
||||
<dt>Buffer</dt>
|
||||
<dd>Pointer to the byte array to store the read data. The buffer size of number of bytes to be read, sector size * sector count, is required. The memory address specified by upper layer may or may not be aligned to word boundary.</dd>
|
||||
<dt>SectorNumber</dt>
|
||||
<dd>Specifies the start sector number in logical block address (LBA).</dd>
|
||||
<dt>SectorCount</dt>
|
||||
<dd>Specifies number of sectors to read. The value can be 1 to 255.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Value</h4>
|
||||
<dl class="ret">
|
||||
<dt>RES_OK (0)</dt>
|
||||
<dd>The function succeeded.</dd>
|
||||
<dt>RES_ERROR</dt>
|
||||
<dd>Any hard error occured during the read operation and could not recover it.</dd>
|
||||
<dt>RES_PARERR</dt>
|
||||
<dd>Invalid parameter.</dd>
|
||||
<dt>RES_NOTRDY</dt>
|
||||
<dd>The disk drive has not been initialized.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
47
Demo/Common/FileSystem/FatFs-0.7e/doc/en/dstat.html
Normal file
47
Demo/Common/FileSystem/FatFs-0.7e/doc/en/dstat.html
Normal file
|
@ -0,0 +1,47 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - disk_status</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>disk_status</h2>
|
||||
<p>The disk_status function returns the current disk status.</p>
|
||||
<pre>
|
||||
DSTATUS disk_status (
|
||||
BYTE <em>Drive</em> /* Physical drive number */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameter</h4>
|
||||
<dl class="par">
|
||||
<dt>Drive</dt>
|
||||
<dd>Specifies the physical drive number to be confirmed.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<p>The disk status is returned in combination of following flags.</p>
|
||||
<dl class="ret">
|
||||
<dt>STA_NOINIT</dt>
|
||||
<dd>Indicates that the disk drive has not been initialized. This flag is set on: system reset, disk removal and disk_initialize function failed, and cleared on: disk_initialize function succeeded.</dd>
|
||||
<dt>STA_NODISK</dt>
|
||||
<dd>Indicates that no medium in the drive. This is always cleared on fixed disk drive.</dd>
|
||||
<dt>STA_PROTECTED</dt>
|
||||
<dd>Indicates that the medium is write protected. This is always cleared on the drive that does not support write protect notch. Not valid when <tt>STA_NODISK</tt> is set.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
66
Demo/Common/FileSystem/FatFs-0.7e/doc/en/dwrite.html
Normal file
66
Demo/Common/FileSystem/FatFs-0.7e/doc/en/dwrite.html
Normal file
|
@ -0,0 +1,66 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - disk_write</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>disk_write</h2>
|
||||
<p>The disk_write writes sector(s) to the disk.</p>
|
||||
<pre>
|
||||
DRESULT disk_write (
|
||||
BYTE <em>Drive</em>, /* Physical drive number */
|
||||
const BYTE* <em>Buffer</em>, /* Pointer to the write data (may be non aligned) */
|
||||
DWORD <em>SectorNumber</em>, /* Sector number to write */
|
||||
BYTE <em>SectorCount</em> /* Number of sectors to write */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>Drive</dt>
|
||||
<dd>Specifies the physical drive number.</dd>
|
||||
<dt>Buffer</dt>
|
||||
<dd>Pointer to the byte array to be written. The memory address specified by upper layer may or may not be aligned to word boundary.</dd>
|
||||
<dt>SectorNumber</dt>
|
||||
<dd>Specifies the start sector number in logical block address (LBA).</dd>
|
||||
<dt>SectorCount</dt>
|
||||
<dd>Specifies the number of sectors to write. The value can be 1 to 255.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<dl class="ret">
|
||||
<dt>RES_OK (0)</dt>
|
||||
<dd>The function succeeded.</dd>
|
||||
<dt>RES_ERROR</dt>
|
||||
<dd>Any hard error occured during the write operation and could not recover it.</dd>
|
||||
<dt>RES_WRPRT</dt>
|
||||
<dd>The medium is write protected.</dd>
|
||||
<dt>RES_PARERR</dt>
|
||||
<dd>Invalid parameter.</dd>
|
||||
<dt>RES_NOTRDY</dt>
|
||||
<dd>The disk drive has not been initialized.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>This function is not required in read only configuration.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
50
Demo/Common/FileSystem/FatFs-0.7e/doc/en/fattime.html
Normal file
50
Demo/Common/FileSystem/FatFs-0.7e/doc/en/fattime.html
Normal file
|
@ -0,0 +1,50 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - get_fattime</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>get_fattime</h2>
|
||||
<p>The get_fattime function gets current time.</p>
|
||||
<pre>
|
||||
DWORD get_fattime (void);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Value</h4>
|
||||
<p>Currnet time is returned with packed into a DWORD value. The bit field is as follows:</p>
|
||||
<dl class="ret">
|
||||
<dt>bit31:25</dt>
|
||||
<dd>Year from 1980 (0..127)</dd>
|
||||
<dt>bit24:21</dt>
|
||||
<dd>Month (1..12)</dd>
|
||||
<dt>bit20:16</dt>
|
||||
<dd>Day in month(1..31)</dd>
|
||||
<dt>bit15:11</dt>
|
||||
<dd>Hour (0..23)</dd>
|
||||
<dt>bit10:5</dt>
|
||||
<dd>Minute (0..59)</dd>
|
||||
<dt>bit4:0</dt>
|
||||
<dd>Second / 2 (0..29)</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The get_fattime function must return any valid time even if the system does not support a real time clock. If a zero is returned, the file will not have a valid time. This fucntion is not required in read only configuration.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
68
Demo/Common/FileSystem/FatFs-0.7e/doc/en/filename.html
Normal file
68
Demo/Common/FileSystem/FatFs-0.7e/doc/en/filename.html
Normal file
|
@ -0,0 +1,68 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - Path Names</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>Format of the path names</h2>
|
||||
<p>The path name format 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>
|
||||
<p>The FatFs module supports long file name (LFN) and 8.3 format file name (SFN). The LFN can be used when LFN feature is enabled <tt>(_USE_LFN > 0)</tt>. The differences between DOS/Windows are directory separator and logical drive number. The sub directories are separated with a / or \. The logical drive is specified in a numeral with a colon. When the drive number is omitted, it is assumed as default drive (0 or current drive). Leading/embedded spaces in the given path name are valid as a part of the name on LFN configuration but they are recognized as end of the path name on non-LFN configuration.</p>
|
||||
<p>In default configuration <tt>(_FS_RPATH == 0)</tt>, it does not have a concept of current directory like OS oriented file system. All objects on the volume are always specified in full path name that follows from the root directory. Dot directory names are not allowed. Heading separator is ignored and it can be exist or omitted. The default drive number is fixed to 0.</p>
|
||||
<p>When relative path feature is enabled <tt>(_FS_RPATH == 1)</tt>, specified path is followed from the root directory if a heading separator is exist. If not, the path is followed from the current directory set with <a href="chdir.html">f_chdir</a> function. Dot names are also allowed for the directory name. The default drive number is the current drive number set with <a href="chdrive.html">f_chdrive</a> function.</p>
|
||||
<table class="lst2">
|
||||
<tr><td>Path name</td><td>_FS_RPATH == 0</td><td>_FS_RPATH == 1</td></tr>
|
||||
<tr class="lst3"><td>file.txt</td><td>A file in the root directory on the drive 0</td><td>A file in the current directory on the current drive</td></tr>
|
||||
<tr><td>/file.txt</td><td>A file in the root directory on the drive 0</td><td>A file in the root directory on the current drive</td></tr>
|
||||
<tr><td></td><td>The root directory on the drive 0</td><td>The current directory on the current drive</td></tr>
|
||||
<tr><td>2:</td><td>The root directory on the drive 2</td><td>The current directory on the drive 2</td></tr>
|
||||
<tr><td>2:file.txt</td><td>A file in the root directory on the drive 2</td><td>A file in the current directory on the drive 2</td></tr>
|
||||
<tr><td>2:/</td><td>The root directory on the drive 2</td><td>The root directory on the drive 2</td></tr>
|
||||
<tr><td>../file.txt</td><td>Invalid name</td><td>A file in the parent directory</td></tr>
|
||||
<tr><td>.</td><td>Invalid name</td><td>This directory</td></tr>
|
||||
<tr><td>..</td><td>Invalid name</td><td>Parent directory of 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>Invalid name (Cannot use dot names at the root directory)</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p><br></p>
|
||||
<div class="para">
|
||||
<h2>Unicode API</h2>
|
||||
<p>The path names are input/output in either OEM code (SBCS/DBCS) or Unicode depends on the configuration options. The type of arguments that specifies the file names are defined as <tt>XCHAR</tt> which is an alias of <tt>char</tt> in default. The code set of the file name string is the OEM code set specifid by <tt>_CODE_PAGE</tt>. When <tt>_LFN_UNICODE</tt> is set to 1 under LFN configuration, the type of the <tt>XCHAR</tt> is switched to <tt>unsigned short</tt> (wide character) to support Unicode. In this case, the LFN feature is fully supported and the Unicode specific characters, such as ✝☪✡☸☭, can also be used for the path name.</p>
|
||||
</div>
|
||||
|
||||
<p><br></p>
|
||||
<div class="para">
|
||||
<h2>Correspondence between logical and physical drives</h2>
|
||||
<p>The FatFs module has work areas that called <em>file system object</em> for each volume (logical drive). In default, the logical drive is bound to the physical drive that has same drive number, and the first partition is mounted. When <tt>_MULTI_PARTITION == 1</tt> is specified in configuration option, each individual logical drive can be bound to any physical drive/partition. In this case, a drive number resolution table must be defined as follows:</p>
|
||||
<pre>
|
||||
Example: Logical drive 0-2 are assigned to three pri-partitions on the physical drive 0 (fixed disk)
|
||||
Logical drive 3 is assigned to physical drive 1 (removable disk)
|
||||
|
||||
const PARTITION Drives[] = {
|
||||
{0, 0}, /* Logical drive 0 ==> Physical drive 0, 1st partition */
|
||||
{0, 1}, /* Logical drive 1 ==> Physical drive 0, 2nd partition */
|
||||
{0, 2}, /* Logical drive 2 ==> Physical drive 0, 3rd partition */
|
||||
{1, 0} /* Logical drive 3 ==> Physical drive 1 */
|
||||
};
|
||||
</pre>
|
||||
<p>There are some considerations when use <tt>_MULTI_PARTITION</tt> configuration.</p>
|
||||
<ul>
|
||||
<li>Only pri-partition (0-3) can be mounted.</li>
|
||||
<li>When the physical drive has no partition table (SFD format), the partition number is ignored.</li>
|
||||
<li>The physical drive that has two or more logical drives must be a fixed drive.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
142
Demo/Common/FileSystem/FatFs-0.7e/doc/en/forward.html
Normal file
142
Demo/Common/FileSystem/FatFs-0.7e/doc/en/forward.html
Normal file
|
@ -0,0 +1,142 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_forward</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_forward</h2>
|
||||
<p>The f_forward function reads the file data and forward it to the data streaming device.</p>
|
||||
<pre>
|
||||
FRESULT f_forward (
|
||||
FIL* <em>FileObject</em>, /* File object */
|
||||
UINT (*<em>Func</em>)(const BYTE*,UINT), /* Data streaming function */
|
||||
UINT <em>ByteToFwd</em>, /* Number of bytes to forward */
|
||||
UINT* <em>ByteFwd</em> /* Number of bytes forwarded */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>FileObject</dt>
|
||||
<dd>Pointer to the open file object.</dd>
|
||||
<dt>Func</dt>
|
||||
<dd>Pointer to the user-defined data streaming function. For details, refer to the sample code.</dd>
|
||||
<dt>ByteToFwd</dt>
|
||||
<dd>Number of bytes to forward in range of UINT.</dd>
|
||||
<dt>ByteFwd</dt>
|
||||
<dd>Pointer to the UINT variable to return number of bytes forwarded.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>The function succeeded.</dd>
|
||||
<dt>FR_DENIED</dt>
|
||||
<dd>The function denied due to the file has been opened in non-read mode.</dd>
|
||||
<dt>FR_DISK_ERR</dt>
|
||||
<dd>The function failed due to an error in the disk function.</dd>
|
||||
<dt>FR_INT_ERR</dt>
|
||||
<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
|
||||
<dt>FR_NOT_READY</dt>
|
||||
<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
|
||||
<dt>FR_INVALID_OBJECT</dt>
|
||||
<dd>The file object is invalid.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The f_forward function reads the data from the file and forward it to the outgoing stream without data buffer. This is suitable for small memory system because it does not require any data buffer at application module. The file pointer of the file object increases in number of bytes forwarded. In case of <tt>*ByteFwd < ByteToFwd</tt> without error, it means the requested bytes could not be transferred due to end of file or stream goes busy during data transfer.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Available when <tt>_USE_FORWARD == 1</tt> and <tt>_FS_TINY == 1</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Example (Audio playback)</h4>
|
||||
<pre>
|
||||
/*-----------------------------------------------------------------------*/
|
||||
/* Sample code of data transfer function to be called from f_forward */
|
||||
/*-----------------------------------------------------------------------*/
|
||||
|
||||
UINT out_stream ( /* Returns number of bytes sent or stream status */
|
||||
const BYTE *p, /* Pointer to the data block to be sent */
|
||||
UINT btf /* >0: Transfer call (Number of bytes to be sent). 0: Sense call */
|
||||
)
|
||||
{
|
||||
UINT cnt = 0;
|
||||
|
||||
|
||||
if (btf == 0) { /* Sense call */
|
||||
/* Return stream status (0: Busy, 1: Ready) */
|
||||
/* When once it returned ready to sense call, it must accept a byte at least */
|
||||
/* at subsequent transfer call, or f_forward will fail with FR_INT_ERROR. */
|
||||
if (FIFO_READY) cnt = 1;
|
||||
}
|
||||
else { /* Transfer call */
|
||||
do { /* Repeat while there is any data to be sent and the stream is ready */
|
||||
FIFO_PORT = *p++;
|
||||
cnt++;
|
||||
} while (cnt < btf && FIFO_READY);
|
||||
}
|
||||
|
||||
return cnt;
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
/* Sample code using f_forward function */
|
||||
/*-----------------------------------------------------------------------*/
|
||||
|
||||
FRESULT play_file (
|
||||
char *fn /* Pointer to the audio file name to be played */
|
||||
)
|
||||
{
|
||||
FRESULT rc;
|
||||
FIL fil;
|
||||
UINT dmy;
|
||||
|
||||
/* Open the audio file in read only mode */
|
||||
rc = f_open(&fil, fn, FA_READ);
|
||||
|
||||
/* Repeat until the file pointer reaches end of the file */
|
||||
while (rc == FR_OK && fil.fptr < fil.fsize) {
|
||||
|
||||
/* any other processes... */
|
||||
|
||||
/* Fill output stream periodicaly or on-demand */
|
||||
rc = f_forward(&fil, out_stream, 1000, &dmy);
|
||||
}
|
||||
|
||||
/* The read-only file object may be discarded without close */
|
||||
return rc;
|
||||
}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="gets.html">fgets</a>, <a href="write.html">f_write</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
101
Demo/Common/FileSystem/FatFs-0.7e/doc/en/getfree.html
Normal file
101
Demo/Common/FileSystem/FatFs-0.7e/doc/en/getfree.html
Normal file
|
@ -0,0 +1,101 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_getfree</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_getfree</h2>
|
||||
<p>The f_getfree function gets number of the free clusters.</p>
|
||||
<pre>
|
||||
FRESULT f_getfree (
|
||||
const XCHAR* <em>Path</em>, /* Root directory of the drive */
|
||||
DWORD* <em>Clusters</em>, /* Pointer to the variable to store number of free clusters */
|
||||
FATFS** <em>FileSystemObject</em> /* Pointer to pointer to file system object */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>Path</dt>
|
||||
<dd>Pinter to the null-terminated string that specifies the <a href="filename.html">root directory</a> of the logical drive.</dd>
|
||||
<dt>Clusters</dt>
|
||||
<dd>Pointer to the DWORD variable to store number of free clusters.</dd>
|
||||
<dt>FileSystemObject</dt>
|
||||
<dd>Pointer to pointer that to store a pointer to the corresponding file system object.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>The function succeeded. The <tt><em>*Clusters</em></tt> has number of free clusters and <tt><em>*FileSystemObject</em></tt> points the file system object.</dd>
|
||||
<dt>FR_INVALID_DRIVE</dt>
|
||||
<dd>The drive number is invalid.</dd>
|
||||
<dt>FR_NOT_READY</dt>
|
||||
<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
|
||||
<dt>FR_DISK_ERR</dt>
|
||||
<dd>The function failed due to an error in the disk function.</dd>
|
||||
<dt>FR_INT_ERR</dt>
|
||||
<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
|
||||
<dt>FR_NOT_ENABLED</dt>
|
||||
<dd>The logical drive has no work area.</dd>
|
||||
<dt>FR_NO_FILESYSTEM</dt>
|
||||
<dd>There is no valid FAT partition on the disk.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Descriptions</h4>
|
||||
<p>The f_getfree function gets number of free clusters on the drive. The member <tt>csize</tt> in the file system object is refrecting number of sectors per cluster, so that the free space in unit of sector can be calcurated with this. When FSInfo structure on FAT32 volume is not in sync, this function can return an incorrect free cluster count.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_FS_MINIMIZE == 0</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Example</h4>
|
||||
<pre>
|
||||
FATFS *fs;
|
||||
DWORD fre_clust, fre_sect, tot_sect;
|
||||
|
||||
|
||||
/* Get drive information and free clusters */
|
||||
res = f_getfree("/", &fre_clust, &fs);
|
||||
if (res) die(res);
|
||||
|
||||
/* Get total sectors and free sectors */
|
||||
tot_sect = (fs->max_clust - 2) * fs->csize;
|
||||
fre_sect = fre_clust * fs->csize;
|
||||
|
||||
/* Print free space in unit of KB (assuming 512B/sector) */
|
||||
printf("%lu KB total drive space.\n"
|
||||
"%lu KB available.\n",
|
||||
fre_sect / 2, tot_sect / 2);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="sfatfs.html">FATFS</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
63
Demo/Common/FileSystem/FatFs-0.7e/doc/en/gets.html
Normal file
63
Demo/Common/FileSystem/FatFs-0.7e/doc/en/gets.html
Normal file
|
@ -0,0 +1,63 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_gets</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_gets</h2>
|
||||
<p>The f_gets reads a string from the file.</p>
|
||||
<pre>
|
||||
char* f_gets (
|
||||
char* <em>Str</em>, /* Read buffer */
|
||||
int <em>Size</em>, /* Size of the read buffer */
|
||||
FIL* <em>FileObject</em> /* File object */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>Str</dt>
|
||||
<dd>Pointer to read buffer to store the read string.</dd>
|
||||
<dt>Size</dt>
|
||||
<dd>Size of the read buffer.</dd>
|
||||
<dt>FileObject</dt>
|
||||
<dd>Pointer to the open file object structure.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<p>When the function succeeded, <tt>Str</tt> will be returuned.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The f_gets() is a wrapper function of <a href="read.html">f_read()</a>. The read operation continues until a <tt>'\n'</tt> is stored, reached end of file or buffer is filled with Size - 1 characters. The read string is terminated with a <tt>'\0'</tt>. When the file has reached end of the file or any error occured during read operation, f_gets() returns a <tt>NULL</tt>. The EOF and error status can be examined with <tt>f_eof()</tt> and <tt>f_error()</tt> macro.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Available when <tt>_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>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="read.html">f_read</a>, <a href="putc.html">f_putc</a>, <a href="puts.html">f_puts</a>, <a href="printf.html">f_printf</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
111
Demo/Common/FileSystem/FatFs-0.7e/doc/en/lseek.html
Normal file
111
Demo/Common/FileSystem/FatFs-0.7e/doc/en/lseek.html
Normal file
|
@ -0,0 +1,111 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_lseek</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_lseek</h2>
|
||||
<p>The f_lseek function moves the file read/write pointer of an open file object. It can also be used to increase the file size (cluster pre-allocation).</p>
|
||||
|
||||
<pre>
|
||||
FRESULT f_lseek (
|
||||
FIL* <em>FileObject</em>, /* Pointer to the file object structure */
|
||||
DWORD <em>Offset</em> /* File offset in unit of byte */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>FileObject</dt>
|
||||
<dd>Pointer to the open file object.</dd>
|
||||
<dt>Offset</dt>
|
||||
<dd>Number of bytes where from start of the file</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>The function succeeded.</dd>
|
||||
<dt>FR_DISK_ERR</dt>
|
||||
<dd>The function failed due to an error in the disk function.</dd>
|
||||
<dt>FR_INT_ERR</dt>
|
||||
<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
|
||||
<dt>FR_NOT_READY</dt>
|
||||
<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
|
||||
<dt>FR_INVALID_OBJECT</dt>
|
||||
<dd>The file object is invalid.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The f_lseek function moves the file R/W pointer of an open file. The offset can be specified in only origin from top of the file. When an offset above the file size is specified in write mode, the file size is increased and the data in the expanded area is undefined. This is suitable to create a large file quickly, for fast write operation. After the f_lseek function succeeded, member fptr in the file object should be checked in order to make sure the R/W pointer has been moved correctry. In case of fptr is not the expected value, either of followings has been occured.</p>
|
||||
<ul>
|
||||
<li>End of file. The specified Offset was clipped at the file size because the file has been opened in read-only mode.</li>
|
||||
<li>Disk full. There is insufficient free space on the volume to expand the file size.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Available when <tt>_FS_MINIMIZE <= 2</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Example</h4>
|
||||
<pre>
|
||||
/* Move to offset of 5000 from top of the file */
|
||||
res = f_lseek(file, 5000);
|
||||
|
||||
/* Move to end of the file to append data */
|
||||
res = f_lseek(file, file->fsize);
|
||||
|
||||
/* Forward 3000 bytes */
|
||||
res = f_lseek(file, file->fptr + 3000);
|
||||
|
||||
/* Rewind 2000 bytes (take care on overflow) */
|
||||
res = f_lseek(file, file->fptr - 2000);
|
||||
</pre>
|
||||
<pre>
|
||||
/* Cluster pre-allocation (to prevent buffer overrun on streaming write) */
|
||||
|
||||
res = f_open(file, recfile, FA_CREATE_NEW | FA_WRITE); /* Create a file */
|
||||
|
||||
res = f_lseek(file, PRE_SIZE); /* Pre-allocate clusters */
|
||||
if (res || file->fptr != PRE_SIZE) ... /* Check if the file size has been increased correctly */
|
||||
|
||||
res = f_lseek(file, DATA_START); /* Record data stream without cluster allocation delay */
|
||||
...
|
||||
|
||||
res = f_truncate(file); /* Truncate unused area */
|
||||
res = f_lseek(file, 0); /* Put file header */
|
||||
...
|
||||
|
||||
res = f_close(file);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="truncate.html">f_truncate</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
89
Demo/Common/FileSystem/FatFs-0.7e/doc/en/mkdir.html
Normal file
89
Demo/Common/FileSystem/FatFs-0.7e/doc/en/mkdir.html
Normal file
|
@ -0,0 +1,89 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_mkdir</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_mkdir</h2>
|
||||
<p>The f_mkdir function creates a new directory.</p>
|
||||
<pre>
|
||||
FRESULT f_mkdir (
|
||||
const XCHAR* <em>DirName</em> /* Pointer to the directory name */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameter</h4>
|
||||
<dl class="par">
|
||||
<dt>DirName</dt>
|
||||
<dd>Pointer to the null-terminated string that specifies the <a href="filename.html">directory name</a> to create. </dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Value</h4>
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>The function succeeded.</dd>
|
||||
<dt>FR_NO_PATH</dt>
|
||||
<dd>Could not find the path.</dd>
|
||||
<dt>FR_INVALID_NAME</dt>
|
||||
<dd>The path name is invalid.</dd>
|
||||
<dt>FR_INVALID_DRIVE</dt>
|
||||
<dd>The drive number is invalid.</dd>
|
||||
<dt>FR_DENIED</dt>
|
||||
<dd>The directory cannot be created due to directory table or disk is full.</dd>
|
||||
<dt>FR_EXIST</dt>
|
||||
<dd>A file or directory that has same name is already existing.</dd>
|
||||
<dt>FR_NOT_READY</dt>
|
||||
<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
|
||||
<dt>FR_WRITE_PROTECTED</dt>
|
||||
<dd>The medium is write protected.</dd>
|
||||
<dt>FR_DISK_ERR</dt>
|
||||
<dd>The function failed due to an error in the disk function.</dd>
|
||||
<dt>FR_INT_ERR</dt>
|
||||
<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
|
||||
<dt>FR_NOT_ENABLED</dt>
|
||||
<dd>The logical drive has no work area.</dd>
|
||||
<dt>FR_NO_FILESYSTEM</dt>
|
||||
<dd>There is no valid FAT volume on the disk.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The f_mkdir function creates a new directory.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_FS_MINIMIZE == 0</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Example</h4>
|
||||
<pre>
|
||||
res = f_mkdir("sub1");
|
||||
if (res) die(res);
|
||||
res = f_mkdir("sub1/sub2");
|
||||
if (res) die(res);
|
||||
res = f_mkdir("sub1/sub2/sub3");
|
||||
if (res) die(res);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
78
Demo/Common/FileSystem/FatFs-0.7e/doc/en/mkfs.html
Normal file
78
Demo/Common/FileSystem/FatFs-0.7e/doc/en/mkfs.html
Normal file
|
@ -0,0 +1,78 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_mkfs</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_mkfs</h2>
|
||||
<p>The f_mkfs fucntion creates a file system on the drive.</p>
|
||||
<pre>
|
||||
FRESULT f_mkfs (
|
||||
BYTE <em>Drive</em>, /* Logical drive number */
|
||||
BYTE <em>PartitioningRule</em>, /* Partitioning rule */
|
||||
WORD <em>AllocSize</em> /* Size of the allocation unit */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>Drive</dt>
|
||||
<dd>Logical drive number (0-9) to be formatted.</dd>
|
||||
<dt>PartitioningRule</dt>
|
||||
<dd>When 0 is given, a partition table is created into the first sector on the drive and then the file system is created on the partition. This is called FDISK format and used for harddisk and memory card. When 1 is given, the file system starts from the first sector without partition table. This is often called super floppy disk (SFD) format and used for floppy disk and removable disk.</dd>
|
||||
<dt>AllocSize</dt>
|
||||
<dd>Specifies allocation unit size in number of bytes per cluster. The value must be 0 or power of 2 in range of from 512 to 32768. When 0 is specified, the cluster size is determined depends on the volume size. FAT64 (64KB/cluster on FAT16) cannot be created by this function.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>The function succeeded.</dd>
|
||||
<dt>FR_INVALID_DRIVE</dt>
|
||||
<dd>The drive number is invalid.</dd>
|
||||
<dt>FR_NOT_READY</dt>
|
||||
<dd>The drive cannot work due to any reason.</dd>
|
||||
<dt>FR_WRITE_PROTECTED</dt>
|
||||
<dd>The drive is write protected.</dd>
|
||||
<dt>FR_NOT_ENABLED</dt>
|
||||
<dd>The logical drive has no work area.</dd>
|
||||
<dt>FR_DISK_ERR</dt>
|
||||
<dd>The function failed due to an error in the disk function.</dd>
|
||||
<dt>FR_MKFS_ABORTED</dt>
|
||||
<dd>The function aborted before start in format due to a reason as follows.
|
||||
<ul>
|
||||
<li>The disk size is too small.</li>
|
||||
<li>Invalid parameter was given to any parameter.</li>
|
||||
<li>Not allowable cluster size for this drive. This can occure when number of clusters becomes around 0xFF7 and 0xFFF7.</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The f_mkfs function creates a FAT file system on the drive. There are two partitioning rules, FDISK and SFD, for removable media. It can be selected with an argument. The FDISK format is recommended for the most case. This function currently <em>does not support multiple partition</em>, so that existing partitions on the physical dirve will be deleted and re-created a new partition occupies entire disk space.</p>
|
||||
<p>The FAT sub-type, FAT12/FAT16/FAT32, is determined by number of clusters on the drive 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. The cluster size affects performance of the file system and large cluster increases the performance.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Available when <tt>_FS_READOLNY == 0</tt> and <tt>_USE_MKFS == 1</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
65
Demo/Common/FileSystem/FatFs-0.7e/doc/en/mount.html
Normal file
65
Demo/Common/FileSystem/FatFs-0.7e/doc/en/mount.html
Normal file
|
@ -0,0 +1,65 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_mount</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_mount</h2>
|
||||
<p>The f_mount fucntion registers/unregisters a work area to the FatFs module.</p>
|
||||
<pre>
|
||||
FRESULT f_mount (
|
||||
BYTE <em>Drive</em>, /* Logical drive number */
|
||||
FATFS* <em>FileSystemObject</em> /* Pointer to the work area */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>Drive</dt>
|
||||
<dd>Logical drive number (0-9) to register/unregister the work area.</dd>
|
||||
<dt>FileSystemObject</dt>
|
||||
<dd>Pointer to the work area (file system object) to be registered.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>The function succeeded.</dd>
|
||||
<dt>FR_INVALID_DRIVE</dt>
|
||||
<dd>The drive number is invalid.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The f_mount function registers/unregisters a work area to the FatFs module. The work area must be given to the each volume with this function prior to use any other file function. To unregister a work area, specify a NULL to the <em>FileSystemObject</em>, and then the work area can be discarded.</p>
|
||||
<p>This function only initializes the given work area and registers its address to the internal table, any access to the disk I/O layer does not occure. The volume mount process is performed on first file access after f_mount function or media change.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Always available.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="sfatfs.html">FATFS</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
148
Demo/Common/FileSystem/FatFs-0.7e/doc/en/open.html
Normal file
148
Demo/Common/FileSystem/FatFs-0.7e/doc/en/open.html
Normal file
|
@ -0,0 +1,148 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_open</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_open</h2>
|
||||
<p>The f_open function creates a <em>file object</em> to be used to access the file.</p>
|
||||
<pre>
|
||||
FRESULT f_open (
|
||||
FIL* <em>FileObject</em>, /* Pointer to the blank file object structure */
|
||||
const XCHAR* <em>FileName</em>, /* Pointer to the file neme */
|
||||
BYTE <em>ModeFlags</em> /* Mode flags */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>FileObject</dt>
|
||||
<dd>Pointer to the file object structure to be created.</dd>
|
||||
<dt>FileName</dt>
|
||||
<dd>Pointer to a null-terminated string that specifies the <a href="filename.html">file name</a> to create or open.</dd>
|
||||
<dt>ModeFlags</dt>
|
||||
<dd>Specifies the type of access and open method for the file. It is specified by a combination of following flags.<br>
|
||||
<table class="lst">
|
||||
<tr><th>Value</th><th>Description</th></tr>
|
||||
<tr><td>FA_READ</td><td>Specifies read access to the object. Data can be read from the file.<br>Combine with FA_WRITE for read-write access.</td></tr>
|
||||
<tr><td>FA_WRITE</td><td>Specifies write access to the object. Data can be written to the file.<br>Combine with FA_READ for read-write access.</td></tr>
|
||||
<tr><td>FA_OPEN_EXISTING</td><td>Opens the file. The function fails if the file is not existing. (Default)</td></tr>
|
||||
<tr><td>FA_OPEN_ALWAYS</td><td>Opens the file, if it is existing. If not, a new file is created.</td></tr>
|
||||
<tr><td>FA_CREATE_NEW</td><td>Creates a new file. The function fails if the file is already existing.</td></tr>
|
||||
<tr><td>FA_CREATE_ALWAYS</td><td>Creates a new file. If the file is existing, it is truncated and overwritten.</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>The function succeeded and the file object is valid.</dd>
|
||||
<dt>FR_NO_FILE</dt>
|
||||
<dd>Could not find the file.</dd>
|
||||
<dt>FR_NO_PATH</dt>
|
||||
<dd>Could not find the path.</dd>
|
||||
<dt>FR_INVALID_NAME</dt>
|
||||
<dd>The file name is invalid.</dd>
|
||||
<dt>FR_INVALID_DRIVE</dt>
|
||||
<dd>The drive number is invalid.</dd>
|
||||
<dt>FR_EXIST</dt>
|
||||
<dd>The file is already existing.</dd>
|
||||
<dt>FR_DENIED</dt>
|
||||
<dd>The required access was denied due to one of the following reasons:
|
||||
<ul><li>Write mode open of a read-only file.</li>
|
||||
<li>File cannot be created due to a read-only file or same name directory is existing.</li>
|
||||
<li>File cannot be created due to the directory table or disk is full.</li></ul></dd>
|
||||
<dt>FR_NOT_READY</dt>
|
||||
<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
|
||||
<dt>FR_WRITE_PROTECTED</dt>
|
||||
<dd>Write mode open or creation under the medium is write protected.</dd>
|
||||
<dt>FR_DISK_ERR</dt>
|
||||
<dd>The function failed due to an error in the disk function.</dd>
|
||||
<dt>FR_INT_ERR</dt>
|
||||
<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
|
||||
<dt>FR_NOT_ENABLED</dt>
|
||||
<dd>The logical drive has no work area.</dd>
|
||||
<dt>FR_NO_FILESYSTEM</dt>
|
||||
<dd>There is no valid FAT volume on the disk.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>A file object is created when the function succeeded. The file object is used for subsequent read/write functions to refer to the file. When close an open file object, use <a href="close.html">f_close</a> function. If the modified file is not closed, the file may be collapsed.</p>
|
||||
<p>Before using any file function, a work area (file system object) must be given to the logical drive with <a href="mount.html">f_mount</a> function. All file functions can work after this procedure.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Always available. The mode flags, <tt>FA_WRITE, FA_CREATE_ALWAYS, FA_CREATE_NEW, FA_OPEN_ALWAYS</tt>, are not available when <tt>_FS_READONLY == 1</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Example (File Copy)</h4>
|
||||
<pre>
|
||||
void main (void)
|
||||
{
|
||||
FATFS fs[2]; /* Work area (file system object) for logical drives */
|
||||
FIL fsrc, fdst; /* file objects */
|
||||
BYTE buffer[4096]; /* file copy buffer */
|
||||
FRESULT res; /* FatFs function common result code */
|
||||
UINT br, bw; /* File R/W count */
|
||||
|
||||
|
||||
/* Register work area for logical drives */
|
||||
f_mount(0, &fs[0]);
|
||||
f_mount(1, &fs[1]);
|
||||
|
||||
/* Open source file on the drive 1 */
|
||||
res = f_open(&fsrc, "1:srcfile.dat", FA_OPEN_EXISTING | FA_READ);
|
||||
if (res) die(res);
|
||||
|
||||
/* Create destination file on the drive 0 */
|
||||
res = f_open(&fdst, "0:dstfile.dat", FA_CREATE_ALWAYS | FA_WRITE);
|
||||
if (res) die(res);
|
||||
|
||||
/* Copy source to destination */
|
||||
for (;;) {
|
||||
res = f_read(&fsrc, buffer, sizeof(buffer), &br);
|
||||
if (res || br == 0) break; /* error or eof */
|
||||
res = f_write(&fdst, buffer, br, &bw);
|
||||
if (res || bw < br) break; /* error or disk full */
|
||||
}
|
||||
|
||||
/* Close open files */
|
||||
f_close(&fsrc);
|
||||
f_close(&fdst);
|
||||
|
||||
/* Unregister work area prior to discard it */
|
||||
f_mount(0, NULL);
|
||||
f_mount(1, NULL);
|
||||
}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="read.html">f_read</a>, <a href="write.html">f_write</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a>, <a href="sfatfs.html">FATFS</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
79
Demo/Common/FileSystem/FatFs-0.7e/doc/en/opendir.html
Normal file
79
Demo/Common/FileSystem/FatFs-0.7e/doc/en/opendir.html
Normal file
|
@ -0,0 +1,79 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_opendir</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_opendir</h2>
|
||||
<p>The f_opendir function opens a directory.</p>
|
||||
<pre>
|
||||
FRESULT f_opendir (
|
||||
DIR* <em>DirObject</em>, /* Pointer to the blank directory object structure */
|
||||
const XCHAR* <em>DirName</em> /* Pointer to the directory name */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>DirObject</dt>
|
||||
<dd>Pointer to the blank directory object to be created.</dd>
|
||||
<dt>DirName</dt>
|
||||
<dd>Pinter to the null-terminated string that specifies the <a href="filename.html">directory name</a> to be opened.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>The function succeeded and the directory object is created. It is used for subsequent calls to read the directory entries.</dd>
|
||||
<dt>FR_NO_PATH</dt>
|
||||
<dd>Could not find the path.</dd>
|
||||
<dt>FR_INVALID_NAME</dt>
|
||||
<dd>The path name is invalid.</dd>
|
||||
<dt>FR_INVALID_DRIVE</dt>
|
||||
<dd>The drive number is invalid.</dd>
|
||||
<dt>FR_NOT_READY</dt>
|
||||
<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
|
||||
<dt>FR_DISK_ERR</dt>
|
||||
<dd>The function failed due to an error in the disk function.</dd>
|
||||
<dt>FR_INT_ERR</dt>
|
||||
<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
|
||||
<dt>FR_NOT_ENABLED</dt>
|
||||
<dd>The logical drive has no work area.</dd>
|
||||
<dt>FR_NO_FILESYSTEM</dt>
|
||||
<dd>There is no valid FAT volume on the disk.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The f_opendir function opens an exsisting directory and creates the directory object for subsequent calls. The directory object structure can be discarded at any time without any procedure.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Available when <tt>_FS_MINIMIZE <= 1</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="readdir.html">f_readdir</a>, <a href="sdir.html">DIR</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
82
Demo/Common/FileSystem/FatFs-0.7e/doc/en/printf.html
Normal file
82
Demo/Common/FileSystem/FatFs-0.7e/doc/en/printf.html
Normal file
|
@ -0,0 +1,82 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_printf</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_printf</h2>
|
||||
<p>The f_printf function writes formatted string to the file.</p>
|
||||
<pre>
|
||||
int f_printf (
|
||||
FIL* <em>FileObject</em>, /* File object */
|
||||
const char* <em>Foramt</em>, /* Format stirng */
|
||||
...
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>FileObject</dt>
|
||||
<dd>Pointer to the open file object structure.</dd>
|
||||
<dt>Format</dt>
|
||||
<dd>Pointer to the null-terminated format string.</dd>
|
||||
<dt>...</dt>
|
||||
<dd>Optional arguments.</dd>
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<p>When the function succeeded, number of characters written is returned. When the function failed due to disk full or any error, an <tt>EOF</tt> will be returned.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The f_printf() is a wrapper function of <a href="putc.html">f_putc()</a> and <a href="puts.html">f_puts()</a>. The format control directive is a sub-set of standard library shown as follos:</p>
|
||||
<ul>
|
||||
<li>Type: <tt>c s d u X</tt></li>
|
||||
<li>Size: <tt>l</tt></li>
|
||||
<li>Flag: <tt>0</tt></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_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>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Example</h4>
|
||||
<pre>
|
||||
f_printf(&fil, "%6d", -200); /* " -200" */
|
||||
f_printf(&fil, "%02u", 5); /* "05" */
|
||||
f_printf(&fil, "%ld", 12345678L); /* "12345678" */
|
||||
f_printf(&fil, "%08lX", 1194684UL); /* "00123ABC" */
|
||||
f_printf(&fil, "%s", "String"); /* "String" */
|
||||
f_printf(&fil, "%c", 'a'); /* "a" */
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="putc.html">f_putc</a>, <a href="puts.html">f_puts</a>, <a href="gets.html">f_gets</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
60
Demo/Common/FileSystem/FatFs-0.7e/doc/en/putc.html
Normal file
60
Demo/Common/FileSystem/FatFs-0.7e/doc/en/putc.html
Normal file
|
@ -0,0 +1,60 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_putc</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_putc</h2>
|
||||
<p>The f_putc funciton puts a character to the file.</p>
|
||||
<pre>
|
||||
int f_putc (
|
||||
int <em>Chr</em>, /* A character to put */
|
||||
FIL* <em>FileObject</em> /* File object */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>Chr</dt>
|
||||
<dd>A character to be put.</dd>
|
||||
<dt>FileObject</dt>
|
||||
<dd>Pointer to the open file object structuer.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<p>When the character was written successfuly, the function returns the character. When the function failed due to disk full or any error, an <tt>EOF</tt> will be returned.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The f_putc() is a wrapper function of <a href="write.html">f_write()</a>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_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>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="puts.html">f_puts</a>, <a href="printf.html">f_printf</a>, <a href="gets.html">f_gets</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
60
Demo/Common/FileSystem/FatFs-0.7e/doc/en/puts.html
Normal file
60
Demo/Common/FileSystem/FatFs-0.7e/doc/en/puts.html
Normal file
|
@ -0,0 +1,60 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_puts</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_puts</h2>
|
||||
<p>The f_puts function writes a string to the file.</p>
|
||||
<pre>
|
||||
int f_puts (
|
||||
const char* <em>Str</em>, /* String */
|
||||
FIL* <em>FileObject</em> /* File object */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>Str</dt>
|
||||
<dd>Pointer to the null terminated string to be written. The null character will not be written.</dd>
|
||||
<dt>FileObject</dt>
|
||||
<dd>Pointer to the open file object structure.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Value</h4>
|
||||
<p>When the function succeeded, number of characters written that is not minus value is returned. When the function failed due to disk full or any error, an <tt>EOF</tt> will be returned.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The f_puts() is a wrapper function of <a href="putc.html">f_putc()</a>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_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>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="putc.html">f_putc</a>, <a href="printf.html">f_printf</a>, <a href="gets.html">f_gets</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
79
Demo/Common/FileSystem/FatFs-0.7e/doc/en/read.html
Normal file
79
Demo/Common/FileSystem/FatFs-0.7e/doc/en/read.html
Normal file
|
@ -0,0 +1,79 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_read</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_read</h2>
|
||||
<p>The f_read function reads data from a file.</p>
|
||||
<pre>
|
||||
FRESULT f_read (
|
||||
FIL* <em>FileObject</em>, /* Pointer to the file object structure */
|
||||
void* <em>Buffer</em>, /* Pointer to the buffer to store read data */
|
||||
UINT <em>ByteToRead</em>, /* Number of bytes to read */
|
||||
UINT* <em>ByteRead</em> /* Pointer to the variable to return number of bytes read */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>FileObject</dt>
|
||||
<dd>Pointer to the open file object.</dd>
|
||||
<dt>Buffer</dt>
|
||||
<dd>Pointer to the buffer to store read data</dd>
|
||||
<dt>ByteToRead</dt>
|
||||
<dd>Number of bytes to read in range of UINT.</dd>
|
||||
<dt>ByteRead</dt>
|
||||
<dd>Pointer to the UINT variable to return number of bytes read. The value is always valid after the function call regardless of the result.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>The function succeeded.</dd>
|
||||
<dt>FR_DENIED</dt>
|
||||
<dd>The function denied due to the file has been opened in non-read mode.</dd>
|
||||
<dt>FR_DISK_ERR</dt>
|
||||
<dd>The function failed due to an error in the disk function.</dd>
|
||||
<dt>FR_INT_ERR</dt>
|
||||
<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
|
||||
<dt>FR_NOT_READY</dt>
|
||||
<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
|
||||
<dt>FR_INVALID_OBJECT</dt>
|
||||
<dd>The file object is invalid.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The file pointer of the file object increases in number of bytes read. After the function succeeded, <tt>*ByteRead</tt> should be checked to detect the end of file. In case of <tt>*ByteRead < ByteToRead</tt>, it means the R/W pointer reached end of the file during read operation.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Always available.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="gets.html">fgets</a>, <a href="write.html">f_write</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
119
Demo/Common/FileSystem/FatFs-0.7e/doc/en/readdir.html
Normal file
119
Demo/Common/FileSystem/FatFs-0.7e/doc/en/readdir.html
Normal file
|
@ -0,0 +1,119 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_readdir</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_readdir</h2>
|
||||
<p>The f_readdir function reads directory entries.</p>
|
||||
<pre>
|
||||
FRESULT f_readdir (
|
||||
DIR* <em>DirObject</em>, /* Pointer to the open directory object */
|
||||
FILINFO* <em>FileInfo</em> /* Pointer to the file information structure */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>DirObject</dt>
|
||||
<dd>Pointer to the open directory object.</dd>
|
||||
<dt>FileInfo</dt>
|
||||
<dd>Pointer to the file information structure to store the read item.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>The function succeeded.</dd>
|
||||
<dt>FR_NOT_READY</dt>
|
||||
<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
|
||||
<dt>FR_DISK_ERR</dt>
|
||||
<dd>The function failed due to an error in the disk function.</dd>
|
||||
<dt>FR_INT_ERR</dt>
|
||||
<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
|
||||
<dt>FR_INVALID_OBJECT</dt>
|
||||
<dd>The directory object is invalid.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The f_readdir function reads directory entries in sequence. All items in the directory can be read by calling f_readdir function repeatedly. When all directory entries have been read and no item to read, the function returns a null string into <tt>f_name[]</tt> member without any error. When a null pointer is given to the <tt>FileInfo</tt>, the read index of the directory object will be rewinded.</p>
|
||||
<p>When LFN feature is enabled, <tt>lfname</tt> and <tt>lfsize</tt> in the file information structure must be initialized with valid value prior to use the f_readdir function. The <tt>lfname</tt> is a pointer to the string buffer to return the long file name. The <tt>lfsize</tt> is the size of the string buffer in unit of character. If either the size of read buffer or LFN working buffer is insufficient for the LFN or the object has no LFN, a null string will be returned to the LFN read buffer. If the LFN contains any charactrer that cannot be converted to OEM code, a null string will be returned but this is not the case on Unicode API configuration. When <tt>lfname</tt> is a NULL, nothing of the LFN is returned. When the object has no LFN, any small capitals can be contained in the SFN.</p>
|
||||
<p>When relative path feature is enabled <tt>(_FS_RPATH == 1)</tt>, "." and ".." entries are not filtered out and it will appear in the read entries.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Available when <tt>_FS_MINIMIZE <= 1</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Sample Code</h4>
|
||||
<pre>
|
||||
FRESULT scan_files (char* path)
|
||||
{
|
||||
FRESULT res;
|
||||
FILINFO fno;
|
||||
DIR dir;
|
||||
int i;
|
||||
char *fn;
|
||||
#if _USE_LFN
|
||||
static char lfn[_MAX_LFN * (_DF1S ? 2 : 1) + 1];
|
||||
fno.lfname = lfn;
|
||||
fno.lfsize = sizeof(lfn);
|
||||
#endif
|
||||
|
||||
|
||||
res = f_opendir(&dir, path);
|
||||
if (res == FR_OK) {
|
||||
i = strlen(path);
|
||||
for (;;) {
|
||||
res = f_readdir(&dir, &fno);
|
||||
if (res != FR_OK || fno.fname[0] == 0) break;
|
||||
if (fno.fname[0] == '.') continue;
|
||||
#if _USE_LFN
|
||||
fn = *fno.lfname ? fno.lfname : fno.fname;
|
||||
#else
|
||||
fn = fno.fname;
|
||||
#endif
|
||||
if (fno.fattrib & AM_DIR) {
|
||||
sprintf(&path[i], "/%s", fn);
|
||||
res = scan_files(path);
|
||||
if (res != FR_OK) break;
|
||||
path[i] = 0;
|
||||
} else {
|
||||
printf("%s/%s\n", path, fn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="opendir.html">f_opendir</a>, <a href="stat.html">f_stat</a>, <a href="sfileinfo.html">FILINFO</a>, <a href="sdir.html">DIR</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
93
Demo/Common/FileSystem/FatFs-0.7e/doc/en/rename.html
Normal file
93
Demo/Common/FileSystem/FatFs-0.7e/doc/en/rename.html
Normal file
|
@ -0,0 +1,93 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_rename</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_rename</h2>
|
||||
<p>Renames an object.</p>
|
||||
<pre>
|
||||
FRESULT f_rename (
|
||||
const XCHAR* <em>OldName</em>, /* Pointer to old object name */
|
||||
const XCHAR* <em>NewName</em> /* Pointer to new object name */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>OldName</dt>
|
||||
<dd>Pointer to a null-terminated string specifies the old <a href="filename.html">object name</a> to be renamed.</dd>
|
||||
<dt>NewName</dt>
|
||||
<dd>Pointer to a null-terminated string specifies the new object name without drive number.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>The function succeeded.</dd>
|
||||
<dt>FR_NO_FILE</dt>
|
||||
<dd>Could not find the old name.</dd>
|
||||
<dt>FR_NO_PATH</dt>
|
||||
<dd>Could not find the path.</dd>
|
||||
<dt>FR_INVALID_NAME</dt>
|
||||
<dd>The file name is invalid.</dd>
|
||||
<dt>FR_INVALID_DRIVE</dt>
|
||||
<dd>The drive number is invalid.</dd>
|
||||
<dt>FR_NOT_READY</dt>
|
||||
<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
|
||||
<dt>FR_EXIST</dt>
|
||||
<dd>The new name is colliding with an existing name.</dd>
|
||||
<dt>FR_DENIED</dt>
|
||||
<dd>The new name could not be created due to any reason.</dd>
|
||||
<dt>FR_WRITE_PROTECTED</dt>
|
||||
<dd>The medium is write protected.</dd>
|
||||
<dt>FR_DISK_ERR</dt>
|
||||
<dd>The function failed due to an error in the disk function.</dd>
|
||||
<dt>FR_INT_ERR</dt>
|
||||
<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
|
||||
<dt>FR_NOT_ENABLED</dt>
|
||||
<dd>The logical drive has no work area.</dd>
|
||||
<dt>FR_NO_FILESYSTEM</dt>
|
||||
<dd>There is no valid FAT volume on the disk.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>Renames an object and can also move it to other directory. The logical drive number is determined by old name, new name must not contain a logical drive number. <em>Do not rename open objects</em>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_FS_MINIMIZE == 0</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Example</h4>
|
||||
<pre>
|
||||
/* Rename an object */
|
||||
f_rename("oldname.txt", "newname.txt");
|
||||
|
||||
/* Rename and move an object to other directory */
|
||||
f_rename("oldname.txt", "dir1/newname.txt");
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
36
Demo/Common/FileSystem/FatFs-0.7e/doc/en/sdir.html
Normal file
36
Demo/Common/FileSystem/FatFs-0.7e/doc/en/sdir.html
Normal file
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - DIR</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>DIR</h2>
|
||||
<p>The <tt>DIR</tt> structure is used for the work area to read a directory by f_oepndir, f_readdir function. There is no member that can be changed by application.</p>
|
||||
<pre>
|
||||
typedef struct _DIR_ {
|
||||
FATFS* fs; /* Pointer to the owner file system object */
|
||||
WORD id; /* Owner file system mount ID */
|
||||
WORD index; /* Current read/write index number */
|
||||
DWORD sclust; /* Table start cluster (0:Static table) */
|
||||
DWORD clust; /* Current cluster */
|
||||
DWORD sect; /* Current sector */
|
||||
BYTE* dir; /* Pointer to the current SFN entry in the win[] */
|
||||
BYTE* fn; /* Pointer to the SFN (in/out) {file[8],ext[3],status[1]} */
|
||||
#if _USE_LFN
|
||||
WCHAR* lfn; /* Pointer to the LFN working buffer */
|
||||
WORD lfn_idx; /* Last matched LFN index (0xFFFF:No LFN) */
|
||||
#endif
|
||||
} DIR;
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
53
Demo/Common/FileSystem/FatFs-0.7e/doc/en/sfatfs.html
Normal file
53
Demo/Common/FileSystem/FatFs-0.7e/doc/en/sfatfs.html
Normal file
|
@ -0,0 +1,53 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - FATFS</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>FATFS</h2>
|
||||
<p>The <tt>FATFS</tt> structure holds dynamic work area of individual logical drives. It is given by application program and registerd/unregisterd to the FatFs module with f_mount function. Following members are in standard configuration. There is no member that can be changed from the application program.</p>
|
||||
<pre>
|
||||
typedef struct _FATFS_ {
|
||||
BYTE fs_type; /* FAT sub type */
|
||||
BYTE drive; /* Physical drive number */
|
||||
BYTE csize; /* Number of sectors per cluster */
|
||||
BYTE n_fats; /* Number of FAT copies */
|
||||
BYTE wflag; /* win[] dirty flag (1:must be written back) */
|
||||
BYTE fsi_flag; /* fsinfo dirty flag (1:must be written back) */
|
||||
WORD id; /* File system mount ID */
|
||||
WORD n_rootdir; /* Number of root directory entries (0 on FAT32) */
|
||||
#if _FS_REENTRANT
|
||||
_SYNC_t sobj; /* Identifier of sync object */
|
||||
#endif
|
||||
#if _MAX_SS != 512
|
||||
WORD s_size; /* Sector size */
|
||||
#endif
|
||||
#if !_FS_READONLY
|
||||
DWORD last_clust; /* Last allocated cluster */
|
||||
DWORD free_clust; /* Number of free clusters */
|
||||
DWORD fsi_sector; /* fsinfo sector */
|
||||
#endif
|
||||
#if _FS_RPATH
|
||||
DWORD cdir; /* Current directory (0:root)*/
|
||||
#endif
|
||||
DWORD sects_fat; /* Sectors per fat */
|
||||
DWORD max_clust; /* Maximum cluster# + 1. Number of clusters is max_clust - 2 */
|
||||
DWORD fatbase; /* FAT start sector */
|
||||
DWORD dirbase; /* Root directory start sector (Cluster# on FAT32) */
|
||||
DWORD database; /* Data start sector */
|
||||
DWORD winsect; /* Current sector appearing in the win[] */
|
||||
BYTE win[_MAX_SS];/* Disk access window for Directory/FAT */
|
||||
} FATFS;
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
42
Demo/Common/FileSystem/FatFs-0.7e/doc/en/sfile.html
Normal file
42
Demo/Common/FileSystem/FatFs-0.7e/doc/en/sfile.html
Normal file
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - FIL</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>FIL</h2>
|
||||
<p>The FIL structure (file object) holds state of an open file. It is initialzed by f_open function and discarded by f_close function. There is no member that can be changed by the application program.</p>
|
||||
|
||||
<pre>
|
||||
typedef struct _FIL_ {
|
||||
FATFS* fs; /* Pointer to the owner file system object */
|
||||
WORD id; /* Owner file system mount ID */
|
||||
BYTE flag; /* File status flags */
|
||||
BYTE csect; /* Sector address in the cluster */
|
||||
DWORD fptr; /* File R/W pointer */
|
||||
DWORD fsize; /* File size */
|
||||
DWORD org_clust; /* File start cluster */
|
||||
DWORD curr_clust; /* Current cluster */
|
||||
DWORD dsect; /* Current data sector */
|
||||
#if !_FS_READONLY
|
||||
DWORD dir_sect; /* Sector containing the directory entry */
|
||||
BYTE* dir_ptr; /* Ponter to the directory entry in the window */
|
||||
#endif
|
||||
#if !_FS_TINY
|
||||
BYTE buf[_MAX_SS];/* File R/W buffer */
|
||||
#endif
|
||||
} FIL;
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
69
Demo/Common/FileSystem/FatFs-0.7e/doc/en/sfileinfo.html
Normal file
69
Demo/Common/FileSystem/FatFs-0.7e/doc/en/sfileinfo.html
Normal file
|
@ -0,0 +1,69 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - FILINFO</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>FILINFO</h2>
|
||||
<p>The <tt>FILINFO</tt> structure holds a file information returned by f_stat and f_readdir function.</p>
|
||||
<pre>
|
||||
typedef struct _FILINFO_ {
|
||||
DWORD fsize; /* File size */
|
||||
WORD fdate; /* Last modified date */
|
||||
WORD ftime; /* Last modified time */
|
||||
BYTE fattrib; /* Attribute */
|
||||
char fname[13]; /* Short file name (8.3 format) */
|
||||
#if _USE_LFN
|
||||
XCHAR* lfname; /* Pointer to the LFN buffer */
|
||||
int lfsize; /* Size of LFN buffer [characters] */
|
||||
#endif
|
||||
} FILINFO;
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h4>Members</h4>
|
||||
<dl>
|
||||
<dt>fsize</dt>
|
||||
<dd>Indicates size of the file in unit of byte. This is always zero when it is a directory.</dd>
|
||||
<dt>fdate</dt>
|
||||
<dd>Indicates the date that the file was modified or the directory was created.<br>
|
||||
<dl>
|
||||
<dt>bit15:9</dt>
|
||||
<dd>Year origin from 1980 (0..127)</dd>
|
||||
<dt>bit8:5</dt>
|
||||
<dd>Month (1..12)</dd>
|
||||
<dt>bit4:0</dt>
|
||||
<dd>Day (1..31)</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dt>ftime</dt>
|
||||
<dd>Indicates the time that the file was modified or the directory was created.<br>
|
||||
<dl>
|
||||
<dt>bit15:11</dt>
|
||||
<dd>Hour (0..23)</dd>
|
||||
<dt>bit10:5</dt>
|
||||
<dd>Minute (0..59)</dd>
|
||||
<dt>bit4:0</dt>
|
||||
<dd>Second / 2 (0..29)</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dt>fattrib</dt>
|
||||
<dd>Indicates the file/directory attribute in combination of <tt>AM_DIR</tt>, <tt>AM_RDO</tt>, <tt>AM_HID</tt>, <tt>AM_SYS</tt> and <tt>AM_ARC</tt>.</dd>
|
||||
<dt>fname[]</dt>
|
||||
<dd>Indicates the file/directory name in 8.3 format null-terminated string. It is always returnd with upper case on non-LFN configuration but it can be returned with lower case on LFN configuration.</dd>
|
||||
<dt>lfname</dt>
|
||||
<dd>Pointer to the LFN buffer to store the read LFN. This member must be initialized by application prior to use this structure. Not available on non-LFN configuration.</dd>
|
||||
<dt>lfsize</dt>
|
||||
<dd>Size of the LFN buffer in unit of chars. This member must be initialized by application prior to use this structure. Not available on non-LFN configuration.</dd>
|
||||
</dl>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
75
Demo/Common/FileSystem/FatFs-0.7e/doc/en/stat.html
Normal file
75
Demo/Common/FileSystem/FatFs-0.7e/doc/en/stat.html
Normal file
|
@ -0,0 +1,75 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_stat</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_stat</h2>
|
||||
<p>The f_stat gets the file status.</p>
|
||||
<pre>
|
||||
FRESULT f_stat (
|
||||
const XCHAR* <em>FileName</em>, /* Pointer to the file or directory name */
|
||||
FILINFO* <em>FileInfo</em> /* Pointer to the FILINFO structure */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>FileName</dt>
|
||||
<dd>Pointer to the null-terminated string that specifies the <a href="filename.html">file or directory</a> to get its information.</dd>
|
||||
<dt>FileInfo</dt>
|
||||
<dd>Pointer to the blank <tt>FILINFO</tt> structure to store the information.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>The function succeeded.</dd>
|
||||
<dt>FR_NO_FILE</dt>
|
||||
<dd>Could not find the file or directory.</dd>
|
||||
<dt>FR_NO_PATH</dt>
|
||||
<dd>Could not find the path.</dd>
|
||||
<dt>FR_INVALID_NAME</dt>
|
||||
<dd>The file name is invalid.</dd>
|
||||
<dt>FR_INVALID_DRIVE</dt>
|
||||
<dd>The drive number is invalid.</dd>
|
||||
<dt>FR_NOT_READY</dt>
|
||||
<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
|
||||
<dt>FR_DISK_ERR</dt>
|
||||
<dd>The function failed due to an error in the disk function.</dd>
|
||||
<dt>FR_INT_ERR</dt>
|
||||
<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
|
||||
<dt>FR_NOT_ENABLED</dt>
|
||||
<dd>The logical drive has no work area.</dd>
|
||||
<dt>FR_NO_FILESYSTEM</dt>
|
||||
<dd>There is no valid FAT volume on the disk.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The f_stat gets the information of a file or directory. For details of the infomation, refer to the <tt>FILINFO</tt> structure and <a href="readdir.html">f_readdir</a> function. This function is not supported in minimization level of >= 1.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>References</h4>
|
||||
<p><tt><a href="opendir.html">f_opendir</a>, <a href="readdir.html">f_readdir</a>, <a href="sfileinfo.html">FILINFO</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
68
Demo/Common/FileSystem/FatFs-0.7e/doc/en/sync.html
Normal file
68
Demo/Common/FileSystem/FatFs-0.7e/doc/en/sync.html
Normal file
|
@ -0,0 +1,68 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_sync</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_sync</h2>
|
||||
<p>The f_sync function flushes the cached information of a writing file.</p>
|
||||
<pre>
|
||||
FRESULT f_sync (
|
||||
FIL* <em>FileObject</em> /* Pointer to the file object */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameter</h4>
|
||||
<dl class="par">
|
||||
<dt>FileObject</dt>
|
||||
<dd>Pointer to the open file object to be flushed.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>The function succeeded.</dd>
|
||||
<dt>FR_DISK_ERR</dt>
|
||||
<dd>The function failed due to an error in the disk function.</dd>
|
||||
<dt>FR_INT_ERR</dt>
|
||||
<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
|
||||
<dt>FR_NOT_READY</dt>
|
||||
<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
|
||||
<dt>FR_INVALID_OBJECT</dt>
|
||||
<dd>The file object is invalid.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The f_sync function performs the same process as f_close function but the file is left opened and can continue read/write/seek operations to the file. This is suitable for the applications that open files for a long time in write mode, such as data logger. Performing f_sync of periodic or immediataly after f_write can minimize the risk of data loss due to a sudden blackout or an unintentional disk removal. However f_sync immediataly before f_close has no advantage because f_close performs f_sync in it. In other words, the differnce between those functions is that the file object is invalidated or not. </p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Available when <tt>_FS_READONLY == 0</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="close.html">f_close</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
71
Demo/Common/FileSystem/FatFs-0.7e/doc/en/truncate.html
Normal file
71
Demo/Common/FileSystem/FatFs-0.7e/doc/en/truncate.html
Normal file
|
@ -0,0 +1,71 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_truncate</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_truncate</h2>
|
||||
<p>The f_truncate function truncates the file size.</p>
|
||||
<pre>
|
||||
FRESULT f_truncate (
|
||||
FIL* <em>FileObject</em> /* Pointer to the file object */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameter</h4>
|
||||
<dl class="par">
|
||||
<dt>FileObject</dt>
|
||||
<dd>Pointer to the open file object to be truncated.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>The function succeeded.</dd>
|
||||
<dt>FR_DENIED</dt>
|
||||
<dd>The file has been opened in read-only mode.</dd>
|
||||
<dt>FR_DISK_ERR</dt>
|
||||
<dd>The function failed due to an error in the disk function.</dd>
|
||||
<dt>FR_INT_ERR</dt>
|
||||
<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
|
||||
<dt>FR_NOT_READY</dt>
|
||||
<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
|
||||
<dt>FR_INVALID_OBJECT</dt>
|
||||
<dd>The file object is invalid.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The f_truncate function truncates the file size to the current file R/W point. When the file R/W pointer is already pointing end of the file, this function has no effect.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_FS_MINIMIZE == 0</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="lseek.html">f_lseek</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
78
Demo/Common/FileSystem/FatFs-0.7e/doc/en/unlink.html
Normal file
78
Demo/Common/FileSystem/FatFs-0.7e/doc/en/unlink.html
Normal file
|
@ -0,0 +1,78 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_unlink</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_unlink</h2>
|
||||
<p>The f_unlink removes an object.</p>
|
||||
<pre>
|
||||
FRESULT f_unlink (
|
||||
const XCHAR* <em>FileName</em> /* Pointer to the object name */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameter</h4>
|
||||
<dl class="par">
|
||||
<dt>FileName</dt>
|
||||
<dd>Pointer to the null-terminated string that specifies an <a href="filename.html">object</a> to be removed.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>The function succeeded.</dd>
|
||||
<dt>FR_NO_FILE</dt>
|
||||
<dd>Could not find the file or directory.</dd>
|
||||
<dt>FR_NO_PATH</dt>
|
||||
<dd>Could not find the path.</dd>
|
||||
<dt>FR_INVALID_NAME</dt>
|
||||
<dd>The path name is invalid.</dd>
|
||||
<dt>FR_INVALID_DRIVE</dt>
|
||||
<dd>The drive number is invalid.</dd>
|
||||
<dt>FR_DENIED</dt>
|
||||
<dd>The function was denied due to either of following reasons:
|
||||
<ul><li>The object has read-only attribute</li><li>The directory is not empty.</li></ul></dd>
|
||||
<dt>FR_NOT_READY</dt>
|
||||
<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
|
||||
<dt>FR_WRITE_PROTECTED</dt>
|
||||
<dd>The medium is write protected.</dd>
|
||||
<dt>FR_DISK_ERR</dt>
|
||||
<dd>The function failed due to an error in the disk function.</dd>
|
||||
<dt>FR_INT_ERR</dt>
|
||||
<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
|
||||
<dt>FR_NOT_ENABLED</dt>
|
||||
<dd>The logical drive has no work area.</dd>
|
||||
<dt>FR_NO_FILESYSTEM</dt>
|
||||
<dd>There is no valid FAT volume on the disk.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The f_unlink function removes an object. <em>Do not remove open objects and current directory</em>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_FS_MINIMIZE == 0</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
83
Demo/Common/FileSystem/FatFs-0.7e/doc/en/utime.html
Normal file
83
Demo/Common/FileSystem/FatFs-0.7e/doc/en/utime.html
Normal file
|
@ -0,0 +1,83 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_utime</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_utime</h2>
|
||||
<p>The f_utime function changes the timestamp of a file or directory.</p>
|
||||
<pre>
|
||||
FRESULT f_utime (
|
||||
const XCHAR* <em>FileName</em>, /* Pointer to the file or directory path */
|
||||
const FILINFO* <em>TimeDate</em> /* Time and data to be set */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>FileName</dt>
|
||||
<dd>Pointer to the null-terminated string that specifies a <a href="filename.html">file or directory</a> to be changed.</dd>
|
||||
<dt>TimeDate</dt>
|
||||
<dd>Pointer to the file information structure that has a timestamp to be set in member fdate and ftime. Do not care any other members.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>The function succeeded.</dd>
|
||||
<dt>FR_NO_FILE</dt>
|
||||
<dd>Could not find the file.</dd>
|
||||
<dt>FR_NO_PATH</dt>
|
||||
<dd>Could not find the path.</dd>
|
||||
<dt>FR_INVALID_NAME</dt>
|
||||
<dd>The file name is invalid.</dd>
|
||||
<dt>FR_INVALID_DRIVE</dt>
|
||||
<dd>The drive number is invalid.</dd>
|
||||
<dt>FR_NOT_READY</dt>
|
||||
<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
|
||||
<dt>FR_WRITE_PROTECTED</dt>
|
||||
<dd>The medium is write protected.</dd>
|
||||
<dt>FR_DISK_ERR</dt>
|
||||
<dd>The function failed due to an error in the disk function.</dd>
|
||||
<dt>FR_INT_ERR</dt>
|
||||
<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
|
||||
<dt>FR_NOT_ENABLED</dt>
|
||||
<dd>The logical drive has no work area.</dd>
|
||||
<dt>FR_NO_FILESYSTEM</dt>
|
||||
<dd>There is no valid FAT volume on the disk.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The f_utime function changes the timestamp of a file or directory</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_FS_MINIMIZE == 0</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="stat.html">f_stat</a>, <a href="sfileinfo.html">FILINFO</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
79
Demo/Common/FileSystem/FatFs-0.7e/doc/en/write.html
Normal file
79
Demo/Common/FileSystem/FatFs-0.7e/doc/en/write.html
Normal file
|
@ -0,0 +1,79 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_write</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para">
|
||||
<h2>f_write</h2>
|
||||
<p>The f_write writes data to a file.</p>
|
||||
<pre>
|
||||
FRESULT f_write (
|
||||
FIL* <em>FileObject</em>, /* Pointer to the file object structure */
|
||||
const void* <em>Buffer</em>, /* Pointer to the data to be written */
|
||||
UINT <em>ByteToWrite</em>, /* Number of bytes to write */
|
||||
UINT* <em>ByteWritten</em> /* Pointer to the variable to return number of bytes written */
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>FileObject</dt>
|
||||
<dd>Pointer to the open file object structure.</dd>
|
||||
<dt>Buffer</dt>
|
||||
<dd>Pointer to the data to be written.</dd>
|
||||
<dt>ByteToWrite</dt>
|
||||
<dd>Specifies number of bytes to write in range of UINT.</dd>
|
||||
<dt>ByteWritten</dt>
|
||||
<dd>Pointer to the UINT variable to return the number of bytes written. The value is always valid after the function call regardless of the result.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Return Values</h4>
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>The function succeeded.</dd>
|
||||
<dt>FR_DENIED</dt>
|
||||
<dd>The function denied due to the file has been opened in non-write mode.</dd>
|
||||
<dt>FR_DISK_ERR</dt>
|
||||
<dd>The function failed due to an error in the disk function.</dd>
|
||||
<dt>FR_INT_ERR</dt>
|
||||
<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
|
||||
<dt>FR_NOT_READY</dt>
|
||||
<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
|
||||
<dt>FR_INVALID_OBJECT</dt>
|
||||
<dd>The file object is invalid.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>Description</h4>
|
||||
<p>The R/W pointer in the file object is increased in number of bytes written. After the function succeeded, <tt>*ByteWritten</tt> should be checked to detect the disk full. In case of <tt>*ByteWritten < ByteToWrite</tt>, it means the volume got full during the write operation.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>Available when <tt>_FS_READONLY == 0</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para">
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="read.html">f_read</a>, <a href="putc.html">fputc</a>, <a href="puts.html">fputs</a>, <a href="printf.html">fprintf</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue