The official µGFX library repository.

ffconf.h 9.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. /*---------------------------------------------------------------------------/
  2. / FatFs - FAT file system module configuration file R0.10b (C)ChaN, 2014
  3. /---------------------------------------------------------------------------*/
  4. #ifndef _FFCONF
  5. #define _FFCONF 8051 /* Revision ID */
  6. /*---------------------------------------------------------------------------/
  7. / Functions and Buffer Configurations
  8. /---------------------------------------------------------------------------*/
  9. #define _FS_TINY 0 /* 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 0 /* 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 1 /* 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 1252
  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 configuration) */
  69. #define _USE_LFN 3 /* 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 has 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. This option must be 0 when LFN feature is not enabled. */
  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 _LFN_UNICODE == 0. Note that
  92. / FatFs supports only BMP. */
  93. #define _FS_RPATH 0 /* 0 to 2 */
  94. /* The _FS_RPATH option configures relative path feature.
  95. /
  96. / 0: Disable relative path feature and remove related functions.
  97. / 1: Enable relative path. f_chdrive() and f_chdir() function are available.
  98. / 2: f_getcwd() function is available in addition to 1.
  99. /
  100. / Note that output of the f_readdir() fnction is affected by this option. */
  101. /*---------------------------------------------------------------------------/
  102. / Drive/Volume Configurations
  103. /---------------------------------------------------------------------------*/
  104. #define _VOLUMES 1
  105. /* Number of volumes (logical drives) to be used. */
  106. #define _STR_VOLUME_ID 0 /* 0:Use only 0-9 for drive ID, 1:Use strings for drive ID */
  107. #define _VOLUME_STRS "RAM","NAND","CF","SD1","SD2","USB1","USB2","USB3"
  108. /* When _STR_VOLUME_ID is set to 1, also pre-defined strings can be used as drive
  109. / number in the path name. _VOLUME_STRS defines the drive ID strings for each logical
  110. / drives. Number of items must be equal to _VOLUMES. Valid characters for the drive ID
  111. / strings are: 0-9 and A-Z. */
  112. #define _MULTI_PARTITION 0 /* 0:Single partition, 1:Enable multiple partition */
  113. /* By default(0), each logical drive number is bound to the same physical drive number
  114. / and only a FAT volume found on the physical drive is mounted. When it is set to 1,
  115. / each logical drive number is bound to arbitrary drive/partition listed in VolToPart[].
  116. */
  117. #define _MIN_SS 512
  118. #define _MAX_SS 512
  119. /* These options configure the range of sector size to be supported. (512, 1024, 2048 or
  120. / 4096) Always set both 512 for most systems, all memory card and harddisk. But a larger
  121. / value may be required for on-board flash memory and some type of optical media.
  122. / When _MAX_SS is larger than _MIN_SS, FatFs is configured to variable sector size and
  123. / GET_SECTOR_SIZE command must be implemented to the disk_ioctl() function. */
  124. #define _USE_ERASE 0 /* 0:Disable or 1:Enable */
  125. /* To enable sector erase feature, set _USE_ERASE to 1. Also CTRL_ERASE_SECTOR command
  126. / should be added to the disk_ioctl() function. */
  127. #define _FS_NOFSINFO 0 /* 0 to 3 */
  128. /* If you need to know correct free space on the FAT32 volume, set bit 0 of this option
  129. / and f_getfree() function at first time after volume mount will force a full FAT scan.
  130. / Bit 1 controls the last allocated cluster number as bit 0.
  131. /
  132. / bit0=0: Use free cluster count in the FSINFO if available.
  133. / bit0=1: Do not trust free cluster count in the FSINFO.
  134. / bit1=0: Use last allocated cluster number in the FSINFO if available.
  135. / bit1=1: Do not trust last allocated cluster number in the FSINFO.
  136. */
  137. /*---------------------------------------------------------------------------/
  138. / System Configurations
  139. /---------------------------------------------------------------------------*/
  140. #define _FS_LOCK 0 /* 0:Disable or >=1:Enable */
  141. /* To enable file lock control feature, set _FS_LOCK to non-zero value.
  142. / The value defines how many files/sub-directories can be opened simultaneously
  143. / with file lock control. This feature uses bss _FS_LOCK * 12 bytes. */
  144. #define _FS_REENTRANT 0 /* 0:Disable or 1:Enable */
  145. #if _FS_REENTRANT
  146. #include "gfx.h"
  147. #endif
  148. #define _FS_TIMEOUT 1000 /* Timeout period in unit of time tick */
  149. #define _SYNC_t gfxSem /* O/S dependent sync object type. e.g. HANDLE, OS_EVENT*, ID, SemaphoreHandle_t and etc.. */
  150. /* The _FS_REENTRANT option switches the re-entrancy (thread safe) of the FatFs module.
  151. /
  152. / 0: Disable re-entrancy. _FS_TIMEOUT and _SYNC_t have no effect.
  153. / 1: Enable re-entrancy. Also user provided synchronization handlers,
  154. / ff_req_grant(), ff_rel_grant(), ff_del_syncobj() and ff_cre_syncobj()
  155. / function must be added to the project.
  156. */
  157. #define _WORD_ACCESS 0 /* 0 or 1 */
  158. /* The _WORD_ACCESS option is an only platform dependent option. It defines
  159. / which access method is used to the word data on the FAT volume.
  160. /
  161. / 0: Byte-by-byte access. Always compatible with all platforms.
  162. / 1: Word access. Do not choose this unless under both the following conditions.
  163. /
  164. / * Address misaligned memory access is always allowed for ALL instructions.
  165. / * Byte order on the memory is little-endian.
  166. /
  167. / If it is the case, _WORD_ACCESS can also be set to 1 to improve performance and
  168. / reduce code size. Following table shows an example of some processor types.
  169. /
  170. / ARM7TDMI 0 ColdFire 0 V850E 0
  171. / Cortex-M3 0 Z80 0/1 V850ES 0/1
  172. / Cortex-M0 0 RX600(LE) 0/1 TLCS-870 0/1
  173. / AVR 0/1 RX600(BE) 0 TLCS-900 0/1
  174. / AVR32 0 RL78 0 R32C 0
  175. / PIC18 0/1 SH-2 0 M16C 0/1
  176. / PIC24 0 H8S 0 MSP430 0
  177. / PIC32 0 H8/300H 0 x86 0/1
  178. */
  179. #endif /* _FFCONF */