1menu "FAT Filesystem support"
2
3    choice FATFS_CHOOSE_CODEPAGE
4        prompt "OEM Code Page"
5        default FATFS_CODEPAGE_437
6        help
7            OEM code page used for file name encodings.
8
9            If "Dynamic" is selected, code page can be chosen at runtime using
10            f_setcp function. Note that choosing this option will increase
11            application size by ~480kB.
12
13        config FATFS_CODEPAGE_DYNAMIC
14            bool "Dynamic (all code pages supported)"
15        config FATFS_CODEPAGE_437
16            bool "US (CP437)"
17        config FATFS_CODEPAGE_720
18            bool "Arabic (CP720)"
19        config FATFS_CODEPAGE_737
20            bool "Greek (CP737)"
21        config FATFS_CODEPAGE_771
22            bool "KBL (CP771)"
23        config FATFS_CODEPAGE_775
24            bool "Baltic (CP775)"
25        config FATFS_CODEPAGE_850
26            bool "Latin 1 (CP850)"
27        config FATFS_CODEPAGE_852
28            bool "Latin 2 (CP852)"
29        config FATFS_CODEPAGE_855
30            bool "Cyrillic (CP855)"
31        config FATFS_CODEPAGE_857
32            bool "Turkish (CP857)"
33        config FATFS_CODEPAGE_860
34            bool "Portugese (CP860)"
35        config FATFS_CODEPAGE_861
36            bool "Icelandic (CP861)"
37        config FATFS_CODEPAGE_862
38            bool "Hebrew (CP862)"
39        config FATFS_CODEPAGE_863
40            bool "Canadian French (CP863)"
41        config FATFS_CODEPAGE_864
42            bool "Arabic (CP864)"
43        config FATFS_CODEPAGE_865
44            bool "Nordic (CP865)"
45        config FATFS_CODEPAGE_866
46            bool "Russian (CP866)"
47        config FATFS_CODEPAGE_869
48            bool "Greek 2 (CP869)"
49        config FATFS_CODEPAGE_932
50            bool "Japanese (DBCS) (CP932)"
51        config FATFS_CODEPAGE_936
52            bool "Simplified Chinese (DBCS) (CP936)"
53        config FATFS_CODEPAGE_949
54            bool "Korean (DBCS) (CP949)"
55        config FATFS_CODEPAGE_950
56            bool "Traditional Chinese (DBCS) (CP950)"
57
58    endchoice
59
60    config FATFS_CODEPAGE
61        int
62        default 0 if FATFS_CODEPAGE_DYNAMIC
63        default 437 if FATFS_CODEPAGE_437
64        default 720 if FATFS_CODEPAGE_720
65        default 737 if FATFS_CODEPAGE_737
66        default 771 if FATFS_CODEPAGE_771
67        default 775 if FATFS_CODEPAGE_775
68        default 850 if FATFS_CODEPAGE_850
69        default 852 if FATFS_CODEPAGE_852
70        default 855 if FATFS_CODEPAGE_855
71        default 857 if FATFS_CODEPAGE_857
72        default 860 if FATFS_CODEPAGE_860
73        default 861 if FATFS_CODEPAGE_861
74        default 862 if FATFS_CODEPAGE_862
75        default 863 if FATFS_CODEPAGE_863
76        default 864 if FATFS_CODEPAGE_864
77        default 865 if FATFS_CODEPAGE_865
78        default 866 if FATFS_CODEPAGE_866
79        default 869 if FATFS_CODEPAGE_869
80        default 932 if FATFS_CODEPAGE_932
81        default 936 if FATFS_CODEPAGE_936
82        default 949 if FATFS_CODEPAGE_949
83        default 950 if FATFS_CODEPAGE_950
84        default 437
85
86    choice FATFS_LONG_FILENAMES
87        prompt "Long filename support"
88        default FATFS_LFN_NONE
89        help
90            Support long filenames in FAT. Long filename data increases
91            memory usage. FATFS can be configured to store the buffer for
92            long filename data in stack or heap.
93
94        config FATFS_LFN_NONE
95            bool "No long filenames"
96        config FATFS_LFN_HEAP
97            bool "Long filename buffer in heap"
98        config FATFS_LFN_STACK
99            bool "Long filename buffer on stack"
100    endchoice
101
102    config FATFS_MAX_LFN
103        int "Max long filename length"
104        depends on !FATFS_LFN_NONE
105        default 255
106        range 12 255
107        help
108            Maximum long filename length. Can be reduced to save RAM.
109
110    choice FATFS_API_ENCODING
111        prompt "API character encoding"
112        depends on !FATFS_LFN_NONE
113        default FATFS_API_ENCODING_ANSI_OEM
114        help
115            Choose encoding for character and string arguments/returns when using
116            FATFS APIs. The encoding of arguments will usually depend on text
117            editor settings.
118
119        config FATFS_API_ENCODING_ANSI_OEM
120            bool "API uses ANSI/OEM encoding"
121        config FATFS_API_ENCODING_UTF_16
122            bool "API uses UTF-16 encoding"
123        config FATFS_API_ENCODING_UTF_8
124            bool "API uses UTF-8 encoding"
125    endchoice
126
127    config FATFS_FS_LOCK
128        int "Number of simultaneously open files protected by lock function"
129        default 0
130        range 0 65535
131        help
132            This option sets the FATFS configuration value _FS_LOCK.
133            The option _FS_LOCK switches file lock function to control duplicated file open
134            and illegal operation to open objects.
135
136            * 0: Disable file lock function. To avoid volume corruption, application
137            should avoid illegal open, remove and rename to the open objects.
138
139            * >0: Enable file lock function. The value defines how many files/sub-directories
140            can be opened simultaneously under file lock control.
141
142            Note that the file lock control is independent of re-entrancy.
143
144    config FATFS_TIMEOUT_MS
145        int "Timeout for acquiring a file lock, ms"
146        default 10000
147        help
148            This option sets FATFS configuration value _FS_TIMEOUT, scaled to milliseconds.
149            Sets the number of milliseconds FATFS will wait to acquire a mutex when
150            operating on an open file. For example, if one task is performing a lenghty
151            operation, another task will wait for the first task to release the lock,
152            and time out after amount of time set by this option.
153
154
155    config FATFS_PER_FILE_CACHE
156        bool "Use separate cache for each file"
157        default y
158        help
159            This option affects FATFS configuration value _FS_TINY.
160
161            If this option is set, _FS_TINY is 0, and each open file has its own cache,
162            size of the cache is equal to the _MAX_SS variable (512 or 4096 bytes).
163            This option uses more RAM if more than 1 file is open, but needs less reads
164            and writes to the storage for some operations.
165
166            If this option is not set, _FS_TINY is 1, and single cache is used for
167            all open files, size is also equal to _MAX_SS variable. This reduces the
168            amount of heap used when multiple files are open, but increases the number
169            of read and write operations which FATFS needs to make.
170
171
172    config FATFS_ALLOC_PREFER_EXTRAM
173        bool "Perfer external RAM when allocating FATFS buffers"
174        default y
175        depends on SPIRAM_USE_CAPS_ALLOC || SPIRAM_USE_MALLOC
176        help
177            When the option is enabled, internal buffers used by FATFS will be allocated
178            from external RAM. If the allocation from external RAM fails, the buffer will
179            be allocated from the internal RAM.
180            Disable this option if optimizing for performance. Enable this option if
181            optimizing for internal memory size.
182
183
184    config FATFS_USE_FASTSEEK
185        bool "Enable fast seek algorithm when using lseek function through VFS FAT"
186        default n
187        help
188            The fast seek feature enables fast backward/long seek operations without
189            FAT access by using an in-memory CLMT (cluster link map table).
190            Please note, fast-seek is only allowed for read-mode files, if a
191            file is opened in write-mode, the seek mechanism will automatically fallback
192            to the default implementation.
193
194
195    config FATFS_FAST_SEEK_BUFFER_SIZE
196        int "Fast seek CLMT buffer size"
197        default 64
198        depends on FATFS_USE_FASTSEEK
199        help
200            If fast seek algorithm is enabled, this defines the size of
201            CLMT buffer used by this algorithm in 32-bit word units.
202            This value should be chosen based on prior knowledge of
203            maximum elements of each file entry would store.
204
205endmenu
206