MityDSP Documentation Index

e:/hudson/workspace/MityDSP MDK Release/trunk/sw/inc/fatfs/private/fatfs_int.h File Reference

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

Detailed Description

FAT filesystem internal top level header file.

Author:
Critical Link LLC

      o  0
      | /       Copyright (c) 2007-2008
     (CL)---o   Critical Link, LLC
       \
        O

    

Define Documentation

#define UNKNOWN_FS   0
#define FAT16   1
#define FAT32   2

Function Documentation

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.

Parameters:
[in] anFileno Internal file descriptor for opened file.
Returns:
FATFS_OK on success, negative value on error.
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.

Parameters:
[in] anFileno Internal file descriptor for opened file.
[in] anOffset Byte offset from provided origin.
[in] aeOrigin SEEK_SET, SEEK_CUR, or SEEK_END.
Returns:
New file offset, or a negative number on error.
int FAT_unlink ( const char *  apPath,
tsFATDevData apDevData 
)

Delete a file.

Parameters:
[in] apPath Pointer to null terminated path to file
[in] apDevData FAT interface device data structure
Returns:
Zero if successful, or a negative number on error.
int FAT_rename ( const char *  apOldPath,
const char *  apNewPath,
tsFATDevData apDevData 
)

Rename a file on a FAT device.

Parameters:
[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
Returns:
Zero if successful, or a negative number on error.
int FAT_CountFreeClusters ( tsFATDevData apDevData  ) 

Count free clusters on the FAT Table.

Parameters:
[in] apDevData Pointer to file system driver
Returns:
The free cluster count, or FATFS_FAT_TYPE_NOT_SUPPORTED if an unsupported FAT type was found, or FATFS_DEVICE_READ_FAILED if a device read failure occurs.
int FAT_GetFreeCluster ( tsFATDevData apDevData,
int  anChainedCluster 
)

Find a free cluster on the FAT Table and Mark it used with EOC.

Parameters:
[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)
Returns:
Cluster number allocated (0 if no available cluster), or FATFS_FAT_TYPE_NOT_SUPPORTED if an unsupported FAT type was found, or FATFS_DEVICE_READ_FAILED if a device read failure occurs, or FATFS_DEVICE_WRITE_FAILED if a device write failure occurs.
int FAT_GetNextCluster ( tsFATDevData apDevData,
int  anCluster 
)

Find the Next Cluster In the Chain.

Parameters:
[in] apDevData FAT interface device data structure
[in] anCluster Current cluster number
Returns:
0 if no available cluster, FATFS_FAT_TYPE_NOT_SUPPORTED if an unsupported FAT type was found, FATFS_DEVICE_READ_FAILED if a device read failure occurs, otherwise 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.

Parameters:
[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.
Returns:
0 on success, FATFS_INVALID_PATH if parent path was invalid, FATFS_FAT_TYPE_NOT_SUPPORTED if an unsupported FAT type was found, FATFS_DEVICE_READ_FAILED is a device read failure occurs, FATFS_DIR_NOT_FOUND if a subdirectory was not found, and FATFS_FILE_NOT_FOUND if file was not located but parent path was OK.
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.

Parameters:
[in] apNewPath pointer to null terminated path to the directory
[in] apDevData FAT interface device data structure
Returns:
0 on success, FATFS_INVALID_PATH if parent path was invalid, FATFS_FAT_TYPE_NOT_SUPPORTED if an unsupported FAT type was found, FATFS_DEVICE_READ_FAILED if a device read failure occurs, FATFS_DEVICE_WRITE_FAILED if a device write failure occurs, FATFS_DIR_NOT_FOUND if a subdirectory was not found, or FATFS_FILE_ALREADY_EXISTS if the path points to an existing file.
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.

Parameters:
[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)
Returns:
Zero for success, -1 for failure.

Variable Documentation

const unsigned int FATFS_FLAG_NOACCESSTIME = 1 [static]

data needed for each file descriptor


  
Generated on Wed Mar 17 18:24:35 2010 for FAT File System Library by  Doxygen Version 1.6.1
Copyright © 2009, Critical Link LLC, All rights reserved.