ffconf.h 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. /*---------------------------------------------------------------------------/
  2. / FatFs - FAT file system module configuration file R0.10b (C)ChaN, 2014
  3. /----------------------------------------------------------------------------/
  4. /
  5. / CAUTION! Do not forget to make clean the project after any changes to
  6. / the configuration options.
  7. /
  8. /----------------------------------------------------------------------------*/
  9. #ifndef _FFCONF
  10. #define _FFCONF 32020 /* Revision ID */
  11. /*-----------------------------------------------------------------------------/
  12. / Additional user header to be used
  13. /-----------------------------------------------------------------------------*/
  14. #include "stm32f2xx_hal.h"
  15. /*-----------------------------------------------------------------------------/
  16. / Functions and Buffer Configurations
  17. /-----------------------------------------------------------------------------*/
  18. #define _FS_TINY 0 /* 0:Normal or 1:Tiny */
  19. /* When _FS_TINY is set to 1, FatFs uses the sector buffer in the file system
  20. / object instead of the sector buffer in the individual file object for file
  21. / data transfer. This reduces memory consumption 512 bytes each file object. */
  22. #define _FS_READONLY 0 /* 0:Read/Write or 1:Read only */
  23. /* Setting _FS_READONLY to 1 defines read only configuration. This removes
  24. / writing functions, f_write, f_sync, f_unlink, f_mkdir, f_chmod, f_rename,
  25. / f_truncate and useless f_getfree. */
  26. #define _FS_MINIMIZE 0 /* 0 to 3 */
  27. /* The _FS_MINIMIZE option defines minimization level to remove some functions.
  28. /
  29. / 0: Full function.
  30. / 1: f_stat, f_getfree, f_unlink, f_mkdir, f_chmod, f_truncate, f_utime
  31. / and f_rename are removed.
  32. / 2: f_opendir and f_readdir are removed in addition to 1.
  33. / 3: f_lseek is removed in addition to 2. */
  34. #define _USE_STRFUNC 0 /* 0:Disable or 1-2:Enable */
  35. /* To enable string functions, set _USE_STRFUNC to 1 or 2. */
  36. #define _USE_MKFS 1 /* 0:Disable or 1:Enable */
  37. /* To enable f_mkfs function, set _USE_MKFS to 1 and set _FS_READONLY to 0 */
  38. #define _USE_FASTSEEK 0 /* 0:Disable or 1:Enable */
  39. /* To enable fast seek feature, set _USE_FASTSEEK to 1. */
  40. #define _USE_LABEL 0 /* 0:Disable or 1:Enable */
  41. /* To enable volume label functions, set _USE_LAVEL to 1 */
  42. #define _USE_FORWARD 0 /* 0:Disable or 1:Enable */
  43. /* To enable f_forward function, set _USE_FORWARD to 1 and set _FS_TINY to 1. */
  44. /*-----------------------------------------------------------------------------/
  45. / Local and Namespace Configurations
  46. /-----------------------------------------------------------------------------*/
  47. #define _CODE_PAGE 936
  48. /* The _CODE_PAGE specifies the OEM code page to be used on the target system.
  49. / Incorrect setting of the code page can cause a file open failure.
  50. /
  51. / 932 - Japanese Shift-JIS (DBCS, OEM, Windows)
  52. / 936 - Simplified Chinese GBK (DBCS, OEM, Windows)
  53. / 949 - Korean (DBCS, OEM, Windows)
  54. / 950 - Traditional Chinese Big5 (DBCS, OEM, Windows)
  55. / 1250 - Central Europe (Windows)
  56. / 1251 - Cyrillic (Windows)
  57. / 1252 - Latin 1 (Windows)
  58. / 1253 - Greek (Windows)
  59. / 1254 - Turkish (Windows)
  60. / 1255 - Hebrew (Windows)
  61. / 1256 - Arabic (Windows)
  62. / 1257 - Baltic (Windows)
  63. / 1258 - Vietnam (OEM, Windows)
  64. / 437 - U.S. (OEM)
  65. / 720 - Arabic (OEM)
  66. / 737 - Greek (OEM)
  67. / 775 - Baltic (OEM)
  68. / 850 - Multilingual Latin 1 (OEM)
  69. / 858 - Multilingual Latin 1 + Euro (OEM)
  70. / 852 - Latin 2 (OEM)
  71. / 855 - Cyrillic (OEM)
  72. / 866 - Russian (OEM)
  73. / 857 - Turkish (OEM)
  74. / 862 - Hebrew (OEM)
  75. / 874 - Thai (OEM, Windows)
  76. / 1 - ASCII only (Valid for non LFN cfg.)
  77. */
  78. #define _USE_LFN 2 /* 0 to 3 *//*【由0 修改 2,支持长文件名,使用堆栈保存】*/
  79. #define _MAX_LFN 255 /* Maximum LFN length to handle (12 to 255) */
  80. /* The _USE_LFN option switches the LFN feature.
  81. /
  82. / 0: Disable LFN feature. _MAX_LFN has no effect.
  83. / 1: Enable LFN with static working buffer on the BSS. Always NOT reentrant.
  84. / 2: Enable LFN with dynamic working buffer on the STACK.
  85. / 3: Enable LFN with dynamic working buffer on the HEAP.
  86. /
  87. / To enable LFN feature, Unicode handling functions ff_convert() and ff_wtoupper()
  88. / function must be added to the project.
  89. / The LFN working buffer occupies (_MAX_LFN + 1) * 2 bytes. When use stack for the
  90. / working buffer, take care on stack overflow. When use heap memory for the working
  91. / buffer, memory management functions, ff_memalloc() and ff_memfree(), must be added
  92. / to the project. */
  93. #define _LFN_UNICODE 0 /* 0:ANSI/OEM or 1:Unicode */
  94. /* To switch the character encoding on the FatFs API to Unicode, enable LFN feature
  95. / and set _LFN_UNICODE to 1. */
  96. #define _STRF_ENCODE 3 /* 0:ANSI/OEM, 1:UTF-16LE, 2:UTF-16BE, 3:UTF-8 */
  97. /* When Unicode API is enabled, character encoding on the all FatFs API is switched
  98. / to Unicode. This option selects the character encoding on the file to be read/written
  99. / via string functions, f_gets(), f_putc(), f_puts and f_printf().
  100. / This option has no effect when _LFN_UNICODE is 0. */
  101. #define _FS_RPATH 0 /* 0 to 2 */
  102. /* The _FS_RPATH option configures relative path feature.
  103. /
  104. / 0: Disable relative path feature and remove related functions.
  105. / 1: Enable relative path. f_chdrive() and f_chdir() function are available.
  106. / 2: f_getcwd() function is available in addition to 1.
  107. /
  108. / Note that output of the f_readdir() fnction is affected by this option. */
  109. /*---------------------------------------------------------------------------/
  110. / Drive/Volume Configurations
  111. /----------------------------------------------------------------------------*/
  112. #define _VOLUMES 1
  113. /* Number of volumes (logical drives) to be used. */
  114. #define _MULTI_PARTITION 0 /* 0:Single partition, 1:Enable multiple partition */
  115. /* When set to 0, each volume is bound to the same physical drive number and
  116. / it can mount only first primaly partition. When it is set to 1, each volume
  117. / is tied to the partitions listed in VolToPart[]. */
  118. #define _MIN_SS 512
  119. #define _MAX_SS 512
  120. /* These options configure the range of sector size to be supported. (512, 1024, 2048 or
  121. / 4096) Always set both 512 for most systems, all memory card and harddisk. But a larger
  122. / value may be required for on-board flash memory and some type of optical media.
  123. / When _MAX_SS is larger than _MIN_SS, FatFs is configured to variable sector size and
  124. / GET_SECTOR_SIZE command must be implemented to the disk_ioctl() function. */
  125. #define _USE_ERASE 0 /* 0:Disable or 1:Enable */
  126. /* To enable sector erase feature, set _USE_ERASE to 1. Also CTRL_ERASE_SECTOR command
  127. / should be added to the disk_ioctl() function. */
  128. #define _FS_NOFSINFO 0 /* 0 or 1 */
  129. /* If you need to know the correct free space on the FAT32 volume, set this
  130. / option to 1 and f_getfree() function at first time after volume mount will
  131. / force a full FAT scan.
  132. /
  133. / 0: Load all informations in the FSINFO if available.
  134. / 1: Do not trust free cluster count in the FSINFO.
  135. */
  136. /*---------------------------------------------------------------------------/
  137. / System Configurations
  138. /----------------------------------------------------------------------------*/
  139. #define _WORD_ACCESS 0 /* 0 or 1 */
  140. /* The _WORD_ACCESS option is an only platform dependent option. It defines
  141. / which access method is used to the word data on the FAT volume.
  142. /
  143. / 0: Byte-by-byte access. Always compatible with all platforms.
  144. / 1: Word access. Do not choose this unless under both the following conditions.
  145. /
  146. / * Byte order on the memory is little-endian.
  147. / * Address miss-aligned word access is always allowed for all instructions.
  148. /
  149. / If it is the case, _WORD_ACCESS can also be set to 1 to improve performance
  150. / and reduce code size.
  151. */
  152. /* A header file that defines sync object types on the O/S, such as
  153. / windows.h, ucos_ii.h and semphr.h, must be included prior to ff.h. */
  154. #define _FS_REENTRANT 0 /* 0:Disable or 1:Enable */
  155. #define _FS_TIMEOUT 1000 /* Timeout period in unit of time ticks */
  156. #define _SYNC_t 0 /* O/S dependent type of sync object. e.g. HANDLE, OS_EVENT*, ID and etc.. */
  157. /* The _FS_REENTRANT option switches the re-entrancy (thread safe) of the FatFs module.
  158. /
  159. / 0: Disable re-entrancy. _SYNC_t and _FS_TIMEOUT have no effect.
  160. / 1: Enable re-entrancy. Also user provided synchronization handlers,
  161. / ff_req_grant(), ff_rel_grant(), ff_del_syncobj() and ff_cre_syncobj()
  162. / function must be added to the project. */
  163. #define _FS_LOCK 2 /* 0:Disable or >=1:Enable */
  164. /* To enable file lock control feature, set _FS_LOCK to 1 or greater.
  165. The value defines how many files can be opened simultaneously. */
  166. #endif /* _FFCONFIG */