1# Copyright (c) 2016 Intel Corporation
2# Copyright (c) 2020 Nordic Semiconductor ASA
3# SPDX-License-Identifier: Apache-2.0
4
5config FAT_FILESYSTEM_ELM
6	bool "ELM FAT file system support"
7	depends on FILE_SYSTEM
8	select DISK_ACCESS
9	help
10	  Use the ELM FAT File system implementation.
11
12if FAT_FILESYSTEM_ELM
13
14menu "ELM FAT file system settings"
15	visible if FAT_FILESYSTEM_ELM
16
17config FS_FATFS_READ_ONLY
18	bool "Read-only support for all volumes"
19	help
20	  The option excludes write code from ELM FAT file system driver;
21	  when selected, it no longer will be possible to write data on
22	  the FAT FS.
23	  If write support is not needed, enabling this flag will slightly
24	  reduce application size.
25	  This option translates to _FS_READONLY within ELM FAT file system
26	  driver; it enables exclusion, from compilation, of write supporting
27	  code.
28
29config FS_FATFS_MKFS
30	bool
31	help
32	  This option translates to _USE_MKFS within ELM FAT file system
33	  driver; it enables additional code that is required for formatting
34	  volumes to ELM FAT.
35
36config FS_FATFS_MOUNT_MKFS
37	bool "Allow formatting volume when mounting fails"
38	default y
39	select FS_FATFS_MKFS
40	help
41	  This option adds code that allows fs_mount to attempt to format
42	  a volume if no file system is found.
43	  If formatting is not needed, disabling this flag will slightly
44	  reduce application size.
45
46config FS_FATFS_EXFAT
47	bool "Enable exFAT support"
48	select FS_FATFS_LFN
49	help
50	  Enable the exFAT format support for FatFs.
51
52config FS_FATFS_NUM_FILES
53	int "Maximum number of opened files"
54	default 4
55
56config FS_FATFS_NUM_DIRS
57	int "Maximum number of opened directories"
58	default 4
59
60config FS_FATFS_LFN
61	bool "Enable long filenames (LFN)"
62	help
63	  Without long filenames enabled, file names are limited to 8.3 format.
64	  This option increases working buffer size.
65
66if FS_FATFS_LFN
67
68choice
69	prompt "LFN memory mode"
70	default FS_FATFS_LFN_MODE_BSS
71
72config FS_FATFS_LFN_MODE_BSS
73	bool "Static buffer"
74	help
75	  Enable LFN with static working buffer on the BSS. Always NOT thread-safe.
76
77config FS_FATFS_LFN_MODE_STACK
78	bool "Stack buffer"
79	help
80	  Enable LFN with dynamic working buffer on the STACK.
81
82config FS_FATFS_LFN_MODE_HEAP
83	bool "Heap buffer"
84	help
85	  Enable LFN with dynamic working buffer on the HEAP.
86
87endchoice
88
89config FS_FATFS_MAX_LFN
90	int "Max filename length"
91	range 12 255
92	default 255
93	help
94	  The working buffer occupies (FS_FATFS_MAX_LFN + 1) * 2 bytes and
95	  additional 608 bytes at exFAT enabled.
96	  It should be set 255 to support full featured LFN operations.
97
98endif # FS_FATFS_LFN
99
100config FS_FATFS_CODEPAGE
101	int "FatFS code page (character set)"
102	default 437
103	help
104	  Valid code page values:
105	  437 - U.S.
106	  720 - Arabic
107	  737 - Greek
108	  771 - KBL
109	  775 - Baltic
110	  850 - Latin 1
111	  852 - Latin 2
112	  855 - Cyrillic
113	  857 - Turkish
114	  860 - Portuguese
115	  861 - Icelandic
116	  862 - Hebrew
117	  863 - Canadian French
118	  864 - Arabic
119	  865 - Nordic
120	  866 - Russian
121	  869 - Greek 2
122	  932 - Japanese (DBCS)
123	  936 - Simplified Chinese (DBCS)
124	  949 - Korean (DBCS)
125	  950 - Traditional Chinese (DBCS)
126
127config FS_FATFS_MAX_SS
128	int "Maximum supported sector size"
129	range 512 4096
130	default 512
131
132endmenu
133
134endif # FAT_FILESYSTEM_ELM
135