Contiki-NG
|
Default port of FatFs on RE-Mote. More...
Files | |
file | diskio.c |
Implementation of the default port of FatFs on RE-Mote. | |
file | ffconf.h |
Header file configuring FatFs for RE-Mote. | |
Macros | |
#define | _FFCONF 68020 |
Revision ID. | |
Function Configuration | |
#define | _FS_READONLY 0 |
This option switches the read-only configuration (0 : read/write or 1 : read-only). More... | |
#define | _FS_MINIMIZE 0 |
This option defines the minimization level to remove some basic API functions. More... | |
#define | _USE_STRFUNC 1 |
This option switches the string functions: f_gets() , f_putc() , f_puts() , and f_printf() . More... | |
#define | _USE_FIND 1 |
This option switches the filtered directory read functions: f_findfirst() and f_findnext() (0 : disable, 1 : enable, 2 : enable with matching altname [] too). | |
#define | _USE_MKFS 1 |
This option switches the f_mkfs() function (0 : disable or 1 : enable). | |
#define | _USE_FASTSEEK 0 |
This option switches the fast seek function (0 : disable or 1 : enable). | |
#define | _USE_EXPAND 0 |
This option switches the f_expand() function (0 : disable or 1 : enable). | |
#define | _USE_CHMOD 1 |
This option switches the attribute manipulation functions: f_chmod() and f_utime() (0 : disable or 1 : enable). More... | |
#define | _USE_LABEL 1 |
This option switches the volume label functions: f_getlabel() and f_setlabel() (0 : disable or 1 : enable). | |
#define | _USE_FORWARD 0 |
This option switches the f_forward() function (0 : disable or 1 : enable). | |
Locale and Namespace Configuration | |
#define | _CODE_PAGE 437 |
This option specifies the OEM code page to be used on the target system. More... | |
#define | _USE_LFN 3 |
_USE_LFN switches the support of long file name (LFN). More... | |
#define | _MAX_LFN 255 |
#define | _LFN_UNICODE 0 |
This option switches the character encoding in the API (0 : ANSI/OEM or 1 : UTF-16). More... | |
#define | _STRF_ENCODE 0 |
If _LFN_UNICODE is set to 1 , this option selects the character encoding OF THE FILE to be read/written via the string I/O functions: f_gets() , f_putc() , f_puts() , and f_printf() . More... | |
#define | _FS_RPATH 2 |
This option configures the support of relative path. More... | |
Drive/Volume Configuration | |
#define | _VOLUMES 1 |
Number of volumes (logical drives) to be used. | |
#define | _STR_VOLUME_ID 0 |
_STR_VOLUME_ID switches the string support of volume ID. More... | |
#define | _VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3" |
#define | _MULTI_PARTITION 0 |
This option switches support of multi-partition on a physical drive. More... | |
#define | _MIN_SS 512 |
These options configure the range of sector size to be supported (512, 1024, 2048, or 4096). More... | |
#define | _MAX_SS 512 |
#define | _USE_TRIM 0 |
This option switches the support of ATA-TRIM (0 : disable or 1 : enable). More... | |
#define | _FS_NOFSINFO 3 |
If you need to know the correct free space on the FAT32 volume, set the bit 0 of this option, and the f_getfree() function will force a full FAT scan on the first time after a volume mount. More... | |
System Configuration | |
#define | _FS_TINY 0 |
This option switches the tiny buffer configuration (0 : normal or 1 : tiny). More... | |
#define | _FS_EXFAT 1 |
This option switches the support of the exFAT file system (0 : disable or 1 : enable). More... | |
#define | _FS_NORTC (!RTC_CONF_INIT) |
The option _FS_NORTC switches the timestamp function. More... | |
#define | _NORTC_MON 1 |
#define | _NORTC_MDAY 1 |
#define | _NORTC_YEAR 2016 |
#define | _FS_LOCK 0 |
The option _FS_LOCK switches the file lock function controlling duplicate file open and illegal operations on the open objects. More... | |
#define | _FS_REENTRANT 0 |
The option _FS_REENTRANT switches the re-entrancy (thread-safe) of the FatFs module itself. More... | |
#define | _FS_TIMEOUT 1000 |
#define | _SYNC_t HANDLE |
Default port of FatFs on RE-Mote.
#define _CODE_PAGE 437 |
This option specifies the OEM code page to be used on the target system.
Incorrect setting of the code page can cause a file open failure.
1
- ASCII (no extended character, non-LFN cfg. only) 437
- U.S. 720
- Arabic 737
- Greek 771
- KBL 775
- Baltic 850
- Latin 1 852
- Latin 2 855
- Cyrillic 857
- Turkish 860
- Portuguese 861
- Icelandic 862
- Hebrew 863
- Canadian French 864
- Arabic 865
- Nordic 866
- Russian 869
- Greek 2 932
- Japanese (DBCS) 936
- Simplified Chinese (DBCS) 949
- Korean (DBCS) 950
- Traditional Chinese (DBCS)
#define _FS_EXFAT 1 |
#define _FS_LOCK 0 |
The option _FS_LOCK
switches the file lock function controlling duplicate file open and illegal operations on the open objects.
This option must be set to 0
if _FS_READONLY
is 1
.
0
: Disable the file lock function. To avoid volume corruption, the application program should avoid illegal open, remove, and rename on the open objects. >0
: Enable the file lock function. The value defines how many files/sub-directories can be opened simultaneously under file lock control. Note that the file lock control is independent of re-entrancy.
#define _FS_MINIMIZE 0 |
This option defines the minimization level to remove some basic API functions.
0
: All the basic functions are enabled. 1
: f_stat()
, f_getfree()
, f_unlink()
, f_mkdir()
, f_truncate()
, and f_rename()
are removed. 2
: f_opendir()
, f_readdir()
, and f_closedir()
are removed in addition to 1
. 3
: f_lseek()
is removed in addition to 2
.
#define _FS_NOFSINFO 3 |
If you need to know the correct free space on the FAT32 volume, set the bit 0 of this option, and the f_getfree()
function will force a full FAT scan on the first time after a volume mount.
The bit 1 controls the use of the last allocated cluster number.
bit 0=0: Use the free cluster count in FSINFO if available. bit 0=1: Do not trust the free cluster count in FSINFO. bit 1=0: Use the last allocated cluster number in FSINFO if available. bit 1=1: Do not trust the last allocated cluster number in FSINFO.
#define _FS_NORTC (!RTC_CONF_INIT) |
The option _FS_NORTC
switches the timestamp function.
If the system does not have any RTC function or if a valid timestamp is not needed, set _FS_NORTC
to 1
to disable the timestamp function. All the objects modified by FatFs will have a fixed timestamp defined by _NORTC_MON
, _NORTC_MDAY
, and _NORTC_YEAR
in local time. To enable the timestamp function (_FS_NORTC
set to 0
), get_fattime()
needs to be added to the project to get the current time from a real-time clock. _NORTC_MON
, _NORTC_MDAY
, and _NORTC_YEAR
have no effect. These options have no effect with a read-only configuration (_FS_READONLY
set to 1
).
#define _FS_READONLY 0 |
This option switches the read-only configuration (0
: read/write or 1
: read-only).
The read-only configuration removes the writing functions from the API: f_write()
, f_sync()
, f_unlink()
, f_mkdir()
, f_chmod()
, f_rename()
, f_truncate()
, f_getfree()
, and optional writing functions as well.
#define _FS_REENTRANT 0 |
The option _FS_REENTRANT
switches the re-entrancy (thread-safe) of the FatFs module itself.
Note that, regardless of this option, file access to different volumes is always re-entrant, and the volume control functions, f_mount()
, f_mkfs()
, and f_fdisk()
, are always non-re-entrant. Only file/directory access to the same volume is under control of this function.
0
: Disable re-entrancy. _FS_TIMEOUT
and _SYNC_t
have no effect. 1
: Enable re-entrancy. The user-provided synchronization handlers, ff_req_grant()
, ff_rel_grant()
, ff_del_syncobj()
, and ff_cre_syncobj()
, must also be added to the project. Samples are available in option/syscall.c
.
_FS_TIMEOUT
defines the timeout period in unit of time tick. _SYNC_t
defines the OS-dependent sync object type, e.g. HANDLE
, ID
, OS_EVENT*
, SemaphoreHandle_t
, etc. A header file for the OS definitions needs to be included somewhere in the scope of ff.h
.
#define _FS_RPATH 2 |
#define _FS_TINY 0 |
This option switches the tiny buffer configuration (0
: normal or 1
: tiny).
With the tiny configuration, the size of a file object (FIL) is reduced to _MAX_SS
bytes. Instead of the private sector buffer eliminated from the file object, a common sector buffer in the file system object (FATFS) is used for the file data transfer.
#define _LFN_UNICODE 0 |
#define _MIN_SS 512 |
These options configure the range of sector size to be supported (512, 1024, 2048, or 4096).
Always set both to 512 for most systems, all types of memory cards and harddisk. But a larger value may be required for on-board flash memory and some types of optical media. When _MAX_SS
is larger than _MIN_SS
, FatFs is configured to variable sector size and the GET_SECTOR_SIZE
command must be implemented in disk_ioctl()
.
#define _MULTI_PARTITION 0 |
This option switches support of multi-partition on a physical drive.
By default (0), each logical drive number is bound to the same physical drive number and only an FAT volume found on the physical drive will be mounted. When multi-partition is enabled (1), each logical drive number can be bound to arbitrary physical drive and partition listed in the VolToPart[]. Also f_fdisk() funciton will be available.
#define _STR_VOLUME_ID 0 |
_STR_VOLUME_ID
switches the string support of volume ID.
If _STR_VOLUME_ID
is set to 1
, pre-defined strings can also be used as drive number in the path name. _VOLUME_STRS
defines the drive ID strings for each logical drive. The number of items must be equal to _VOLUMES
. The valid characters for the drive ID strings are: A-Z and 0-9.
#define _STRF_ENCODE 0 |
If _LFN_UNICODE
is set to 1
, this option selects the character encoding OF THE FILE to be read/written via the string I/O functions: f_gets()
, f_putc()
, f_puts()
, and f_printf()
.
0
: ANSI/OEM 1
: UTF-16LE 2
: UTF-16BE 3
: UTF-8
This option has no effect if _LFN_UNICODE
is set to 0
.
#define _USE_CHMOD 1 |
#define _USE_LFN 3 |
_USE_LFN
switches the support of long file name (LFN).
0
: Disable LFN support. _MAX_LFN
has no effect. 1
: Enable LFN with static working buffer on the BSS. Always thread-unsafe. 2
: Enable LFN with dynamic working buffer on the STACK. 3
: Enable LFN with dynamic working buffer on the HEAP.
To enable LFN, the Unicode handling functions (option/unicode.c
) must be added to the project. The working buffer occupies (_MAX_LFN + 1) * 2
bytes, and 608 more bytes with exFAT enabled. _MAX_LFN
can be in the range from 12 to 255. It should be set to 255 to support the full-featured LFN operations. When using the stack for the working buffer, take care of stack overflow. When using the heap memory for the working buffer, the memory management functions, ff_memalloc()
and ff_memfree()
, must be added to the project.
#define _USE_STRFUNC 1 |