本帖最后由 wahahaheihei 于 2016-10-10 13:04 编辑
说起来文件系统,我今天给大家介绍个。http://elm-chan.org/fsw/ff/00index_e.html
——————————————————————————-——
FatFs - Generic FAT File System Module
FatFs is a generic FAT/exFAT file system module for small embedded systems. The FatFs module is written in compliance with ANSI C (C89) and completely separated from the disk I/O layer. Therefore it is independent of the platform. It can be incorporated into small microcontrollers with limited resource, such as 8051, PIC, AVR, ARM, Z80, 78K and etc. Also Petit FatFs module for tiny microcontrollers is available here. Features- Windows compatible FAT/exFAT file system.
- Platform independent. Easy to port.
- Very small footprint for program code and work area.
- Various configuration options to support for:
- Multiple volumes (physical drives and partitions).
- Multiple ANSI/OEM code pages including DBCS.
- Long file name in ANSI/OEM or Unicode.
- exFAT file system.
- RTOS envilonment.
- Fixed or variable sector size.
- Read-only, optional API, I/O buffer and etc...
Application Interface
- File Access
- Directory Access
- File/Directory Management
- f_stat - Check existance of a file or sub-directory
- f_unlink - Remove a file or sub-directory
- f_rename - Rename or move a file or sub-directory
- f_chmod - Change attribute of a file or sub-directory
- f_utime - Change timestamp of a file or sub-directory
- f_mkdir - Create a sub-directory
- f_chdir - Change current directory
- f_chdrive - Change current drive
- f_getcwd - Retrieve the current directory and drive
- Volume Management
- f_mount - Register/Unregister a work area of a volume
- f_mkfs - Create an FAT volume on the logical drive
- f_fdisk - Create logical drives on the physical drive
- f_getfree - Get total size and free size on the volume
- f_getlabel - Get volume label
- f_setlabel - Set volume label
Device Control Interface
Since the FatFs module is a file system layer, it is completely separated from the physical devices, such as memory card, harddisk and any type of storage device. FatFs accesses the storage devices via a simple interface shown below. The low level device control module isnot a part of FatFs module. It is provided by implementer. Also sample implementations for some platforms are available in the downloads.
ResourcesThe FatFs module is a free software opened for education, research and development. You can use, modify and/or redistribute it for personal projects or commercial products without any restriction under your responsibility. For further information, refer to the application note.
|