SAM4S-EK_FreeRTOS+FAT-SL  1.0
An example project to test the functionality of FreeRTOS+FAT-SL using SD card as data storage medium
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules
fat_sl.h File Reference
#include "config_fat_sl.h"
#include "ver_fat_sl.h"

Go to the source code of this file.

Classes

struct  F_NAME
 
struct  F_POS
 
struct  F_FIND
 
struct  F_FILE
 
struct  F_SPACE
 

Macros

#define F_MAXNAME   8 /* 8 byte name */
 
#define F_MAXEXT   3 /* 3 byte extension */
 
#define F_ATTR_ARC   0x20
 
#define F_ATTR_DIR   0x10
 
#define F_ATTR_VOLUME   0x08
 
#define F_ATTR_SYSTEM   0x04
 
#define F_ATTR_HIDDEN   0x02
 
#define F_ATTR_READONLY   0x01
 
#define F_CLUSTER_FREE   ( (unsigned long)0x00000000 )
 
#define F_CLUSTER_RESERVED   ( (unsigned long)0x0ffffff0 )
 
#define F_CLUSTER_BAD   ( (unsigned long)0x0ffffff7 )
 
#define F_CLUSTER_LAST   ( (unsigned long)0x0ffffff8 )
 
#define F_CLUSTER_LASTF32R   ( (unsigned long)0x0fffffff )
 
#define F_ST_MISSING   0x00000001
 
#define F_ST_CHANGED   0x00000002
 
#define F_ST_WRPROTECT   0x00000004
 
#define f_initvolume   fn_initvolume
 
#define f_delvolume   fn_delvolume
 
#define f_hardformat(fattype)   fn_hardformat( fattype )
 
#define f_format(fattype)   fn_hardformat( fattype )
 
#define f_getcwd(buffer, maxlen)   fn_getcwd( buffer, maxlen, 1 )
 
#define f_getfreespace   fn_getfreespace
 
#define f_chdir(dirname)   fn_chdir( dirname )
 
#define f_mkdir(dirname)   fn_mkdir( dirname )
 
#define f_rmdir(dirname)   fn_rmdir( dirname )
 
#define f_findfirst(filename, find)   fn_findfirst( filename, find )
 
#define f_findnext(find)   fn_findnext( find )
 
#define f_filelength(filename)   fn_filelength( filename )
 
#define f_getserial(serial)   fn_getserial( serial )
 
#define f_flush(filehandle)   fn_flush( filehandle )
 
#define f_write(buf, size, _size_t, filehandle)   fn_write( buf, size, _size_t, filehandle )
 
#define f_seek(filehandle, offset, whence)   fn_seek( filehandle, offset, whence )
 
#define f_tell(filehandle)   fn_tell( filehandle )
 
#define f_getc(filehandle)   fn_getc( filehandle )
 
#define f_putc(ch, filehandle)   fn_putc( ch, filehandle )
 
#define f_rewind(filehandle)   fn_rewind( filehandle )
 
#define f_eof(filehandle)   fn_eof( filehandle )
 
#define f_delete(filename)   fn_delete( filename )
 
#define f_seteof(file)   fn_seteof( file )
 
#define f_truncate(filename, filesize)   fn_truncate( filename, filesize )
 
#define f_close(filehandle)   fn_close( filehandle )
 
#define f_open(filename, mode)   fn_open( filename, mode )
 
#define f_read(buf, size, _size_t, filehandle)   fn_read( buf, size, _size_t, filehandle )
 

Enumerations

enum  { F_UNKNOWN_MEDIA, F_FAT12_MEDIA, F_FAT16_MEDIA, F_FAT32_MEDIA }
 
enum  {
  F_NO_ERROR, F_ERR_RESERVED_1, F_ERR_NOTFORMATTED, F_ERR_INVALIDDIR,
  F_ERR_INVALIDNAME, F_ERR_NOTFOUND, F_ERR_DUPLICATED, F_ERR_NOMOREENTRY,
  F_ERR_NOTOPEN, F_ERR_EOF, F_ERR_RESERVED_2, F_ERR_NOTUSEABLE,
  F_ERR_LOCKED, F_ERR_ACCESSDENIED, F_ERR_NOTEMPTY, F_ERR_INITFUNC,
  F_ERR_CARDREMOVED, F_ERR_ONDRIVE, F_ERR_INVALIDSECTOR, F_ERR_READ,
  F_ERR_WRITE, F_ERR_INVALIDMEDIA, F_ERR_BUSY, F_ERR_WRITEPROTECT,
  F_ERR_INVFATTYPE, F_ERR_MEDIATOOSMALL, F_ERR_MEDIATOOLARGE, F_ERR_NOTSUPPSECTORSIZE,
  F_ERR_ALLOCATION
}
 
enum  { F_SEEK_SET, F_SEEK_CUR, F_SEEK_END }
 

Functions

unsigned char fs_init (void)
 
unsigned char fs_delete (void)
 
unsigned char fn_initvolume (F_DRIVERINIT initfunc)
 
unsigned char fn_delvolume (void)
 
unsigned char fn_getfreespace (F_SPACE *pspace)
 
unsigned char fn_chdir (const char *dirname)
 
unsigned char fn_mkdir (const char *dirname)
 
unsigned char fn_rmdir (const char *dirname)
 
unsigned char fn_findfirst (const char *filename, F_FIND *find)
 
unsigned char fn_findnext (F_FIND *find)
 
long fn_filelength (const char *filename)
 
unsigned char fn_close (F_FILE *filehandle)
 
F_FILEfn_open (const char *filename, const char *mode)
 
long fn_read (void *buf, long size, long _size_t, F_FILE *filehandle)
 
long fn_write (const void *buf, long size, long _size_t, F_FILE *filehandle)
 
unsigned char fn_seek (F_FILE *filehandle, long offset, unsigned char whence)
 
long fn_tell (F_FILE *filehandle)
 
int fn_getc (F_FILE *filehandle)
 
int fn_putc (int ch, F_FILE *filehandle)
 
unsigned char fn_rewind (F_FILE *filehandle)
 
unsigned char fn_eof (F_FILE *filehandle)
 
unsigned char fn_delete (const char *filename)
 
unsigned char fn_seteof (F_FILE *)
 
F_FILEfn_truncate (const char *, long)
 
unsigned char fn_getcwd (char *buffer, unsigned char maxlen, char root)
 
unsigned char fn_hardformat (unsigned char fattype)
 
unsigned char fn_getserial (unsigned long *)
 
unsigned char fn_flush (F_FILE *f)
 

Macro Definition Documentation

#define F_ATTR_ARC   0x20

Definition at line 90 of file fat_sl.h.

#define F_ATTR_DIR   0x10

Definition at line 91 of file fat_sl.h.

#define F_ATTR_HIDDEN   0x02

Definition at line 94 of file fat_sl.h.

#define F_ATTR_READONLY   0x01

Definition at line 95 of file fat_sl.h.

#define F_ATTR_SYSTEM   0x04

Definition at line 93 of file fat_sl.h.

#define F_ATTR_VOLUME   0x08

Definition at line 92 of file fat_sl.h.

#define f_chdir (   dirname)    fn_chdir( dirname )

Definition at line 396 of file fat_sl.h.

#define f_close (   filehandle)    fn_close( filehandle )

Definition at line 438 of file fat_sl.h.

#define F_CLUSTER_BAD   ( (unsigned long)0x0ffffff7 )

Definition at line 99 of file fat_sl.h.

#define F_CLUSTER_FREE   ( (unsigned long)0x00000000 )

Definition at line 97 of file fat_sl.h.

#define F_CLUSTER_LAST   ( (unsigned long)0x0ffffff8 )

Definition at line 100 of file fat_sl.h.

#define F_CLUSTER_LASTF32R   ( (unsigned long)0x0fffffff )

Definition at line 101 of file fat_sl.h.

#define F_CLUSTER_RESERVED   ( (unsigned long)0x0ffffff0 )

Definition at line 98 of file fat_sl.h.

#define f_delete (   filename)    fn_delete( filename )

Definition at line 430 of file fat_sl.h.

#define f_delvolume   fn_delvolume

Definition at line 268 of file fat_sl.h.

#define f_eof (   filehandle)    fn_eof( filehandle )

Definition at line 427 of file fat_sl.h.

#define f_filelength (   filename)    fn_filelength( filename )

Definition at line 407 of file fat_sl.h.

#define f_findfirst (   filename,
  find 
)    fn_findfirst( filename, find )

Definition at line 404 of file fat_sl.h.

#define f_findnext (   find)    fn_findnext( find )

Definition at line 405 of file fat_sl.h.

#define f_flush (   filehandle)    fn_flush( filehandle )

Definition at line 412 of file fat_sl.h.

#define f_format (   fattype)    fn_hardformat( fattype )

Definition at line 387 of file fat_sl.h.

#define f_getc (   filehandle)    fn_getc( filehandle )

Definition at line 421 of file fat_sl.h.

#define f_getcwd (   buffer,
  maxlen 
)    fn_getcwd( buffer, maxlen, 1 )

Definition at line 389 of file fat_sl.h.

#define f_getfreespace   fn_getfreespace

Definition at line 392 of file fat_sl.h.

#define f_getserial (   serial)    fn_getserial( serial )

Definition at line 409 of file fat_sl.h.

#define f_hardformat (   fattype)    fn_hardformat( fattype )

Definition at line 386 of file fat_sl.h.

#define f_initvolume   fn_initvolume

Definition at line 267 of file fat_sl.h.

#define F_MAXEXT   3 /* 3 byte extension */

Definition at line 56 of file fat_sl.h.

#define F_MAXNAME   8 /* 8 byte name */

Definition at line 55 of file fat_sl.h.

#define f_mkdir (   dirname)    fn_mkdir( dirname )

Definition at line 398 of file fat_sl.h.

#define f_open (   filename,
  mode 
)    fn_open( filename, mode )

Definition at line 439 of file fat_sl.h.

#define f_putc (   ch,
  filehandle 
)    fn_putc( ch, filehandle )

Definition at line 423 of file fat_sl.h.

#define f_read (   buf,
  size,
  _size_t,
  filehandle 
)    fn_read( buf, size, _size_t, filehandle )

Definition at line 440 of file fat_sl.h.

#define f_rewind (   filehandle)    fn_rewind( filehandle )

Definition at line 425 of file fat_sl.h.

#define f_rmdir (   dirname)    fn_rmdir( dirname )

Definition at line 400 of file fat_sl.h.

#define f_seek (   filehandle,
  offset,
  whence 
)    fn_seek( filehandle, offset, whence )

Definition at line 416 of file fat_sl.h.

#define f_seteof (   file)    fn_seteof( file )

Definition at line 433 of file fat_sl.h.

#define F_ST_CHANGED   0x00000002

Definition at line 104 of file fat_sl.h.

#define F_ST_MISSING   0x00000001

Definition at line 103 of file fat_sl.h.

#define F_ST_WRPROTECT   0x00000004

Definition at line 105 of file fat_sl.h.

#define f_tell (   filehandle)    fn_tell( filehandle )

Definition at line 419 of file fat_sl.h.

#define f_truncate (   filename,
  filesize 
)    fn_truncate( filename, filesize )

Definition at line 436 of file fat_sl.h.

#define f_write (   buf,
  size,
  _size_t,
  filehandle 
)    fn_write( buf, size, _size_t, filehandle )

Definition at line 414 of file fat_sl.h.

Enumeration Type Documentation

anonymous enum
Enumerator
F_UNKNOWN_MEDIA 
F_FAT12_MEDIA 
F_FAT16_MEDIA 
F_FAT32_MEDIA 

Definition at line 123 of file fat_sl.h.

anonymous enum
Enumerator
F_NO_ERROR 
F_ERR_RESERVED_1 
F_ERR_NOTFORMATTED 
F_ERR_INVALIDDIR 
F_ERR_INVALIDNAME 
F_ERR_NOTFOUND 
F_ERR_DUPLICATED 
F_ERR_NOMOREENTRY 
F_ERR_NOTOPEN 
F_ERR_EOF 
F_ERR_RESERVED_2 
F_ERR_NOTUSEABLE 
F_ERR_LOCKED 
F_ERR_ACCESSDENIED 
F_ERR_NOTEMPTY 
F_ERR_INITFUNC 
F_ERR_CARDREMOVED 
F_ERR_ONDRIVE 
F_ERR_INVALIDSECTOR 
F_ERR_READ 
F_ERR_WRITE 
F_ERR_INVALIDMEDIA 
F_ERR_BUSY 
F_ERR_WRITEPROTECT 
F_ERR_INVFATTYPE 
F_ERR_MEDIATOOSMALL 
F_ERR_MEDIATOOLARGE 
F_ERR_NOTSUPPSECTORSIZE 
F_ERR_ALLOCATION 

Definition at line 131 of file fat_sl.h.

anonymous enum
Enumerator
F_SEEK_SET 
F_SEEK_CUR 
F_SEEK_END 

Definition at line 210 of file fat_sl.h.

Function Documentation

unsigned char fn_chdir ( const char *  dirname)

Definition at line 665 of file dir.c.

unsigned char fn_close ( F_FILE filehandle)

Definition at line 704 of file file.c.

unsigned char fn_delete ( const char *  filename)

Definition at line 1336 of file file.c.

unsigned char fn_delvolume ( void  )

Definition at line 972 of file volume.c.

unsigned char fn_eof ( F_FILE filehandle)

Definition at line 1218 of file file.c.

long fn_filelength ( const char *  filename)

Definition at line 75 of file file.c.

unsigned char fn_findfirst ( const char *  filename,
F_FIND find 
)

Definition at line 562 of file dir.c.

unsigned char fn_findnext ( F_FIND find)

Definition at line 608 of file dir.c.

unsigned char fn_flush ( F_FILE f)

Definition at line 796 of file file.c.

int fn_getc ( F_FILE filehandle)

Definition at line 1307 of file file.c.

unsigned char fn_getcwd ( char *  buffer,
unsigned char  maxlen,
char  root 
)

Definition at line 513 of file dir.c.

unsigned char fn_getfreespace ( F_SPACE pspace)

Definition at line 787 of file volume.c.

unsigned char fn_getserial ( unsigned long *  )

Definition at line 859 of file volume.c.

unsigned char fn_hardformat ( unsigned char  fattype)

Definition at line 530 of file volume.c.

unsigned char fn_initvolume ( F_DRIVERINIT  initfunc)

Definition at line 932 of file volume.c.

unsigned char fn_mkdir ( const char *  dirname)

Definition at line 925 of file dir.c.

F_FILE* fn_open ( const char *  filename,
const char *  mode 
)

Definition at line 421 of file file.c.

int fn_putc ( int  ch,
F_FILE filehandle 
)

Definition at line 1276 of file file.c.

long fn_read ( void *  buf,
long  size,
long  _size_t,
F_FILE filehandle 
)

Definition at line 851 of file file.c.

unsigned char fn_rewind ( F_FILE filehandle)

Definition at line 1252 of file file.c.

unsigned char fn_rmdir ( const char *  dirname)

Definition at line 1088 of file dir.c.

unsigned char fn_seek ( F_FILE filehandle,
long  offset,
unsigned char  whence 
)

Definition at line 1130 of file file.c.

unsigned char fn_seteof ( F_FILE )

Definition at line 1495 of file file.c.

long fn_tell ( F_FILE filehandle)

Definition at line 1184 of file file.c.

F_FILE * fn_truncate ( const char *  ,
long   
)

Definition at line 1518 of file file.c.

long fn_write ( const void *  buf,
long  size,
long  _size_t,
F_FILE filehandle 
)

Definition at line 969 of file file.c.

unsigned char fs_delete ( void  )

Definition at line 904 of file volume.c.

unsigned char fs_init ( void  )

Definition at line 881 of file volume.c.