1e6865dcdSopenharmony_ci<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 2e6865dcdSopenharmony_ci<html lang="en"> 3e6865dcdSopenharmony_ci<head> 4e6865dcdSopenharmony_ci<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 5e6865dcdSopenharmony_ci<meta http-equiv="Content-Style-Type" content="text/css"> 6e6865dcdSopenharmony_ci<link rel="up" title="FatFs" href="../00index_e.html"> 7e6865dcdSopenharmony_ci<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/config.html"> 8e6865dcdSopenharmony_ci<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default"> 9e6865dcdSopenharmony_ci<title>FatFs - Configuration Options</title> 10e6865dcdSopenharmony_ci</head> 11e6865dcdSopenharmony_ci 12e6865dcdSopenharmony_ci<body> 13e6865dcdSopenharmony_ci<h1>Configuration Options</h1> 14e6865dcdSopenharmony_ci<p>There are many options to configure the features of FatFs for various requirements of each project. The configuration options are defined in <em><tt>ffconf.h</tt></em>.</p> 15e6865dcdSopenharmony_ci<ul> 16e6865dcdSopenharmony_ci<li>Function Configurations 17e6865dcdSopenharmony_ci <ul> 18e6865dcdSopenharmony_ci <li><a href="#fs_readonly">FF_FS_READONLY</a></li> 19e6865dcdSopenharmony_ci <li><a href="#fs_minimize">FF_FS_MINIMIZE</a></li> 20e6865dcdSopenharmony_ci <li><a href="#use_find">FF_USE_FIND</a></li> 21e6865dcdSopenharmony_ci <li><a href="#use_mkfs">FF_USE_MKFS</a></li> 22e6865dcdSopenharmony_ci <li><a href="#use_fastseek">FF_USE_FASTSEEK</a></li> 23e6865dcdSopenharmony_ci <li><a href="#use_expand">FF_USE_EXPAND</a></li> 24e6865dcdSopenharmony_ci <li><a href="#use_chmod">FF_USE_CHMOD</a></li> 25e6865dcdSopenharmony_ci <li><a href="#use_label">FF_USE_LABEL</a></li> 26e6865dcdSopenharmony_ci <li><a href="#use_forward">FF_USE_FORWARD</a></li> 27e6865dcdSopenharmony_ci <li><a href="#use_strfunc">FF_USE_STRFUNC</a></li> 28e6865dcdSopenharmony_ci <li><a href="#print_lli">FF_PRINT_LLI</a></li> 29e6865dcdSopenharmony_ci <li><a href="#print_fp">FF_PRINT_FLOAT</a></li> 30e6865dcdSopenharmony_ci <li><a href="#strf_encode">FF_STRF_ENCODE</a></li> 31e6865dcdSopenharmony_ci </ul> 32e6865dcdSopenharmony_ci</li> 33e6865dcdSopenharmony_ci<li>Namespace and Locale Configurations 34e6865dcdSopenharmony_ci <ul> 35e6865dcdSopenharmony_ci <li><a href="#code_page">FF_CODE_PAGE</a></li> 36e6865dcdSopenharmony_ci <li><a href="#use_lfn">FF_USE_LFN</a></li> 37e6865dcdSopenharmony_ci <li><a href="#max_lfn">FF_MAX_LFN</a></li> 38e6865dcdSopenharmony_ci <li><a href="#lfn_unicode">FF_LFN_UNICODE</a></li> 39e6865dcdSopenharmony_ci <li><a href="#lfn_buf">FF_LFN_BUF, FF_SFN_BUF</a></li> 40e6865dcdSopenharmony_ci <li><a href="#fs_rpath">FF_FS_RPATH</a></li> 41e6865dcdSopenharmony_ci </ul> 42e6865dcdSopenharmony_ci</li> 43e6865dcdSopenharmony_ci<li>Volume/Drive Configurations 44e6865dcdSopenharmony_ci <ul> 45e6865dcdSopenharmony_ci <li><a href="#volumes">FF_VOLUMES</a></li> 46e6865dcdSopenharmony_ci <li><a href="#str_volume_id">FF_STR_VOLUME_ID</a></li> 47e6865dcdSopenharmony_ci <li><a href="#volume_strs">FF_VOLUME_STRS</a></li> 48e6865dcdSopenharmony_ci <li><a href="#multi_partition">FF_MULTI_PARTITION</a></li> 49e6865dcdSopenharmony_ci <li><a href="#max_ss">FF_MIN_SS, FF_MAX_SS</a></li> 50e6865dcdSopenharmony_ci <li><a href="#fs_lba64">FF_LBA64</a></li> 51e6865dcdSopenharmony_ci <li><a href="#fs_gptmin">FF_GPT_MIN</a></li> 52e6865dcdSopenharmony_ci <li><a href="#use_trim">FF_USE_TRIM</a></li> 53e6865dcdSopenharmony_ci </ul> 54e6865dcdSopenharmony_ci</li> 55e6865dcdSopenharmony_ci<li>System Configurations 56e6865dcdSopenharmony_ci <ul> 57e6865dcdSopenharmony_ci <li><a href="#fs_tiny">FF_FS_TINY</a></li> 58e6865dcdSopenharmony_ci <li><a href="#fs_exfat">FF_FS_EXFAT</a></li> 59e6865dcdSopenharmony_ci <li><a href="#fs_nortc">FF_FS_NORTC</a></li> 60e6865dcdSopenharmony_ci <li><a href="#nortc_time">FF_NORTC_MON, FF_NORTC_MDAY, FF_NORTC_YEAR</a></li> 61e6865dcdSopenharmony_ci <li><a href="#fs_nofsinfo">FF_FS_NOFSINFO</a></li> 62e6865dcdSopenharmony_ci <li><a href="#fs_lock">FF_FS_LOCK</a></li> 63e6865dcdSopenharmony_ci <li><a href="#fs_reentrant">FF_FS_REENTRANT</a></li> 64e6865dcdSopenharmony_ci <li><a href="#fs_timeout">FF_FS_TIMEOUT</a></li> 65e6865dcdSopenharmony_ci <li><a href="#sync_t">FF_SYNC_t</a></li> 66e6865dcdSopenharmony_ci </ul> 67e6865dcdSopenharmony_ci</li> 68e6865dcdSopenharmony_ci</ul> 69e6865dcdSopenharmony_ci 70e6865dcdSopenharmony_ci<div class="para doc" id="func"> 71e6865dcdSopenharmony_ci<h3>Function Configurations</h3> 72e6865dcdSopenharmony_ci 73e6865dcdSopenharmony_ci<h4 id="fs_readonly">FF_FS_READONLY</h4> 74e6865dcdSopenharmony_ci<p>Read/Write (0) or Read-only (1). Read-only configuration removes writing API functions, <tt>f_write</tt>, <tt>f_sync</tt>, <tt>f_unlink</tt>, <tt>f_mkdir</tt>, <tt>f_chmod</tt>, <tt>f_rename</tt>, <tt>f_truncate</tt>, <tt>f_getfree</tt> and optional writing functions as well.</p> 75e6865dcdSopenharmony_ci 76e6865dcdSopenharmony_ci<h4 id="fs_minimize">FF_FS_MINIMIZE</h4> 77e6865dcdSopenharmony_ci<p>This option defines minimization level to remove some basic API functions as follows:</p> 78e6865dcdSopenharmony_ci<table class="lst1"> 79e6865dcdSopenharmony_ci<tr><th>Value</th><th>Description</th></tr> 80e6865dcdSopenharmony_ci<tr><td>0</td><td>All basic API functions are available.</td></tr> 81e6865dcdSopenharmony_ci<tr><td>1</td><td><tt>f_stat</tt>, <tt>f_getfree</tt>, <tt>f_unlink</tt>, <tt>f_mkdir</tt>, <tt>f_chmod</tt>, <tt>f_utime</tt>, <tt>f_truncate</tt> and <tt>f_rename</tt> function are removed.</td></tr> 82e6865dcdSopenharmony_ci<tr><td>2</td><td><tt>f_opendir</tt>, <tt>f_readdir</tt> and <tt>f_closedir</tt> function are removed in addition to 1.</td></tr> 83e6865dcdSopenharmony_ci<tr><td>3</td><td><tt>f_lseek</tt> function is removed in addition to 2.</td></tr> 84e6865dcdSopenharmony_ci</table> 85e6865dcdSopenharmony_ci 86e6865dcdSopenharmony_ci<h4 id="use_find">FF_USE_FIND</h4> 87e6865dcdSopenharmony_ci<p>Disable (0) or Enable (1) filtered directory read functions, <tt>f_findfirst</tt> and <tt>f_findnext</tt>. Also <tt>FF_FS_MINIMIZE</tt> needs to be 0 or 1.</p> 88e6865dcdSopenharmony_ci 89e6865dcdSopenharmony_ci<h4 id="use_mkfs">FF_USE_MKFS</h4> 90e6865dcdSopenharmony_ci<p>Disable (0) or Enable (1) <tt>f_mkfs</tt> function.</p> 91e6865dcdSopenharmony_ci 92e6865dcdSopenharmony_ci<h4 id="use_fastseek">FF_USE_FASTSEEK</h4> 93e6865dcdSopenharmony_ci<p>Disable (0) or Enable (1) fast seek function to enable accelerated mode for <tt>f_lseek</tt>, <tt>f_read</tt> and <tt>f_write</tt> function. For more information, read <a href="lseek.html">here</a>.</p> 94e6865dcdSopenharmony_ci 95e6865dcdSopenharmony_ci<h4 id="use_expand">FF_USE_EXPAND</h4> 96e6865dcdSopenharmony_ci<p>Disable (0) or Enable (1) <tt>f_expand</tt> function.</p> 97e6865dcdSopenharmony_ci 98e6865dcdSopenharmony_ci<h4 id="use_chmod">FF_USE_CHMOD</h4> 99e6865dcdSopenharmony_ci<p>Disable (0) or Enable (1) metadata control functions, <tt>f_chmod</tt> and <tt>f_utime</tt>. Also <tt>FF_FS_READONLY</tt> needs to be 0.</p> 100e6865dcdSopenharmony_ci 101e6865dcdSopenharmony_ci<h4 id="use_label">FF_USE_LABEL</h4> 102e6865dcdSopenharmony_ci<p>Disable (0) or Enable (1) API functions for volume label, <tt>f_getlabel</tt> and <tt>f_setlabel</tt>.</p> 103e6865dcdSopenharmony_ci 104e6865dcdSopenharmony_ci<h4 id="use_forward">FF_USE_FORWARD</h4> 105e6865dcdSopenharmony_ci<p>Disable (0) or Enable (1) <tt>f_forward</tt> function.</p> 106e6865dcdSopenharmony_ci 107e6865dcdSopenharmony_ci<h4 id="use_strfunc">FF_USE_STRFUNC</h4> 108e6865dcdSopenharmony_ci<p>This option switches string functions, <tt>f_gets</tt>, <tt>f_putc</tt>, <tt>f_puts</tt> and <tt>f_printf</tt>. These functions are equivalents of regular string stream I/O functions in POSIX. If <tt>sprintf</tt> is available and code conversion is not needed, <tt>f_write</tt> with <tt>sprintf</tt> will be efficient in code size and performance rather than <tt>f_printf</tt>. When enable this feature, <tt>stdarg.h</tt> is included in <tt>ff.c</tt>.</p> 109e6865dcdSopenharmony_ci<table class="lst1"> 110e6865dcdSopenharmony_ci<tr><th>Value</th><th>Description</th></tr> 111e6865dcdSopenharmony_ci<tr><td>0</td><td>Disable string functions.</td></tr> 112e6865dcdSopenharmony_ci<tr><td>1</td><td>Enable string functions without LF-CRLF conversion.</td></tr> 113e6865dcdSopenharmony_ci<tr><td>2</td><td>Enable string functions with LF-CRLF conversion.</td></tr> 114e6865dcdSopenharmony_ci</table> 115e6865dcdSopenharmony_ci 116e6865dcdSopenharmony_ci<h4 id="print_lli">FF_PRINT_LLI</h4> 117e6865dcdSopenharmony_ci<p>This option switches support for long long integer argument in <tt>f_printf</tt>.</p> 118e6865dcdSopenharmony_ci<p>Disable (0) or Enable (1). When enable this feature, C standard needs to be C99 or later.</p> 119e6865dcdSopenharmony_ci 120e6865dcdSopenharmony_ci<h4 id="print_fp">FF_PRINT_FLOAT</h4> 121e6865dcdSopenharmony_ci<p>This option switches support for floating point argument in <tt>f_printf</tt>. When enable this feature, C standard needs to be C99 or later and <tt>math.h</tt> is included in <tt>ff.c</tt>.</p> 122e6865dcdSopenharmony_ci<table class="lst1"> 123e6865dcdSopenharmony_ci<tr><th>Value</th><th>Description</th></tr> 124e6865dcdSopenharmony_ci<tr><td>0</td><td>Disable floating point argument.</td></tr> 125e6865dcdSopenharmony_ci<tr><td>1</td><td>Enable floating point argument in type <tt>'f'</tt>, <tt>'e'</tt> and <tt>'E'</tt>.</td></tr> 126e6865dcdSopenharmony_ci<tr><td>2</td><td>Enable it with decimal separator <tt>','</tt> instead of <tt>'.'</tt>.</td></tr> 127e6865dcdSopenharmony_ci</table> 128e6865dcdSopenharmony_ci 129e6865dcdSopenharmony_ci<h4 id="strf_encode">FF_STRF_ENCODE</h4> 130e6865dcdSopenharmony_ci<p>When character encoding on the API is Unicode (<tt>FF_LFN_UNICODE >= 1</tt>), string I/O functions enabled by <tt>FF_USE_STRFUNC</tt> convert the character encoding in it. This option defines the assumption of character encoding <em>on the file</em> to be read/written via those functions. When LFN is not enabled or <tt>FF_LFN_UNICODE == 0</tt>, the string functions work without any code conversion and this option has no effect.</p> 131e6865dcdSopenharmony_ci<table class="lst2"> 132e6865dcdSopenharmony_ci<tr><th>Value</th><th>Character encoding on the file</th></tr> 133e6865dcdSopenharmony_ci<tr><td>0</td><td>ANSI/OEM in current code page</td></tr> 134e6865dcdSopenharmony_ci<tr><td>1</td><td>Unicode in UTF-16LE</td></tr> 135e6865dcdSopenharmony_ci<tr><td>2</td><td>Unicode in UTF-16BE</td></tr> 136e6865dcdSopenharmony_ci<tr><td>3</td><td>Unicode in UTF-8</td></tr> 137e6865dcdSopenharmony_ci</table> 138e6865dcdSopenharmony_ci 139e6865dcdSopenharmony_ci</div> 140e6865dcdSopenharmony_ci 141e6865dcdSopenharmony_ci 142e6865dcdSopenharmony_ci<div class="para doc" id="name"> 143e6865dcdSopenharmony_ci<h3>Namespace and Locale Configurations</h3> 144e6865dcdSopenharmony_ci 145e6865dcdSopenharmony_ci<h4 id="code_page">FF_CODE_PAGE</h4> 146e6865dcdSopenharmony_ci<p>This option specifies the OEM code page used on the target system. Incorrect setting of the code page can cause a file open failure. If any non-ASCII character is not used for the path name or <tt>FF_LFN_UNICODE != 0</tt>, there is no difference between any code page settings. Set it 437 anyway.</p> 147e6865dcdSopenharmony_ci<table class="lst1"> 148e6865dcdSopenharmony_ci<tr><th>Value</th><th>Code page</th></tr> 149e6865dcdSopenharmony_ci<tr><td>0</td><td>Includes all code pages below and set by <tt>f_setcp()</tt></td></tr> 150e6865dcdSopenharmony_ci<tr><td>437</td><td>U.S.</td></tr> 151e6865dcdSopenharmony_ci<tr><td>720</td><td>Arabic</td></tr> 152e6865dcdSopenharmony_ci<tr><td>737</td><td>Greek</td></tr> 153e6865dcdSopenharmony_ci<tr><td>771</td><td>KBL</td></tr> 154e6865dcdSopenharmony_ci<tr><td>775</td><td>Baltic</td></tr> 155e6865dcdSopenharmony_ci<tr><td>850</td><td>Latin 1</td></tr> 156e6865dcdSopenharmony_ci<tr><td>852</td><td>Latin 2</td></tr> 157e6865dcdSopenharmony_ci<tr><td>855</td><td>Cyrillic</td></tr> 158e6865dcdSopenharmony_ci<tr><td>857</td><td>Turkish</td></tr> 159e6865dcdSopenharmony_ci<tr><td>860</td><td>Portuguese</td></tr> 160e6865dcdSopenharmony_ci<tr><td>861</td><td>Icelandic</td></tr> 161e6865dcdSopenharmony_ci<tr><td>862</td><td>Hebrew</td></tr> 162e6865dcdSopenharmony_ci<tr><td>863</td><td>Canadian French</td></tr> 163e6865dcdSopenharmony_ci<tr><td>864</td><td>Arabic</td></tr> 164e6865dcdSopenharmony_ci<tr><td>865</td><td>Nordic</td></tr> 165e6865dcdSopenharmony_ci<tr><td>866</td><td>Russian</td></tr> 166e6865dcdSopenharmony_ci<tr><td>869</td><td>Greek 2</td></tr> 167e6865dcdSopenharmony_ci<tr><td>932</td><td>Japanese (DBCS)</td></tr> 168e6865dcdSopenharmony_ci<tr><td>936</td><td>Simplified Chinese (DBCS)</td></tr> 169e6865dcdSopenharmony_ci<tr><td>949</td><td>Korean (DBCS)</td></tr> 170e6865dcdSopenharmony_ci<tr><td>950</td><td>Traditional Chinese (DBCS)</td></tr> 171e6865dcdSopenharmony_ci</table> 172e6865dcdSopenharmony_ci 173e6865dcdSopenharmony_ci<h4 id="use_lfn">FF_USE_LFN</h4> 174e6865dcdSopenharmony_ci<p>This option switches the support for long file name (LFN). When enable the LFN, Unicode support module <tt>ffunicode.c</tt> need to be added to the project. When use stack for the working buffer, take care on stack overflow. When use heap memory for the working buffer, memory management functions (<tt>ff_memalloc</tt> and <tt>ff_memfree</tt>) need to be added to the project.</p> 175e6865dcdSopenharmony_ci<table class="lst1"> 176e6865dcdSopenharmony_ci<tr><th>Value</th><th>Description</th></tr> 177e6865dcdSopenharmony_ci<tr><td>0</td><td>Disable LFN. Path name in only 8.3 format can be used.</td></tr> 178e6865dcdSopenharmony_ci<tr><td>1</td><td>Enable LFN with static working buffer on the BSS. Always NOT thread-safe.</td></tr> 179e6865dcdSopenharmony_ci<tr><td>2</td><td>Enable LFN with dynamic working buffer on the STACK.</td></tr> 180e6865dcdSopenharmony_ci<tr><td>3</td><td>Enable LFN with dynamic working buffer on the HEAP.</td></tr> 181e6865dcdSopenharmony_ci</table> 182e6865dcdSopenharmony_ci 183e6865dcdSopenharmony_ci<h4 id="max_lfn">FF_MAX_LFN</h4> 184e6865dcdSopenharmony_ci<p>LFN function requiers certain internal working buffer for the file name. This option defines size of the buffer and the value can be in range of 12 to 255 characters (actually in UTF-16 code units) of the LFN. The buffer occupies <tt>(FF_MAX_LFN + 1) * 2</tt> bytes and additional <tt>(FF_MAX_LFN + 44) / 15 * 32</tt> bytes when exFAT is enabled. It is recommended to be set 255 to fully support the LFN specification. This option has no effect when LFN is not enabled.</p> 185e6865dcdSopenharmony_ci 186e6865dcdSopenharmony_ci<h4 id="lfn_unicode">FF_LFN_UNICODE</h4> 187e6865dcdSopenharmony_ci<p>This option switches character encoding for the file name on the API. FatFs supports the code point up to U+10FFFF. This option also affects behavior of string I/O functions (see <tt>FF_STRF_ENCODE</tt>).</p> 188e6865dcdSopenharmony_ci<table class="lst2"> 189e6865dcdSopenharmony_ci<tr><th>Value</th><th>Character Encoding</th><th><tt>TCHAR</tt></th></tr> 190e6865dcdSopenharmony_ci<tr><td>0</td><td>ANSI/OEM in current CP</td><td>char</td></tr> 191e6865dcdSopenharmony_ci<tr><td>1</td><td>Unicode in UTF-16</td><td>WCHAR</td></tr> 192e6865dcdSopenharmony_ci<tr><td>2</td><td>Unicode in UTF-8</td><td>char</td></tr> 193e6865dcdSopenharmony_ci<tr><td>3</td><td>Unicode in UTF-32</td><td>DWORD</td></tr> 194e6865dcdSopenharmony_ci</table> 195e6865dcdSopenharmony_ci<p>When Unicode is selected, <tt>FF_CODE_PAGE</tt> has actually no meaning except for compatibility with legacy systems, such as MS-DOS and any system without support for LFN.</p> 196e6865dcdSopenharmony_ci<p>When LFN is not enabled, this option has no effect and FatFs works in ANSI/OEM code on the API. For more information, read <a href="filename.html#uni">here</a>.</p> 197e6865dcdSopenharmony_ci 198e6865dcdSopenharmony_ci<h4 id="lfn_buf">FF_LFN_BUF, FF_SFN_BUF</h4> 199e6865dcdSopenharmony_ci<p>This set of options defines size of file name members, <tt>fname[]</tt> and <tt>altname[]</tt>, in the <tt><a href="sfileinfo.html">FILINFO</a></tt> structure which is used to read out the directory items. These values should be suffcient for the file names to read. The maximum possible length of read file name depends on the character encoding scheme on the API as follows:</p> 200e6865dcdSopenharmony_ci<table class="lst2"> 201e6865dcdSopenharmony_ci<tr><th>Encoding</th><th>LFN length</th><th>SFN length</th></tr> 202e6865dcdSopenharmony_ci<tr><td>ANSI/OEM in SBCS</td><td>255 items</td><td>12 items</td></tr> 203e6865dcdSopenharmony_ci<tr><td>ANSI/OEM in DBCS</td><td>510 items</td><td>12 items</td></tr> 204e6865dcdSopenharmony_ci<tr><td>Unicode in UTF-16/32</td><td>255 items</td><td>12 items</td></tr> 205e6865dcdSopenharmony_ci<tr><td>Unicode in UTF-8</td><td>765 items</td><td>34 items</td></tr> 206e6865dcdSopenharmony_ci</table> 207e6865dcdSopenharmony_ci<p>If the size of name member is insufficient for the LFN, the item is treated as without LFN. When LFN is not enabled, these options have no effect.</p> 208e6865dcdSopenharmony_ci 209e6865dcdSopenharmony_ci<h4 id="fs_rpath">FF_FS_RPATH</h4> 210e6865dcdSopenharmony_ci<p>This option configures relative path function. For more information, read <a href="filename.html#nam">here</a>.</p> 211e6865dcdSopenharmony_ci<table class="lst1"> 212e6865dcdSopenharmony_ci<tr><th>Value</th><th>Description</th></tr> 213e6865dcdSopenharmony_ci<tr><td>0</td><td>Disable relative path and remove related functions.</td></tr> 214e6865dcdSopenharmony_ci<tr><td>1</td><td>Enable relative path. <tt>f_chdir</tt> and <tt>f_chdrive</tt> function is available.</td></tr> 215e6865dcdSopenharmony_ci<tr><td>2</td><td><tt>f_getcwd</tt> function is available in addition to 1</td></tr> 216e6865dcdSopenharmony_ci</table> 217e6865dcdSopenharmony_ci 218e6865dcdSopenharmony_ci</div> 219e6865dcdSopenharmony_ci 220e6865dcdSopenharmony_ci 221e6865dcdSopenharmony_ci<div class="para doc" id="volume"> 222e6865dcdSopenharmony_ci<h3>Volume/Drive Configurations</h3> 223e6865dcdSopenharmony_ci 224e6865dcdSopenharmony_ci<h4 id="volumes">FF_VOLUMES</h4> 225e6865dcdSopenharmony_ci<p>This option configures number of volumes (logical drives up to 10) to be used.</p> 226e6865dcdSopenharmony_ci 227e6865dcdSopenharmony_ci<h4 id="str_volume_id">FF_STR_VOLUME_ID</h4> 228e6865dcdSopenharmony_ci<p>This option switches the support for string volume ID. When arbitrary string for the volume ID is enabled for the drive prefix, also pre-defined strings by <tt>FF_VOLUME_STRS</tt> or user defined strings can be used as drive prefix in the path name. Numeric drive number is always valid regardless of this option, and also either format of drive prefix can be enabled by this option.</p> 229e6865dcdSopenharmony_ci<table class="lst2"> 230e6865dcdSopenharmony_ci<tr><th>Value</th><th>Description</th><th>Example</th></tr> 231e6865dcdSopenharmony_ci<tr><td>0</td><td>Only DOS/Windows style drive prefix in numeric ID can be used.</td><td>1:/filename</td></tr> 232e6865dcdSopenharmony_ci<tr><td>1</td><td>Also DOS/Windows style drive prefix in string ID can be used.</td><td>flash:/filename</td></tr> 233e6865dcdSopenharmony_ci<tr><td>2</td><td>Also Unix style drive prefix in string ID can be used.</td><td>/flash/filename</td></tr> 234e6865dcdSopenharmony_ci</table> 235e6865dcdSopenharmony_ci 236e6865dcdSopenharmony_ci<h4 id="volume_strs">FF_VOLUME_STRS</h4> 237e6865dcdSopenharmony_ci<p>This option defines the volume ID strings for each logical drives. Number of items must not be less than <tt>FF_VOLUMES</tt>. Valid characters for the volume ID string are A-Z, a-z and 0-9, however, they are compared in case-insensitive. If <tt>FF_STR_VOLUME_ID == 0</tt>, this option has no effect. If <tt>FF_STR_VOLUME_ID >= 1</tt> and this option is not defined, a user defined volume string table needs to be defined as shown below. The table should not be modified on the fly.</p> 238e6865dcdSopenharmony_ci<pre> 239e6865dcdSopenharmony_ci<span class="c">/* User defined volume ID strings for 0: to 3: */</span> 240e6865dcdSopenharmony_ciconst char* VolumeStr[FF_VOLUMES] = {"ram","flash","sd","usb"}; 241e6865dcdSopenharmony_ci</pre> 242e6865dcdSopenharmony_ci 243e6865dcdSopenharmony_ci<h4 id="multi_partition">FF_MULTI_PARTITION</h4> 244e6865dcdSopenharmony_ci<p>Disable (0) or Enable (1). This option switches multi-partition function. By default (0), each logical drive number is bound to the same physical drive number and only a volume in the physical drive is mounted. When enabled, each logical drive is bound to the partition on the physical drive listed in the user defined partition resolution table <tt>VolToPart[]</tt>. Also <tt>f_fdisk</tt> funciton will be available. For more information, read <a href="filename.html#vol">here</a>.</p> 245e6865dcdSopenharmony_ci 246e6865dcdSopenharmony_ci<h4 id="max_ss">FF_MIN_SS, FF_MAX_SS</h4> 247e6865dcdSopenharmony_ci<p>This set of options defines the extent of sector size used for the low level disk I/O interface, <tt>disk_read</tt> and <tt>disk_write</tt> function. Valid values are 512, 1024, 2048 and 4096. <tt>FF_MIN_SS</tt> defines minimum sector size and <tt>FF_MAX_SS</tt> defines the maximum sector size. Always set both 512 for memory card and harddisk. But a larger value may be required for on-board flash memory and some type of optical media. When <tt>FF_MAX_SS > FF_MIN_SS</tt>, support of variable sector size is enabled and <tt>GET_SECTOR_SIZE</tt> command needs to be implemented to the <tt>disk_ioctl</tt> function.</p> 248e6865dcdSopenharmony_ci 249e6865dcdSopenharmony_ci<h4 id="fs_lba64">FF_LBA64</h4> 250e6865dcdSopenharmony_ci<p>This option switches media access interface to 64-bit LBA and enables GUID Partition Table (GPT) for partition management, Enabled (1) or Disabled (0). exFAT filesystem needs to be enabled to enable this feature.</p> 251e6865dcdSopenharmony_ci 252e6865dcdSopenharmony_ci<h4 id="fs_gptmin">FF_MIN_GPT</h4> 253e6865dcdSopenharmony_ci<p>This option specifies the threshold of determination of partitioning format when create patitions on the drive in <tt>f_mkfs</tt> and <tt>f_fdisk</tt> function. When number of available sectors is equal or larger than this value, the drive will be partitioned in GPT. This option has no effect when <tt>FF_LBA64 == 0</tt>.</p> 254e6865dcdSopenharmony_ci 255e6865dcdSopenharmony_ci<h4 id="use_trim">FF_USE_TRIM</h4> 256e6865dcdSopenharmony_ci<p>Disable (0) or Enable (1). This option switches ATA-TRIM function. To enable Trim function, also <tt>CTRL_TRIM</tt> command should be implemented to the <tt>disk_ioctl</tt> function.</p> 257e6865dcdSopenharmony_ci 258e6865dcdSopenharmony_ci</div> 259e6865dcdSopenharmony_ci 260e6865dcdSopenharmony_ci 261e6865dcdSopenharmony_ci<div class="para doc" id="system"> 262e6865dcdSopenharmony_ci<h3>System Configurations</h3> 263e6865dcdSopenharmony_ci 264e6865dcdSopenharmony_ci<h4 id="fs_tiny">FF_FS_TINY</h4> 265e6865dcdSopenharmony_ci<p>Normal (0) or Tiny (1). The tiny configuration reduces size of the <tt>FIL</tt> structure, file object, <tt>FF_MAX_SS</tt> bytes each. Instead of private sector buffer eliminated from the file object, common sector buffer in the <tt>FATFS</tt> structure, filesystem object, is used for the file data transfer.</p> 266e6865dcdSopenharmony_ci 267e6865dcdSopenharmony_ci<h4 id="fs_exfat">FF_FS_EXFAT</h4> 268e6865dcdSopenharmony_ci<p>This option switches support for exFAT filesystem in addition to the FAT/FAT32 filesystem, Enabled (1) or Disabled (0). To enable exFAT, also LFN must be enabled and configureing <tt>FF_LFN_UNICODE >= 1</tt> and <tt>FF_MAX_LFN == 255</tt> is recommended for full-featured exFAT function. Note that enabling exFAT discards ANSI C (C89) compatibility and wants C99 because of need for 64-bit integer type.</p> 269e6865dcdSopenharmony_ci 270e6865dcdSopenharmony_ci<h4 id="fs_nortc">FF_FS_NORTC</h4> 271e6865dcdSopenharmony_ci<p>Use RTC (0) or Do not use RTC (1). This option controls timestamp featuer. If the system does not have an RTC or valid timestamp is not needed, set <tt>FF_FS_NORTC</tt> to 1 to disable the timestamp function. Every objects modified by FatFs will have a constant timestamp defined by <tt>FF_NORTC_MON</tt>, <tt>FF_NORTC_MDAY</tt> and <tt>FF_NORTC_YEAR</tt>. To use the timestamp featuer, set <tt>FF_FS_NORTC == 0</tt> and add <tt>get_fattime</tt> function to the project to get current time form the RTC. This option has no effect in read-only configuration.</p> 272e6865dcdSopenharmony_ci 273e6865dcdSopenharmony_ci<h4 id="nortc_time">FF_NORTC_MON, FF_NORTC_MDAY, FF_NORTC_YEAR</h4> 274e6865dcdSopenharmony_ci<p>This set of options defines the time to be used in no RTC systems. This option has no effect in read-only configuration or <tt>FF_FS_NORTC == 0</tt>.</p> 275e6865dcdSopenharmony_ci 276e6865dcdSopenharmony_ci<h4 id="fs_nofsinfo">FF_FS_NOFSINFO</h4> 277e6865dcdSopenharmony_ci<p>0 to 3. If you need to know correct free space on the FAT32 volume, set bit 0 of this option, and <tt>f_getfree</tt> function at first time after the volume mounted will force a full FAT scan. Bit 1 controls the use of last allocated cluster number for new allocation.</p> 278e6865dcdSopenharmony_ci<table class="lst1"> 279e6865dcdSopenharmony_ci<tr><th>Value</th><th>Description</th></tr> 280e6865dcdSopenharmony_ci<tr><td>bit0=0</td><td>Use free cluster count in the FSINFO if available.</td></tr> 281e6865dcdSopenharmony_ci<tr><td>bit0=1</td><td>Do not trust free cluster count in the FSINFO.</td></tr> 282e6865dcdSopenharmony_ci<tr><td>bit1=0</td><td>Use last allocated cluster number in the FSINFO to find a free cluster if available.</td></tr> 283e6865dcdSopenharmony_ci<tr><td>bit1=1</td><td>Do not trust last allocated cluster number in the FSINFO.</td></tr> 284e6865dcdSopenharmony_ci</table> 285e6865dcdSopenharmony_ci 286e6865dcdSopenharmony_ci<h4 id="fs_lock">FF_FS_LOCK</h4> 287e6865dcdSopenharmony_ci<p>This option switches file lock feature to control duplicated file open and illegal operations to the open objects. Note that this feature is independent of re-entrancy. This option must be 0 in read-only configuration.</p> 288e6865dcdSopenharmony_ci<table class="lst1"> 289e6865dcdSopenharmony_ci<tr><th>Value</th><th>Description</th></tr> 290e6865dcdSopenharmony_ci<tr><td>0</td><td>Disable file lock feature. To avoid to collapse files due to wrong file operations, application program needs to avoid illegal open, remove and rename to the open objects.</td></tr> 291e6865dcdSopenharmony_ci<tr><td>>0</td><td>Enable file lock feature. The value defines how many files/sub-directories can be opened simultaneously under the file lock feature. Illigal operations to the open object will be rejected with <tt>FR_LOCKED</tt>.</td></tr> 292e6865dcdSopenharmony_ci</table> 293e6865dcdSopenharmony_ci 294e6865dcdSopenharmony_ci<h4 id="fs_reentrant">FF_FS_REENTRANT</h4> 295e6865dcdSopenharmony_ci<p>Disable (0) or Enable (1). This option switches the re-entrancy (thread safe) of the FatFs module itself. Note that file/directory access to the different volume is always re-entrant and it can work simultaneously regardless of this option, however, volume management functions, <tt>f_mount</tt>, <tt>f_mkfs</tt> and <tt>f_fdisk</tt>, are <em>always not re-entrant</em>. Only file/directory access to the same volume, in other words, exclusive use of each filesystem object, is under control in this feature. To enable this feature, also user provided synchronization handlers, <tt>ff_mutex_take</tt>, <tt>ff_mutex_give</tt>, <tt>ff_mutex_create</tt> and <tt>ff_mutex_delete</tt>, need to be added to the project. Sample code is available in <tt>ffsystem.c</tt>.</p> 296e6865dcdSopenharmony_ci 297e6865dcdSopenharmony_ci<h4 id="fs_timeout">FF_FS_TIMEOUT</h4> 298e6865dcdSopenharmony_ci<p>Number of O/S time ticks to abort the file function with <tt>FR_TIMEOUT</tt> when the wait time exceeds this period. This option has no effect when <tt>FF_FS_REENTRANT == 0</tt>.</p> 299e6865dcdSopenharmony_ci 300e6865dcdSopenharmony_ci</div> 301e6865dcdSopenharmony_ci 302e6865dcdSopenharmony_ci<p class="foot"><a href="../00index_e.html">Return</a></p> 303e6865dcdSopenharmony_ci</body> 304e6865dcdSopenharmony_ci</html> 305