CARME-M4 BSP  V1.5
Private functions

Module Private Functions. More...

+ Collaboration diagram for Private functions:

Modules

 String functions
 String functions.
 
 Reentrant functions
 Request/Release grant to access the volume.
 
 FS Lock functions
 File lock control functions.
 
 Window functions
 Move/Flush disk access window in the file system object.
 
 Synchronization functions
 Synchronize file system and storage device.
 
 Sector-Number and Cluster-Nbr
 Get sector# from cluster#.
 
 FAT access
 FAT access.
 
 FAT handling
 FAT handling.
 
 Directory handling
 FAT handling.
 
 LFN handling
 Test/Pick/Fit an LFN segment from/to directory entry.
 

Functions

static FRESULT dir_read (DIR *dp, int vol)
 Read an object from the directory. More...
 
static FRESULT dir_register (DIR *dp)
 Register an object to the directory. More...
 
static FRESULT dir_remove (DIR *dp)
 Remove an object from the directory. More...
 
static FRESULT create_name (DIR *dp, const TCHAR **path)
 Pick a segment and create the object name in directory form. More...
 
static void get_fileinfo (DIR *dp, FILINFO *fno)
 Get file information from directory entry. More...
 
static int get_ldnumber (const TCHAR **path)
 Get logical drive number from path name. More...
 
static FRESULT follow_path (DIR *dp, const TCHAR *path)
 Follow a file path. More...
 
static BYTE check_fs (FATFS *fs, DWORD sect)
 Load a sector and check if it is an FAT boot sector. More...
 
static FRESULT find_volume (FATFS **rfs, const TCHAR **path, BYTE wmode)
 Find logical drive and check if the volume is mounted. More...
 
static FRESULT validate (void *obj)
 Check if the file/directory object is valid or not. More...
 

Detailed Description

Module Private Functions.

Function Documentation

static BYTE check_fs ( FATFS fs,
DWORD  sect 
)
static

Load a sector and check if it is an FAT boot sector.

Parameters
fsFile system object
sectSector# (lba) to check if it is an FAT boot record or not
Returns
  • 0: FAT boor sector
  • 1: Valid boor sector but not FAT
  • 2: Not a boot sector
  • 3: Disk error

Definition at line 2182 of file ff.c.

static FRESULT create_name ( DIR dp,
const TCHAR **  path 
)
static

Pick a segment and create the object name in directory form.

Parameters
dpPointer to the directory object
pathPointer to pointer to the segment in the path string
Returns
  • FR_OK: Successful
  • FR_DISK_ERR: A disk error

Definition at line 1829 of file ff.c.

+ Here is the call graph for this function:

static FRESULT dir_read ( DIR dp,
int  vol 
)
static

Read an object from the directory.

Parameters
dpPointer to the directory object
volFiltered
  • 0: file/directory
  • 1: volume label
Returns
FRESULT

Definition at line 1659 of file ff.c.

+ Here is the call graph for this function:

static FRESULT dir_register ( DIR dp)
static

Register an object to the directory.

Parameters
dpTarget directory with object name to be created
Returns
  • FR_OK: Successful
  • FR_DENIED: No free entry or too many SFN collision
  • FR_DISK_ERR: Disk error

Definition at line 1714 of file ff.c.

static FRESULT dir_remove ( DIR dp)
static

Remove an object from the directory.

Parameters
dpDirectory object pointing the entry to be removed
Returns
  • FR_OK: Successful
  • FR_DISK_ERR: A disk error

Definition at line 1788 of file ff.c.

static FRESULT find_volume ( FATFS **  rfs,
const TCHAR **  path,
BYTE  wmode 
)
static

Find logical drive and check if the volume is mounted.

Parameters
rfsPointer to pointer to the found file system object
pathPointer to pointer to the path name (drive number)
wmode!=0: Check write protection for write access
Returns
FRESULT

Definition at line 2206 of file ff.c.

static FRESULT follow_path ( DIR dp,
const TCHAR *  path 
)
static

Follow a file path.

Parameters
dpDirectory object to return last directory and found object
pathFull-path string to find a file or directory
Returns
FRESULT

Definition at line 2123 of file ff.c.

static void get_fileinfo ( DIR dp,
FILINFO fno 
)
static

Get file information from directory entry.

Parameters
dpPointer to the directory object
fnoPointer to the file information to be filled

Definition at line 2033 of file ff.c.

static int get_ldnumber ( const TCHAR **  path)
static

Get logical drive number from path name.

Parameters
pathPointer to pointer to the path name
Returns
Returns logical drive number (-1:invalid drive)

Definition at line 2096 of file ff.c.

static FRESULT validate ( void *  obj)
static

Check if the file/directory object is valid or not.

Parameters
objPointer to the object FIL/DIR to check validity
Returns
  • FR_OK(0): The object is valid
  • !=0: Invalid

Definition at line 2366 of file ff.c.