WILLY BAYOT / stm32_adafruit

Dependents:   TDEMNucleo

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ffconf_template.h Source File

ffconf_template.h

00001 /*---------------------------------------------------------------------------/
00002 /  FatFs - FAT file system module configuration file  R0.10  (C)ChaN, 2013
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 80960 /* Revision ID */
00011 
00012 /*-----------------------------------------------------------------------------/
00013 / Additional user header to be used  
00014 /-----------------------------------------------------------------------------*/
00015 /* Replace 'stm32xxx' with the STM32 Serie used, ex: stm32f4xx_hal.h */
00016 #include "stm32xxx_hal.h" 
00017 
00018 /* If uSD is used, then include the uSD BSP header file. 
00019    Replace 'stm32xxx' with your EVAL board name, ex: stm324x9i_eval_sd.h 
00020    */
00021 #include "stm32xxx_eval_sd.h"
00022 
00023 /* If USB Host MSC is used, then need to include the USBH and UBSH MSC core header files */
00024 #include "usbh_core.h"
00025 #include "usbh_msc.h"
00026 /* hUSBH to be updated with the USBH handle defined in the application code */
00027 #define  HOST_HANDLE   hUSBH 
00028 
00029 /*-----------------------------------------------------------------------------/
00030 / Functions and Buffer Configurations
00031 /-----------------------------------------------------------------------------*/
00032 
00033 #define _FS_TINY             0      /* 0:Normal or 1:Tiny */
00034 /* When _FS_TINY is set to 1, FatFs uses the sector buffer in the file system
00035 /  object instead of the sector buffer in the individual file object for file
00036 /  data transfer. This reduces memory consumption 512 bytes each file object. */
00037 
00038 
00039 #define _FS_READONLY         0      /* 0:Read/Write or 1:Read only */
00040 /* Setting _FS_READONLY to 1 defines read only configuration. This removes
00041 /  writing functions, f_write, f_sync, f_unlink, f_mkdir, f_chmod, f_rename,
00042 /  f_truncate and useless f_getfree. */
00043 
00044 
00045 #define _FS_MINIMIZE         0      /* 0 to 3 */
00046 /* The _FS_MINIMIZE option defines minimization level to remove some functions.
00047 /
00048 /   0: Full function.
00049 /   1: f_stat, f_getfree, f_unlink, f_mkdir, f_chmod, f_truncate, f_utime 
00050 /      and f_rename are removed.
00051 /   2: f_opendir and f_readdir are removed in addition to 1.
00052 /   3: f_lseek is removed in addition to 2. */
00053 
00054 
00055 #define _USE_STRFUNC         2      /* 0:Disable or 1-2:Enable */
00056 /* To enable string functions, set _USE_STRFUNC to 1 or 2. */
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 /*-----------------------------------------------------------------------------/
00076 / Local and Namespace Configurations
00077 /-----------------------------------------------------------------------------*/
00078 
00079 #define _CODE_PAGE         1252
00080 /* The _CODE_PAGE specifies the OEM code page to be used on the target system.
00081 /  Incorrect setting of the code page can cause a file open failure.
00082 /
00083 /   932  - Japanese Shift-JIS (DBCS, OEM, Windows)
00084 /   936  - Simplified Chinese GBK (DBCS, OEM, Windows)
00085 /   949  - Korean (DBCS, OEM, Windows)
00086 /   950  - Traditional Chinese Big5 (DBCS, OEM, Windows)
00087 /   1250 - Central Europe (Windows)
00088 /   1251 - Cyrillic (Windows)
00089 /   1252 - Latin 1 (Windows)
00090 /   1253 - Greek (Windows)
00091 /   1254 - Turkish (Windows)
00092 /   1255 - Hebrew (Windows)
00093 /   1256 - Arabic (Windows)
00094 /   1257 - Baltic (Windows)
00095 /   1258 - Vietnam (OEM, Windows)
00096 /   437  - U.S. (OEM)
00097 /   720  - Arabic (OEM)
00098 /   737  - Greek (OEM)
00099 /   775  - Baltic (OEM)
00100 /   850  - Multilingual Latin 1 (OEM)
00101 /   858  - Multilingual Latin 1 + Euro (OEM)
00102 /   852  - Latin 2 (OEM)
00103 /   855  - Cyrillic (OEM)
00104 /   866  - Russian (OEM)
00105 /   857  - Turkish (OEM)
00106 /   862  - Hebrew (OEM)
00107 /   874  - Thai (OEM, Windows)
00108 / 1    - ASCII only (Valid for non LFN cfg.)
00109 */
00110 
00111 
00112 #define _USE_LFN     3  /* 0 to 3 */
00113 #define _MAX_LFN     255  /* Maximum LFN length to handle (12 to 255) */
00114 /* The _USE_LFN option switches the LFN feature.
00115 /
00116 /   0: Disable LFN feature. _MAX_LFN has no effect.
00117 /   1: Enable LFN with static working buffer on the BSS. Always NOT reentrant.
00118 /   2: Enable LFN with dynamic working buffer on the STACK.
00119 /   3: Enable LFN with dynamic working buffer on the HEAP.
00120 /
00121 /  To enable LFN feature, Unicode handling functions ff_convert() and ff_wtoupper()
00122 /  function must be added to the project.
00123 /  The LFN working buffer occupies (_MAX_LFN + 1) * 2 bytes. When use stack for the
00124 /  working buffer, take care on stack overflow. When use heap memory for the working
00125 /  buffer, memory management functions, ff_memalloc() and ff_memfree(), must be added
00126 /  to the project. */
00127 
00128 
00129 #define _LFN_UNICODE    0 /* 0:ANSI/OEM or 1:Unicode */
00130 /* To switch the character encoding on the FatFs API to Unicode, enable LFN feature
00131 /  and set _LFN_UNICODE to 1. */
00132 
00133 
00134 #define _STRF_ENCODE    3 /* 0:ANSI/OEM, 1:UTF-16LE, 2:UTF-16BE, 3:UTF-8 */
00135 /* When Unicode API is enabled, character encoding on the all FatFs API is switched
00136 /  to Unicode. This option selects the character encoding on the file to be read/written
00137 /  via string functions, f_gets(), f_putc(), f_puts and f_printf().
00138 /  This option has no effect when _LFN_UNICODE is 0. */
00139 
00140 
00141 #define _FS_RPATH       0 /* 0 to 2 */
00142 /* The _FS_RPATH option configures relative path feature.
00143 /
00144 /   0: Disable relative path feature and remove related functions.
00145 /   1: Enable relative path. f_chdrive() and f_chdir() function are available.
00146 /   2: f_getcwd() function is available in addition to 1.
00147 /
00148 /  Note that output of the f_readdir() fnction is affected by this option. */
00149 
00150 
00151 /*---------------------------------------------------------------------------/
00152 / Drive/Volume Configurations
00153 /----------------------------------------------------------------------------*/
00154 
00155 #define _VOLUMES    1
00156 /* Number of volumes (logical drives) to be used. */
00157 
00158 
00159 #define _MULTI_PARTITION     0 /* 0:Single partition, 1:Enable multiple partition */
00160 /* When set to 0, each volume is bound to the same physical drive number and
00161 / it can mount only first primaly partition. When it is set to 1, each volume
00162 / is tied to the partitions listed in VolToPart[]. */
00163 
00164 
00165 #define _MAX_SS    512  /* 512, 1024, 2048 or 4096 */
00166 /* Maximum sector size to be handled.
00167 /  Always set 512 for memory card and hard disk but a larger value may be
00168 /  required for on-board flash memory, floppy disk and optical disk.
00169 /  When _MAX_SS is larger than 512, it configures FatFs to variable sector size
00170 /  and GET_SECTOR_SIZE command must be implemented to the disk_ioctl() function. */
00171 
00172 
00173 #define _USE_ERASE     0 /* 0:Disable or 1:Enable */
00174 /* To enable sector erase feature, set _USE_ERASE to 1. Also CTRL_ERASE_SECTOR command
00175 /  should be added to the disk_ioctl() function. */
00176 
00177 
00178 #define _FS_NOFSINFO    0 /* 0 or 1 */
00179 /* If you need to know the correct free space on the FAT32 volume, set this
00180 /  option to 1 and f_getfree() function at first time after volume mount will
00181 /  force a full FAT scan.
00182 /
00183 /  0: Load all informations in the FSINFO if available.
00184 /  1: Do not trust free cluster count in the FSINFO.
00185 */
00186 
00187 
00188 /*---------------------------------------------------------------------------/
00189 / System Configurations
00190 /----------------------------------------------------------------------------*/
00191 
00192 #define _WORD_ACCESS    0 /* 0 or 1 */
00193 /* The _WORD_ACCESS option is an only platform dependent option. It defines
00194 /  which access method is used to the word data on the FAT volume.
00195 /
00196 /   0: Byte-by-byte access. Always compatible with all platforms.
00197 /   1: Word access. Do not choose this unless under both the following conditions.
00198 /
00199 /  * Byte order on the memory is little-endian.
00200 /  * Address miss-aligned word access is always allowed for all instructions.
00201 /
00202 /  If it is the case, _WORD_ACCESS can also be set to 1 to improve performance
00203 /  and reduce code size.
00204 */
00205 
00206 
00207 /* A header file that defines sync object types on the O/S, such as
00208 /  windows.h, ucos_ii.h and semphr.h, must be included prior to ff.h. */
00209 
00210 #define _FS_REENTRANT    1  /* 0:Disable or 1:Enable */
00211 #define _FS_TIMEOUT      1000 /* Timeout period in unit of time ticks */
00212 #define _SYNC_t          osSemaphoreId /* O/S dependent type of sync object. e.g. HANDLE, OS_EVENT*, ID and etc.. */
00213 
00214 /* The _FS_REENTRANT option switches the re-entrancy (thread safe) of the FatFs module.
00215 /
00216 /   0: Disable re-entrancy. _SYNC_t and _FS_TIMEOUT have no effect.
00217 /   1: Enable re-entrancy. Also user provided synchronization handlers,
00218 /      ff_req_grant(), ff_rel_grant(), ff_del_syncobj() and ff_cre_syncobj()
00219 /      function must be added to the project. */
00220 
00221 
00222 #define _FS_LOCK    2      /* 0:Disable or >=1:Enable */
00223 /* To enable file lock control feature, set _FS_LOCK to 1 or greater.
00224    The value defines how many files can be opened simultaneously. */
00225 
00226 
00227 #endif /* _FFCONFIG */
00228