weAut_01 / weAutSys    R 2.2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Data Structures | Defines | Enumerations | Functions

Overview

(Grande) fatFS configurations and declarations

This is the main include file for ChaN's (grande) fatFS for small memory cards (SMC, MMC) and FAT file system functions. They are build upon the low level driver functions defined in file fatFS/diskio.h.

Copyright (c) 2012, ChaN, all right reserved.
The original copyright notice is at the begin of the (this) source file fatFS/ff.h. It is still valid.

Modification for weAutSys by A. Weinert
Copyright © 2012 Albrecht Weinert
weinert - automation, Bochum
weinert-automation.de weAut.de a-weinert.de

A.W.'s modifications for weAutSys are

Data Structures

struct  DIR
 Directory object structure (DIR) More...
struct  FATFS
 File system object structure (FATFS) More...
struct  FIL
 File object structure (FIL) More...
struct  FILINFO
 File status structure (FILINFO) More...

Defines

#define _FS_TINY
 Tiny FS.
#define _MAX_SS   512
 Maximum sector size to be handled.
#define AM_ARC   0x20
 directory entry attribute bit: archive
#define AM_DIR   0x10
 directory entry attribute bit: directory
#define AM_HID   0x02
 directory entry attribute bit: hidden
#define AM_LFN   0x0F
 directory entry attribute bit: LFN entry
#define AM_MASK   0x3F
 mask of defined directory entry attribute bits
#define AM_RDO   0x01
 directory entry attribute bit: read only
#define AM_SYS   0x04
 directory entry attribute bit: system
#define AM_VOL   0x08
 directory entry attribute bit: Volume label
#define div16SSZ(div)
 Divide (16 bit, unsigned) by fixed sector size.
#define div2SSZ(div)
 Divide (32 bit, unsigned) by 2 times fixed sector size.
#define div32SSZ(div)
 Divide (32 bit, unsigned) by fixed sector size.
#define div4SSZ(div)
 Divide (32 bit, unsigned) by 4 times fixed sector size.
#define divSSZ2(div)
 Divide (32 bit, unsigned) by fixed sector size by 2.
#define divSSZ4(div)
 Divide (32 bit, unsigned) by fixed sector size by 4.
#define f_eof(fp)
 Check EOF.
#define f_error(fp)
 Check error state.
#define f_size(fp)
 Get the size.
#define f_tell(fp)
 Get the current read/write pointer.
#define FA_CREATE_ALWAYS   0x08
 Mode flag: create anyway.
#define FA_CREATE_NEW   0x04
 Mode flag: create a new file.
#define FA_OPEN_ALWAYS   0x10
 Mode flag: open anyway.
#define FA_OPEN_EXISTING   0
 Mode flag: open the existing file object.
#define FA_READ   0x01
 Mode flag: read access to the file object.
#define FA_WRITE   0x02
 Mode flag: write access to the file object.
#define FS_FAT12   1
 FATFS.fs_type value.
#define FS_FAT16   2
 FATFS.fs_type value.
#define FS_FAT32   3
 FATFS.fs_type value.
#define get_fattime()
 Get current local FAT time.
#define LD2PD(vol)
 Each logical drive is bound to the same physical drive number */.
#define LD2PT(vol)
 Always mounts the 1st partition or in SFD.
#define modSSZ(div)
 Modulo (unsigned) by fixed sector size.
#define mul16SSZ(fac)
 Multiply (16 bit, unsigned) with fixed sector size.
#define mul32SSZ(fac)
 Multiply (32 bit, unsigned) with fixed sector size.
#define SSM   511
 Mask for fixed sector size.
#define SSZ   512
 Fixed sector size.

Enumerations

enum  FRESULT {
  FR_OK, FR_DISK_ERR, FR_INT_ERR, FR_NOT_READY,
  FR_NO_FILE, FR_NO_PATH, FR_INVALID_NAME, FR_DENIED,
  FR_EXIST, FR_INVALID_OBJECT, FR_WRITE_PROTECTED, FR_INVALID_DRIVE,
  FR_NOT_ENABLED, FR_NO_FILESYSTEM, FR_MKFS_ABORTED, FR_TIMEOUT,
  FR_LOCKED, FR_NOT_ENOUGH_CORE, FR_TOO_MANY_OPEN_FILES, FR_INVALID_PARAMETER
}
 File functions return code. More...

Functions

FRESULT checkValidFS (uint8_t vol)
 Check if there's a valid mounted file system on the drive.
FRESULT checkWriteProtect (uint8_t vol)
 Check if the drive is write protected.
uint8_t extractDrive (const TCHAR **path)
 Extract drive number from path.
FRESULT f_chdir (const TCHAR *)
 Change current directory (not implemented)
FRESULT f_chdrive (uint8_t)
 Change current drive (not implemented)
FRESULT f_chmod (const TCHAR *path, uint8_t value, uint8_t mask)
 Change attribute of the file or directory.
FRESULT f_close (FIL *fp)
 Close an open file object.
FRESULT f_fdisk (uint8_t pdrv, const uint32_t szt[], void *work)
 Divide a physical drive into some partitions.
FRESULT f_getcwd (TCHAR *, uint16_t)
 Get current directory (not implemented)
FRESULT f_getfree (const uint8_t vol, uint32_t *nclst)
 Get the number of free clusters on the drive.
TCHAR * f_gets (TCHAR *, int, FIL *)
 Get a string from the file (not implemented)
FRESULT f_lseek (FIL *fp, uint32_t ofs)
 Move file pointer of a file object, expand file size.
FRESULT f_mkdir (const TCHAR *path)
 Create a new directory.
FRESULT f_mount (uint8_t vol, FATFS *fs)
 Mount / unmount a logical drive.
FRESULT f_open (FIL *fp, const TCHAR *path, uint8_t mode)
 Open or create a file.
FRESULT f_opendir (DIR *dj, const TCHAR *path)
 Open an existing directory.
int f_printf (FIL *, const TCHAR *,...)
 Put a formatted string to the file (not implemented)
int f_putc (TCHAR, FIL *)
 Put a character to the file (not implemented)
int f_puts (const TCHAR *, FIL *)
 Put a string to the file (not implemented)
FRESULT f_read (FIL *fp, void *buff, uint16_t btr, uint16_t *br)
 Read data from a file.
FRESULT f_readdir (DIR *dj, FILINFO *fno)
 Read a directory item.
FRESULT f_rename (const TCHAR *path_old, const TCHAR *path_new)
 Rename or move a file or directory.
FRESULT f_stat (const TCHAR *path, FILINFO *fno)
 Get file status.
FRESULT f_sync (FIL *fp)
 Flush written / cached data to a file.
FRESULT f_truncate (FIL *fp)
 Truncate file.
FRESULT f_unlink (const TCHAR *path)
 Delete an existing file or directory.
FRESULT f_utime (const TCHAR *path, const FILINFO *fno)
 Change time-stamps of a file or directory.
FRESULT f_write (FIL *fp, const void *buff, uint16_t btw, uint16_t *bw)
 Write data to a file.
FRESULT getValidFS (uint8_t vol, FATFS **fatfs)
 Get the file system for the drive.
FRESULT lookForFS (uint8_t vol)
 Look for a recognised file system on the drive.