1
0

ffconf.h 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. /*---------------------------------------------------------------------------/
  2. / FatFs - FAT file system module configuration file R0.10a (C)ChaN, 2014
  3. /---------------------------------------------------------------------------*/
  4. #ifndef _FFCONF
  5. #define _FFCONF 29000 /* Revision ID */
  6. /*---------------------------------------------------------------------------/
  7. / Functions and Buffer Configurations
  8. /---------------------------------------------------------------------------*/
  9. #define _FS_TINY 1 /* 0:Normal or 1:Tiny */
  10. /* When _FS_TINY is set to 1, it reduces memory consumption _MAX_SS bytes each
  11. / file object. For file data transfer, FatFs uses the common sector buffer in
  12. / the file system object (FATFS) instead of private sector buffer eliminated
  13. / from the file object (FIL). */
  14. #define _FS_READONLY 0 /* 0:Read/Write or 1:Read only */
  15. /* Setting _FS_READONLY to 1 defines read only configuration. This removes
  16. / writing functions, f_write(), f_sync(), f_unlink(), f_mkdir(), f_chmod(),
  17. / f_rename(), f_truncate() and useless f_getfree(). */
  18. #define _FS_MINIMIZE 2 /* 0 to 3 */
  19. /* The _FS_MINIMIZE option defines minimization level to remove API functions.
  20. /
  21. / 0: All basic functions are enabled.
  22. / 1: f_stat(), f_getfree(), f_unlink(), f_mkdir(), f_chmod(), f_utime(),
  23. / f_truncate() and f_rename() function are removed.
  24. / 2: f_opendir(), f_readdir() and f_closedir() are removed in addition to 1.
  25. / 3: f_lseek() function is removed in addition to 2. */
  26. #define _USE_STRFUNC 0 /* 0:Disable or 1-2:Enable */
  27. /* To enable string functions, set _USE_STRFUNC to 1 or 2. */
  28. #define _USE_MKFS 0 /* 0:Disable or 1:Enable */
  29. /* To enable f_mkfs() function, set _USE_MKFS to 1 and set _FS_READONLY to 0 */
  30. #define _USE_FASTSEEK 0 /* 0:Disable or 1:Enable */
  31. /* To enable fast seek feature, set _USE_FASTSEEK to 1. */
  32. #define _USE_LABEL 0 /* 0:Disable or 1:Enable */
  33. /* To enable volume label functions, set _USE_LAVEL to 1 */
  34. #define _USE_FORWARD 0 /* 0:Disable or 1:Enable */
  35. /* To enable f_forward() function, set _USE_FORWARD to 1 and set _FS_TINY to 1. */
  36. /*---------------------------------------------------------------------------/
  37. / Locale and Namespace Configurations
  38. /---------------------------------------------------------------------------*/
  39. #define _CODE_PAGE 932
  40. /* The _CODE_PAGE specifies the OEM code page to be used on the target system.
  41. / Incorrect setting of the code page can cause a file open failure.
  42. /
  43. / 932 - Japanese Shift-JIS (DBCS, OEM, Windows)
  44. / 936 - Simplified Chinese GBK (DBCS, OEM, Windows)
  45. / 949 - Korean (DBCS, OEM, Windows)
  46. / 950 - Traditional Chinese Big5 (DBCS, OEM, Windows)
  47. / 1250 - Central Europe (Windows)
  48. / 1251 - Cyrillic (Windows)
  49. / 1252 - Latin 1 (Windows)
  50. / 1253 - Greek (Windows)
  51. / 1254 - Turkish (Windows)
  52. / 1255 - Hebrew (Windows)
  53. / 1256 - Arabic (Windows)
  54. / 1257 - Baltic (Windows)
  55. / 1258 - Vietnam (OEM, Windows)
  56. / 437 - U.S. (OEM)
  57. / 720 - Arabic (OEM)
  58. / 737 - Greek (OEM)
  59. / 775 - Baltic (OEM)
  60. / 850 - Multilingual Latin 1 (OEM)
  61. / 858 - Multilingual Latin 1 + Euro (OEM)
  62. / 852 - Latin 2 (OEM)
  63. / 855 - Cyrillic (OEM)
  64. / 866 - Russian (OEM)
  65. / 857 - Turkish (OEM)
  66. / 862 - Hebrew (OEM)
  67. / 874 - Thai (OEM, Windows)
  68. / 1 - ASCII (Valid for only non-LFN cfg.) */
  69. #define _USE_LFN 0 /* 0 to 3 */
  70. #define _MAX_LFN 255 /* Maximum LFN length to handle (12 to 255) */
  71. /* The _USE_LFN option switches the LFN feature.
  72. /
  73. / 0: Disable LFN feature. _MAX_LFN and _LFN_UNICODE have no effect.
  74. / 1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe.
  75. / 2: Enable LFN with dynamic working buffer on the STACK.
  76. / 3: Enable LFN with dynamic working buffer on the HEAP.
  77. /
  78. / When enable LFN feature, Unicode handling functions ff_convert() and ff_wtoupper()
  79. / function must be added to the project.
  80. / The LFN working buffer occupies (_MAX_LFN + 1) * 2 bytes. When use stack for the
  81. / working buffer, take care on stack overflow. When use heap memory for the working
  82. / buffer, memory management functions, ff_memalloc() and ff_memfree(), must be added
  83. / to the project. */
  84. #define _LFN_UNICODE 0 /* 0:ANSI/OEM or 1:Unicode */
  85. /* To switch the character encoding on the FatFs API (TCHAR) to Unicode, enable LFN
  86. / feature and set _LFN_UNICODE to 1. This option affects behavior of string I/O
  87. / functions. */
  88. #define _STRF_ENCODE 3 /* 0:ANSI/OEM, 1:UTF-16LE, 2:UTF-16BE, 3:UTF-8 */
  89. /* When Unicode API is enabled by _LFN_UNICODE option, this option selects the character
  90. / encoding on the file to be read/written via string I/O functions, f_gets(), f_putc(),
  91. / f_puts and f_printf(). This option has no effect when Unicode API is not enabled. */
  92. #define _FS_RPATH 0 /* 0 to 2 */
  93. /* The _FS_RPATH option configures relative path feature.
  94. /
  95. / 0: Disable relative path feature and remove related functions.
  96. / 1: Enable relative path. f_chdrive() and f_chdir() function are available.
  97. / 2: f_getcwd() function is available in addition to 1.
  98. /
  99. / Note that output of the f_readdir() fnction is affected by this option. */
  100. /*---------------------------------------------------------------------------/
  101. / Drive/Volume Configurations
  102. /---------------------------------------------------------------------------*/
  103. #define _VOLUMES 1
  104. /* Number of volumes (logical drives) to be used. */
  105. #define _STR_VOLUME_ID 0 /* 0:Use only 0-9 for drive ID, 1:Use strings for drive ID */
  106. #define _VOLUME_STRS "RAM","NAND","CF","SD1","SD2","USB1","USB2","USB3"
  107. /* When _STR_VOLUME_ID is set to 1, also pre-defined string can be used as drive number
  108. / in the path name. _VOLUME_STRS defines the drive ID strings for each logical drives.
  109. / Number of items must be equal to _VOLUMES. Valid characters for the drive ID strings
  110. / are: 0-9 and A-Z. */
  111. #define _MULTI_PARTITION 0 /* 0:Single partition, 1:Enable multiple partition */
  112. /* By default(0), each logical drive number is bound to the same physical drive number
  113. / and only a FAT volume found on the physical drive is mounted. When it is set to 1,
  114. / each logical drive number is bound to arbitrary drive/partition listed in VolToPart[].
  115. */
  116. #define _MIN_SS 512
  117. #define _MAX_SS 512
  118. /* These options configure the sector size to be supported. (512, 1024, 2048 or 4096)
  119. / Always set both 512 for most systems, all memory card and hard disk. But a larger
  120. / value may be required for on-board flash memory and some type of optical media.
  121. / When _MIN_SS != _MAX_SS, FatFs is configured to multiple sector size and
  122. / GET_SECTOR_SIZE command must be implemented to the disk_ioctl() function. */
  123. #define _USE_ERASE 0 /* 0:Disable or 1:Enable */
  124. /* To enable sector erase feature, set _USE_ERASE to 1. Also CTRL_ERASE_SECTOR command
  125. / should be added to the disk_ioctl() function. */
  126. #define _FS_NOFSINFO 0 /* 0 to 3 */
  127. /* If you need to know correct free space on the FAT32 volume, set bit 0 of this
  128. / option and f_getfree() function at first time after volume mount will force
  129. / a full FAT scan. Bit 1 controls the last allocated cluster number as bit 0.
  130. /
  131. / bit0=0: Use free cluster count in the FSINFO if available.
  132. / bit0=1: Do not trust free cluster count in the FSINFO.
  133. / bit1=0: Use last allocated cluster number in the FSINFO if available.
  134. / bit1=1: Do not trust last allocated cluster number in the FSINFO.
  135. */
  136. /*---------------------------------------------------------------------------/
  137. / System Configurations
  138. /---------------------------------------------------------------------------*/
  139. #define _WORD_ACCESS 1 /* 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. / * Address misaligned memory access is always allowed for all instructions.
  147. / * Byte order on the memory is little-endian.
  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. #define _FS_LOCK 0 /* 0:Disable or >=1:Enable */
  153. /* To enable file lock control feature, set _FS_LOCK to 1 or greater.
  154. / The value defines how many files/sub-directories can be opened simultaneously.
  155. / This feature consumes _FS_LOCK * 12 bytes of bss area. */
  156. #define _FS_REENTRANT 0 /* 0:Disable or 1:Enable */
  157. #define _FS_TIMEOUT 1000 /* Timeout period in unit of time ticks */
  158. #define _SYNC_t HANDLE /* O/S dependent sync object type. e.g. HANDLE, OS_EVENT*, ID and etc.. */
  159. /*#include <windows.h>*/
  160. /* A header file that defines sync object types on the O/S, such as windows.h,
  161. / ucos_ii.h and semphr.h, should be included here when enable this option.
  162. / The _FS_REENTRANT option switches the re-entrancy (thread safe) of the FatFs module.
  163. /
  164. / 0: Disable re-entrancy. _FS_TIMEOUT and _SYNC_t have no effect.
  165. / 1: Enable re-entrancy. Also user provided synchronization handlers,
  166. / ff_req_grant(), ff_rel_grant(), ff_del_syncobj() and ff_cre_syncobj()
  167. / function must be added to the project.
  168. */
  169. #endif /* _FFCONFIG */