FAT filesystem internal top level header file. More...
#include <file.h>#include "private/fatstruct.h"#include "private/fatfs_macros.h"Classes | |
| struct | tsFATDevData |
| This stucture contains the file system structure data used by the FAT file system core associated with a specific physical device driver. More... | |
| struct | tsFATFileData |
| This structure is used by the FAT file system drivers for each opened file descriptor. More... | |
Defines | |
| #define | UNKNOWN_FS 0 |
| #define | FAT16 1 |
| #define | FAT32 2 |
Functions | |
| int | FAT_open (const char *path, unsigned flags, int fno, tsFATDevData *apDevData) |
| int | FAT_close (int fno) |
| Close a file descriptor assocaited with a FAT device. | |
| int | FAT_read (int fno, char *buffer, unsigned count) |
| int | FAT_write (int fno, const char *buffer, unsigned count) |
| off_t | FAT_lseek (int fno, off_t offset, int origin) |
| FAT driver lseek implementation. | |
| int | FAT_unlink (const char *path, tsFATDevData *apDevData) |
| Delete a file. | |
| int | FAT_rename (const char *old_name, const char *new_name, tsFATDevData *apDevData) |
| Rename a file on a FAT device. | |
| int | FAT_CountFreeClusters (tsFATDevData *apDevData) |
| Count free clusters on the FAT Table. | |
| int | FAT_GetFreeCluster (tsFATDevData *apDevData, int ChainedCluster) |
| Find a free cluster on the FAT Table and Mark it used with EOC. | |
| int | FAT_GetNextCluster (tsFATDevData *apDevData, int anCluster) |
| Find the Next Cluster In the Chain. | |
| int | FAT_finddirent (const char *apPath, tsFATDevData *apDevData, uint32_t *apDirStartCluster, uint32_t *apDirEntryCluster, uint32_t *apDirEntryInCluster, tsDirEntry *apFileEntry) |
| Given a path, locates parent directory cluster information and directory entry information. | |
| int | FAT_createdirent (const char *apPath, tsFATDevData *apDevData) |
| Given a path to a non-existent entry in a directory, this function creates a new subdirectory at the provided path. | |
| int | FAT_gettime (unsigned int *apYear, unsigned int *apMonth, unsigned int *apDay, unsigned int *apHour, unsigned int *apMinutes, unsigned int *apSeconds, unsigned int *apHundredths) |
| Default time callback, used when access to a RTC device is not provided to the FAT filesystem driver. | |
Variables | |
| static const unsigned int | FATFS_FLAG_NOACCESSTIME = 1 |
| tsFATDevData | gpFATDevData [] |
| tsFATFileData | gpFileData [] |
| data needed for each file descriptor | |
FAT filesystem internal top level header file.
o 0
| / Copyright (c) 2007-2008
(CL)---o Critical Link, LLC
\
O
| #define UNKNOWN_FS 0 |
| #define FAT16 1 |
| #define FAT32 2 |
| int FAT_open | ( | const char * | path, | |
| unsigned | flags, | |||
| int | fno, | |||
| tsFATDevData * | apDevData | |||
| ) |
| int FAT_close | ( | int | anFileno | ) |
Close a file descriptor assocaited with a FAT device.
| [in] | anFileno | Internal file descriptor for opened file. |
| int FAT_read | ( | int | fno, | |
| char * | buffer, | |||
| unsigned | count | |||
| ) |
| int FAT_write | ( | int | fno, | |
| const char * | buffer, | |||
| unsigned | count | |||
| ) |
| off_t FAT_lseek | ( | int | anFileno, | |
| off_t | anOffset, | |||
| int | aeOrigin | |||
| ) |
FAT driver lseek implementation.
| [in] | anFileno | Internal file descriptor for opened file. |
| [in] | anOffset | Byte offset from provided origin. |
| [in] | aeOrigin | SEEK_SET, SEEK_CUR, or SEEK_END. |
| int FAT_unlink | ( | const char * | apPath, | |
| tsFATDevData * | apDevData | |||
| ) |
Delete a file.
| [in] | apPath | Pointer to null terminated path to file |
| [in] | apDevData | FAT interface device data structure |
| int FAT_rename | ( | const char * | apOldPath, | |
| const char * | apNewPath, | |||
| tsFATDevData * | apDevData | |||
| ) |
Rename a file on a FAT device.
| [in] | apOldPath | Pointer to null terminated path to current file |
| [in] | apNewPath | Pointer to null terminated new path for file |
| [in] | apDevData | FAT interface device data structure |
| int FAT_CountFreeClusters | ( | tsFATDevData * | apDevData | ) |
Count free clusters on the FAT Table.
| [in] | apDevData | Pointer to file system driver |
| int FAT_GetFreeCluster | ( | tsFATDevData * | apDevData, | |
| int | anChainedCluster | |||
| ) |
Find a free cluster on the FAT Table and Mark it used with EOC.
| [in] | apDevData | Pointer to file system driver |
| [in] | anChainedCluster | If non-zero, the cluster entry provided will be linked to the newly found free cluster (for file growth) |
| int FAT_GetNextCluster | ( | tsFATDevData * | apDevData, | |
| int | anCluster | |||
| ) |
Find the Next Cluster In the Chain.
| [in] | apDevData | FAT interface device data structure |
| [in] | anCluster | Current cluster number |
| int FAT_finddirent | ( | const char * | apPath, | |
| tsFATDevData * | apDevData, | |||
| uint32_t * | apDirStartCluster, | |||
| uint32_t * | apDirEntryCluster, | |||
| uint32_t * | apDirEntryInCluster, | |||
| tsDirEntry * | apFileEntry | |||
| ) |
Given a path, locates parent directory cluster information and directory entry information.
| [in] | apPath | pointer to null terminated path to file |
| [in] | apDevData | FAT interface device data structure |
| [out] | apDirStartCluster | holder for found parent directory starting cluster. This value is set 0xFFFFFFFF if the path was not found. For FAT16 the dir_start_cluster will be 0x00000000 if the path points to the root directory (which is not in the FAT Data Area). |
| [out] | apDirEntryCluster | holder for found parent directory cluster containing the entry of the file specified in the path. If the file was not found, then this value is set to 0xFFFFFFF. |
| [out] | apDirEntryInCluster | the 32 byte index in the dir_entry_cluster containing the location of the file specified. If the file was not found, then this value is set to 0xFFFFFFFF. |
| [out] | apFileEntry | a copy of the file entry infromation from the parent directory file, this information is not modified if the file is not found. |
| int FAT_createdirent | ( | const char * | apNewPath, | |
| tsFATDevData * | apDevData | |||
| ) |
Given a path to a non-existent entry in a directory, this function creates a new subdirectory at the provided path.
| [in] | apNewPath | pointer to null terminated path to the directory |
| [in] | apDevData | FAT interface device data structure |
| int FAT_gettime | ( | unsigned int * | apYear, | |
| unsigned int * | apMonth, | |||
| unsigned int * | apDay, | |||
| unsigned int * | apHours, | |||
| unsigned int * | apMinutes, | |||
| unsigned int * | apSeconds, | |||
| unsigned int * | apHundredths | |||
| ) |
Default time callback, used when access to a RTC device is not provided to the FAT filesystem driver.
It uses the system tick timer to compute a date based on the tick count, offset from midnight on January 1, 2000.
| [out] | apYear | Location to store RTC year (1980-20??) |
| [out] | apMonth | Location to store RTC month (1-12) |
| [out] | apDay | Location to store RTC day (1-31) |
| [out] | apHours | Location to store RTC hour (0-23) |
| [out] | apMinutes | Location to store RTC minutes (0-59) |
| [out] | apSeconds | Location to store RTC seconds (0-59) |
| [out] | apHundredths | Location to store RTC 1/100's seconds (0-99) |
const unsigned int FATFS_FLAG_NOACCESSTIME = 1 [static] |
data needed for each file descriptor