David Godfrey / FATFileSystem

Fork of FATFileSystem by mbed official

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ffconf.h Source File

ffconf.h

00001 /*---------------------------------------------------------------------------/
00002 /  FatFs - FAT file system module configuration file  R0.09a (C)ChaN, 2012
00003 /----------------------------------------------------------------------------/
00004 /
00005 / CAUTION! Do not forget to make clean the project after any changes to
00006 / the configuration options.
00007 /
00008 /----------------------------------------------------------------------------*/
00009 
00010 /** Fat Filesystem Local Configuration File
00011 / * DO NOT MAKE per Project changes to ffconf.h
00012 / * Insetad, copy this fragment into a new project file 
00013 / * (anyware in the Directory Tree) called local_ffconf.h
00014 / *
00015 / *
00016 / * Start of file local_ffconf.h
00017 //----------------------------------------------------------------------------
00018 //  FatFs - FAT file system module configuration file  R0.09a (C)ChaN, 2012
00019 //----------------------------------------------------------------------------
00020 //
00021 // CAUTION! Do not forget to make clean the project after any changes to
00022 // the configuration options.
00023 //
00024 //----------------------------------------------------------------------------
00025 #ifndef LOCAL_FFCONF_H
00026     #define LOCAL_FFCONF_H 1000    // Revision ID
00027 // 
00028 //---------------------------------------------------------------------------
00029 // This file can be used to override and validate settings in
00030 //     FATFileSystem/ChaN/ffconf.h
00031 // It should contain all settings from that file including the defaults.
00032 // for settings that need to be "Different" from the defaults don't forget to
00033 //     #undef xyz
00034 //     #define xyz new_value
00035 // You should only #undef settings that need to change.
00036 // This helps protect you against unexpected changes to the library config
00037 // after an update.
00038 //----------------------------------------------------------------------------
00039 
00040 //---------------------------------------------------------------------------
00041 // Insert your config below this comment.
00042 // It is recommended that you put all config options in here, 
00043 // but only #undef the ones that are different from defaults
00044 // that way you will get a warning if the defaults change in the future
00045 //----------------------------------------------------------------------------
00046     // example overriding a default
00047     // #undef _FS_TINY
00048     // #define _FS_TINY        1   // 0:Normal or 1:Tiny 
00049 
00050     // example confirming a default
00051     // #define _FS_READONLY    0   // 0:Read/Write or 1:Read only
00052 #endif // LOCAL_FFCONF_H
00053 / * end of file local_ffconf.h
00054 */
00055 
00056 
00057 
00058 
00059 #ifndef _FFCONF
00060 #define _FFCONF 4004    /* Revision ID */
00061 
00062 #define FFS_DBG     0
00063 
00064 /*---------------------------------------------------------------------------/
00065 / Functions and Buffer Configurations
00066 /----------------------------------------------------------------------------*/
00067 
00068 #define _FS_TINY        0   /* 0:Normal or 1:Tiny */
00069 /* When _FS_TINY is set to 1, FatFs uses the sector buffer in the file system
00070 /  object instead of the sector buffer in the individual file object for file
00071 /  data transfer. This reduces memory consumption 512 bytes each file object. */
00072 
00073 
00074 #define _FS_READONLY    0   /* 0:Read/Write or 1:Read only */
00075 /* Setting _FS_READONLY to 1 defines read only configuration. This removes
00076 /  writing functions, f_write, f_sync, f_unlink, f_mkdir, f_chmod, f_rename,
00077 /  f_truncate and useless f_getfree. */
00078 
00079 
00080 #define _FS_MINIMIZE    0   /* 0 to 3 */
00081 /* The _FS_MINIMIZE option defines minimization level to remove some functions.
00082 /
00083 /   0: Full function.
00084 /   1: f_stat, f_getfree, f_unlink, f_mkdir, f_chmod, f_truncate and f_rename
00085 /      are removed.
00086 /   2: f_opendir and f_readdir are removed in addition to 1.
00087 /   3: f_lseek is removed in addition to 2. */
00088 
00089 
00090 #define _USE_STRFUNC    0   /* 0:Disable or 1-2:Enable */
00091 /* To enable string functions, set _USE_STRFUNC to 1 or 2. */
00092 
00093 
00094 #define _USE_MKFS       1   /* 0:Disable or 1:Enable */
00095 /* To enable f_mkfs function, set _USE_MKFS to 1 and set _FS_READONLY to 0 */
00096 
00097 
00098 #define _USE_FORWARD    0   /* 0:Disable or 1:Enable */
00099 /* To enable f_forward function, set _USE_FORWARD to 1 and set _FS_TINY to 1. */
00100 
00101 
00102 #define _USE_FASTSEEK   0   /* 0:Disable or 1:Enable */
00103 /* To enable fast seek feature, set _USE_FASTSEEK to 1. */
00104 
00105 
00106 
00107 /*---------------------------------------------------------------------------/
00108 / Locale and Namespace Configurations
00109 /----------------------------------------------------------------------------*/
00110 
00111 #define _CODE_PAGE  858
00112 /* The _CODE_PAGE specifies the OEM code page to be used on the target system.
00113 /  Incorrect setting of the code page can cause a file open failure.
00114 /
00115 /   932  - Japanese Shift-JIS (DBCS, OEM, Windows)
00116 /   936  - Simplified Chinese GBK (DBCS, OEM, Windows)
00117 /   949  - Korean (DBCS, OEM, Windows)
00118 /   950  - Traditional Chinese Big5 (DBCS, OEM, Windows)
00119 /   1250 - Central Europe (Windows)
00120 /   1251 - Cyrillic (Windows)
00121 /   1252 - Latin 1 (Windows)
00122 /   1253 - Greek (Windows)
00123 /   1254 - Turkish (Windows)
00124 /   1255 - Hebrew (Windows)
00125 /   1256 - Arabic (Windows)
00126 /   1257 - Baltic (Windows)
00127 /   1258 - Vietnam (OEM, Windows)
00128 /   437  - U.S. (OEM)
00129 /   720  - Arabic (OEM)
00130 /   737  - Greek (OEM)
00131 /   775  - Baltic (OEM)
00132 /   850  - Multilingual Latin 1 (OEM)
00133 /   858  - Multilingual Latin 1 + Euro (OEM)
00134 /   852  - Latin 2 (OEM)
00135 /   855  - Cyrillic (OEM)
00136 /   866  - Russian (OEM)
00137 /   857  - Turkish (OEM)
00138 /   862  - Hebrew (OEM)
00139 /   874  - Thai (OEM, Windows)
00140 /   1    - ASCII only (Valid for non LFN cfg.)
00141 */
00142 
00143 
00144 #define _USE_LFN    1       /* 0 to 3 */
00145 #define _MAX_LFN    255     /* Maximum LFN length to handle (12 to 255) */
00146 /* The _USE_LFN option switches the LFN support.
00147 /
00148 /   0: Disable LFN feature. _MAX_LFN and _LFN_UNICODE have no effect.
00149 /   1: Enable LFN with static working buffer on the BSS. Always NOT reentrant.
00150 /   2: Enable LFN with dynamic working buffer on the STACK.
00151 /   3: Enable LFN with dynamic working buffer on the HEAP.
00152 /
00153 /  The LFN working buffer occupies (_MAX_LFN + 1) * 2 bytes. To enable LFN,
00154 /  Unicode handling functions ff_convert() and ff_wtoupper() must be added
00155 /  to the project. When enable to use heap, memory control functions
00156 /  ff_memalloc() and ff_memfree() must be added to the project. */
00157 
00158 
00159 #define _LFN_UNICODE    0   /* 0:ANSI/OEM or 1:Unicode */
00160 /* To switch the character code set on FatFs API to Unicode,
00161 /  enable LFN feature and set _LFN_UNICODE to 1. */
00162 
00163 
00164 #define _FS_RPATH       0   /* 0 to 2 */
00165 /* The _FS_RPATH option configures relative path feature.
00166 /
00167 /   0: Disable relative path feature and remove related functions.
00168 /   1: Enable relative path. f_chdrive() and f_chdir() are available.
00169 /   2: f_getcwd() is available in addition to 1.
00170 /
00171 /  Note that output of the f_readdir fnction is affected by this option. */
00172 
00173 
00174 
00175 /*---------------------------------------------------------------------------/
00176 / Physical Drive Configurations
00177 /----------------------------------------------------------------------------*/
00178 
00179 #define _VOLUMES    1
00180 /* Number of volumes (logical drives) to be used. */
00181 
00182 
00183 #define _MAX_SS     512     /* 512, 1024, 2048 or 4096 */
00184 /* Maximum sector size to be handled.
00185 /  Always set 512 for memory card and hard disk but a larger value may be
00186 /  required for on-board flash memory, floppy disk and optical disk.
00187 /  When _MAX_SS is larger than 512, it configures FatFs to variable sector size
00188 /  and GET_SECTOR_SIZE command must be implememted to the disk_ioctl function. */
00189 
00190 
00191 #define _MULTI_PARTITION    0   /* 0:Single partition, 1/2:Enable multiple partition */
00192 /* When set to 0, each volume is bound to the same physical drive number and
00193 / it can mount only first primaly partition. When it is set to 1, each volume
00194 / is tied to the partitions listed in VolToPart[]. */
00195 
00196 
00197 #define _USE_ERASE  0   /* 0:Disable or 1:Enable */
00198 /* To enable sector erase feature, set _USE_ERASE to 1. CTRL_ERASE_SECTOR command
00199 /  should be added to the disk_ioctl functio. */
00200 
00201 
00202 
00203 /*---------------------------------------------------------------------------/
00204 / System Configurations
00205 /----------------------------------------------------------------------------*/
00206 
00207 #define _WORD_ACCESS    0   /* 0 or 1 */
00208 /* Set 0 first and it is always compatible with all platforms. The _WORD_ACCESS
00209 /  option defines which access method is used to the word data on the FAT volume.
00210 /
00211 /   0: Byte-by-byte access.
00212 /   1: Word access. Do not choose this unless following condition is met.
00213 /
00214 /  When the byte order on the memory is big-endian or address miss-aligned word
00215 /  access results incorrect behavior, the _WORD_ACCESS must be set to 0.
00216 /  If it is not the case, the value can also be set to 1 to improve the
00217 /  performance and code size.
00218 */
00219 
00220 
00221 /* A header file that defines sync object types on the O/S, such as
00222 /  windows.h, ucos_ii.h and semphr.h, must be included prior to ff.h. */
00223 
00224 #define _FS_REENTRANT   0       /* 0:Disable or 1:Enable */
00225 #define _FS_TIMEOUT     1000    /* Timeout period in unit of time ticks */
00226 #define _SYNC_t         HANDLE  /* O/S dependent type of sync object. e.g. HANDLE, OS_EVENT*, ID and etc.. */
00227 
00228 /* The _FS_REENTRANT option switches the reentrancy (thread safe) of the FatFs module.
00229 /
00230 /   0: Disable reentrancy. _SYNC_t and _FS_TIMEOUT have no effect.
00231 /   1: Enable reentrancy. Also user provided synchronization handlers,
00232 /      ff_req_grant, ff_rel_grant, ff_del_syncobj and ff_cre_syncobj
00233 /      function must be added to the project. */
00234 
00235 
00236 #define _FS_LOCK    0   /* 0:Disable or >=1:Enable */
00237 /* To enable file lock control feature, set _FS_LOCK to 1 or greater.
00238    The value defines how many files can be opened simultaneously. */
00239 
00240 #define FLUSH_ON_NEW_CLUSTER    0   /* Sync the file on every new cluster */
00241 #define FLUSH_ON_NEW_SECTOR     1   /* Sync the file on every new sector */
00242 /* Only one of these two defines needs to be set to 1. If both are set to 0
00243    the file is only sync when closed.
00244    Clusters are group of sectors (eg: 8 sectors). Flushing on new cluster means
00245    it would be less often than flushing on new sector. Sectors are generally
00246    512 Bytes long. */
00247    
00248 #include local_ffconf.h
00249 
00250 #endif /* _FFCONFIG */