Huseyin Buyukesmeli / FatFS

Dependents:   DISCO-F746NG_uSD Active-WolfMan_V2-5-All-Frank-Board-Functions_copy DISCO-F746NG_uSD DISCO-F746NG_uSD

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.11 (C)ChaN, 2015
00003 /----------------------------------------------------------------------------/
00004 /
00005 / CAUTION! Do not forget to make clean the project after any changes to
00006 / the configuration options.
00007 /
00008 /----------------------------------------------------------------------------*/
00009 #ifndef _FFCONF
00010 #define _FFCONF 32020 /* Revision ID */
00011 
00012 /*-----------------------------------------------------------------------------/
00013 / Additional user header to be used  
00014 /-----------------------------------------------------------------------------*/
00015 #include "stm32f7xx_hal.h"
00016 #define USE_STM32746G_DISCOVERY
00017 
00018 #ifdef USE_STM32746G_DISCOVERY
00019   #include "stm32746g_discovery_sd.h"
00020 #else
00021   #error "Please select first the Board used in your application (in boardname_eval.h file)"
00022 #endif
00023 
00024 /*-----------------------------------------------------------------------------/
00025 / Functions and Buffer Configurations
00026 /-----------------------------------------------------------------------------*/
00027 
00028 #define _FS_TINY             0      /* 0:Normal or 1:Tiny */
00029 /* When _FS_TINY is set to 1, FatFs uses the sector buffer in the file system
00030 /  object instead of the sector buffer in the individual file object for file
00031 /  data transfer. This reduces memory consumption 512 bytes each file object. */
00032 
00033 
00034 #define _FS_READONLY         0      /* 0:Read/Write or 1:Read only */
00035 /* Setting _FS_READONLY to 1 defines read only configuration. This removes
00036 /  writing functions, f_write, f_sync, f_unlink, f_mkdir, f_chmod, f_rename,
00037 /  f_truncate and useless f_getfree. */
00038 
00039 
00040 #define _FS_MINIMIZE         0      /* 0 to 3 */
00041 /* The _FS_MINIMIZE option defines minimization level to remove some functions.
00042 /
00043 /   0: Full function.
00044 /   1: f_stat, f_getfree, f_unlink, f_mkdir, f_chmod, f_truncate, f_utime 
00045 /      and f_rename are removed.
00046 /   2: f_opendir and f_readdir are removed in addition to 1.
00047 /   3: f_lseek is removed in addition to 2. */
00048 
00049 
00050 #define _USE_STRFUNC         2      /* 0:Disable or 1-2:Enable */
00051 /* To enable string functions, set _USE_STRFUNC to 1 or 2. */
00052 
00053 
00054 #define _USE_FIND               0
00055 /* This option switches filtered directory read feature and related functions,
00056 /  f_findfirst() and f_findnext(). (0:Disable or 1:Enable) */
00057 
00058 
00059 #define _USE_MKFS            1      /* 0:Disable or 1:Enable */
00060 /* To enable f_mkfs function, set _USE_MKFS to 1 and set _FS_READONLY to 0 */
00061 
00062 
00063 #define _USE_FASTSEEK        1      /* 0:Disable or 1:Enable */
00064 /* To enable fast seek feature, set _USE_FASTSEEK to 1. */
00065 
00066 
00067 #define _USE_LABEL           0      /* 0:Disable or 1:Enable */
00068 /* To enable volume label functions, set _USE_LAVEL to 1 */
00069 
00070 
00071 #define _USE_FORWARD         0      /* 0:Disable or 1:Enable */
00072 /* To enable f_forward function, set _USE_FORWARD to 1 and set _FS_TINY to 1. */
00073 
00074 
00075 #define _USE_BUFF_WO_ALIGNMENT  0
00076 /* This option is available only for usbh diskio interface and allow to disable
00077 /  the management of the unaligned buffer.
00078 /  When STM32 USB OTG HS or FS IP is used with internal DMA enabled, this define
00079 /  must be set to 0 to align data into 32bits through an internal scratch buffer
00080 /  before being processed by the DMA . Otherwise (DMA not used), this define must
00081 /  be set to 1 to avoid Data alignment and improve the performance.
00082 /  Please note that if _USE_BUFF_WO_ALIGNMENT is set to 1 and an unaligned 32bits
00083 /  buffer is forwarded to the FatFs Write/Read functions, an error will be returned.
00084 /  (0: default value or 1: unaligned buffer return an error). */
00085 
00086 /*-----------------------------------------------------------------------------/
00087 / Local and Namespace Configurations
00088 /-----------------------------------------------------------------------------*/
00089 
00090 #define _CODE_PAGE         1252
00091 /* The _CODE_PAGE specifies the OEM code page to be used on the target system.
00092 /  Incorrect setting of the code page can cause a file open failure.
00093 /
00094 /   932  - Japanese Shift-JIS (DBCS, OEM, Windows)
00095 /   936  - Simplified Chinese GBK (DBCS, OEM, Windows)
00096 /   949  - Korean (DBCS, OEM, Windows)
00097 /   950  - Traditional Chinese Big5 (DBCS, OEM, Windows)
00098 /   1250 - Central Europe (Windows)
00099 /   1251 - Cyrillic (Windows)
00100 /   1252 - Latin 1 (Windows)
00101 /   1253 - Greek (Windows)
00102 /   1254 - Turkish (Windows)
00103 /   1255 - Hebrew (Windows)
00104 /   1256 - Arabic (Windows)
00105 /   1257 - Baltic (Windows)
00106 /   1258 - Vietnam (OEM, Windows)
00107 /   437  - U.S. (OEM)
00108 /   720  - Arabic (OEM)
00109 /   737  - Greek (OEM)
00110 /   775  - Baltic (OEM)
00111 /   850  - Multilingual Latin 1 (OEM)
00112 /   858  - Multilingual Latin 1 + Euro (OEM)
00113 /   852  - Latin 2 (OEM)
00114 /   855  - Cyrillic (OEM)
00115 /   866  - Russian (OEM)
00116 /   857  - Turkish (OEM)
00117 /   862  - Hebrew (OEM)
00118 /   874  - Thai (OEM, Windows)
00119 / 1    - ASCII only (Valid for non LFN cfg.)
00120 */
00121 
00122 
00123 #define _USE_LFN     0  /* 0 to 3 */
00124 #define _MAX_LFN     255  /* Maximum LFN length to handle (12 to 255) */
00125 /* The _USE_LFN option switches the LFN feature.
00126 /
00127 /   0: Disable LFN feature. _MAX_LFN has no effect.
00128 /   1: Enable LFN with static working buffer on the BSS. Always NOT reentrant.
00129 /   2: Enable LFN with dynamic working buffer on the STACK.
00130 /   3: Enable LFN with dynamic working buffer on the HEAP.
00131 /
00132 /  To enable LFN feature, Unicode handling functions ff_convert() and ff_wtoupper()
00133 /  function must be added to the project.
00134 /  The LFN working buffer occupies (_MAX_LFN + 1) * 2 bytes. When use stack for the
00135 /  working buffer, take care on stack overflow. When use heap memory for the working
00136 /  buffer, memory management functions, ff_memalloc() and ff_memfree(), must be added
00137 /  to the project. */
00138 
00139 
00140 #define _LFN_UNICODE    0 /* 0:ANSI/OEM or 1:Unicode */
00141 /* To switch the character encoding on the FatFs API to Unicode, enable LFN feature
00142 /  and set _LFN_UNICODE to 1. */
00143 
00144 
00145 #define _STRF_ENCODE    3 /* 0:ANSI/OEM, 1:UTF-16LE, 2:UTF-16BE, 3:UTF-8 */
00146 /* When Unicode API is enabled, character encoding on the all FatFs API is switched
00147 /  to Unicode. This option selects the character encoding on the file to be read/written
00148 /  via string functions, f_gets(), f_putc(), f_puts and f_printf().
00149 /  This option has no effect when _LFN_UNICODE is 0. */
00150 
00151 
00152 #define _FS_RPATH       0 /* 0 to 2 */
00153 /* The _FS_RPATH option configures relative path feature.
00154 /
00155 /   0: Disable relative path feature and remove related functions.
00156 /   1: Enable relative path. f_chdrive() and f_chdir() function are available.
00157 /   2: f_getcwd() function is available in addition to 1.
00158 /
00159 /  Note that output of the f_readdir() fnction is affected by this option. */
00160 
00161 
00162 /*---------------------------------------------------------------------------/
00163 / Drive/Volume Configurations
00164 /----------------------------------------------------------------------------*/
00165 
00166 #define _VOLUMES    1
00167 /* Number of volumes (logical drives) to be used. */
00168 
00169 
00170 #define _MULTI_PARTITION     0 /* 0:Single partition, 1:Enable multiple partition */
00171 /* When set to 0, each volume is bound to the same physical drive number and
00172 / it can mount only first primaly partition. When it is set to 1, each volume
00173 / is tied to the partitions listed in VolToPart[]. */
00174 
00175 
00176 #define _MIN_SS                 512
00177 #define _MAX_SS                 512
00178 /* These options configure the range of sector size to be supported. (512, 1024, 2048 or
00179 /  4096) Always set both 512 for most systems, all memory card and harddisk. But a larger
00180 /  value may be required for on-board flash memory and some type of optical media.
00181 /  When _MAX_SS is larger than _MIN_SS, FatFs is configured to variable sector size and
00182 /  GET_SECTOR_SIZE command must be implemented to the disk_ioctl() function. */
00183 
00184 
00185 #define _USE_TRIM                0
00186 /* This option switches ATA-TRIM feature. (0:Disable or 1:Enable)
00187 /  To enable Trim feature, also CTRL_TRIM command should be implemented to the
00188 /  disk_ioctl() function. */
00189 
00190 
00191 #define _FS_NOFSINFO    0 /* 0 or 1 */
00192 /* If you need to know the correct free space on the FAT32 volume, set this
00193 /  option to 1 and f_getfree() function at first time after volume mount will
00194 /  force a full FAT scan.
00195 /
00196 /  0: Load all informations in the FSINFO if available.
00197 /  1: Do not trust free cluster count in the FSINFO.
00198 */
00199 
00200 
00201 /*---------------------------------------------------------------------------/
00202 / System Configurations
00203 /----------------------------------------------------------------------------*/
00204 
00205 #define _FS_NORTC 0
00206 #define _NORTC_MON  2
00207 #define _NORTC_MDAY 1
00208 #define _NORTC_YEAR 2015
00209 /* The _FS_NORTC option switches timestamp feature. If the system does not have
00210 /  an RTC function or valid timestamp is not needed, set _FS_NORTC to 1 to disable
00211 /  the timestamp feature. All objects modified by FatFs will have a fixed timestamp
00212 /  defined by _NORTC_MON, _NORTC_MDAY and _NORTC_YEAR.
00213 /  When timestamp feature is enabled (_FS_NORTC == 0), get_fattime() function need
00214 /  to be added to the project to read current time form RTC. _NORTC_MON,
00215 /  _NORTC_MDAY and _NORTC_YEAR have no effect.
00216 /  These options have no effect at read-only configuration (_FS_READONLY == 1). */
00217 
00218 #define _WORD_ACCESS    0 /* 0 or 1 */
00219 /* The _WORD_ACCESS option is an only platform dependent option. It defines
00220 /  which access method is used to the word data on the FAT volume.
00221 /
00222 /   0: Byte-by-byte access. Always compatible with all platforms.
00223 /   1: Word access. Do not choose this unless under both the following conditions.
00224 /
00225 /  * Byte order on the memory is little-endian.
00226 /  * Address miss-aligned word access is always allowed for all instructions.
00227 /
00228 /  If it is the case, _WORD_ACCESS can also be set to 1 to improve performance
00229 /  and reduce code size.
00230 */
00231 
00232 
00233 /* A header file that defines sync object types on the O/S, such as
00234 /  windows.h, ucos_ii.h and semphr.h, must be included prior to ff.h. */
00235 
00236 #define _FS_REENTRANT    0  /* 0:Disable or 1:Enable */
00237 #define _FS_TIMEOUT      1000 /* Timeout period in unit of time ticks */
00238 #define _SYNC_t          0 /* O/S dependent type of sync object. e.g. HANDLE, OS_EVENT*, ID and etc.. */
00239 
00240 /* The _FS_REENTRANT option switches the re-entrancy (thread safe) of the FatFs module.
00241 /
00242 /   0: Disable re-entrancy. _SYNC_t and _FS_TIMEOUT have no effect.
00243 /   1: Enable re-entrancy. Also user provided synchronization handlers,
00244 /      ff_req_grant(), ff_rel_grant(), ff_del_syncobj() and ff_cre_syncobj()
00245 /      function must be added to the project. */
00246 
00247 
00248 #define _FS_LOCK    2      /* 0:Disable or >=1:Enable */
00249 /* To enable file lock control feature, set _FS_LOCK to 1 or greater.
00250    The value defines how many files can be opened simultaneously. */
00251 
00252 
00253 #endif /* _FFCONFIG */
00254