API  2.3.0
TSmarT Software Library
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Functions

esint8 efs_init (EmbeddedFileSystem *efs, eint8 *opts)
 efs_init function More...
 
esint8 file_fopen (File *file, FileSystem *fs, eint8 *filename, eint8 mode)
 file_fopen function More...
 
esint8 file_fclose (File *file)
 File_fclose function. More...
 
euint32 file_read (File *file, euint32 size, euint8 *buf)
 file_read function More...
 
euint32 file_write (File *file, euint32 size, euint8 *buf)
 file_write function More...
 
esint8 fs_flushFs (FileSystem *fs)
 fs_flushFs function More...
 
esint8 fs_umount (FileSystem *fs)
 fs_umount function More...
 
esint8 ls_openDir (DirList *dlist, FileSystem *fs, eint8 *dirname)
 ls_openDir function More...
 
esint8 ls_getNext (DirList *dlist)
 ls_getNext function More...
 
esint16 rmfile (FileSystem *fs, euint8 *filename)
 rmfile function More...
 
esint8 mkdir (FileSystem *fs, eint8 *dirname)
 mkdir function More...
 

Detailed Description

Function Documentation

esint8 efs_init ( EmbeddedFileSystem efs,
eint8 *  opts 
)

efs_init function

This function initialises all subelements of a filesystem. It sets the pointerchain and verifies each step.

Note
TO BE DEPRECATED –> USE FATFS
Parameters
efsEmbedded file sytem handler
optsSet Always to NULL
Returns
  • 0 - OK
  • -1 - Failure.
Examples:
sd_efsl.c.
esint8 file_fclose ( File file)

File_fclose function.

This function closes a file, by clearing the object.

Note
TO BE DEPRECATED –> USE FATFS
Parameters
filefile handler
Returns
  • 0 on success.
Examples:
sd_efsl.c.
esint8 file_fopen ( File file,
FileSystem fs,
eint8 *  filename,
eint8  mode 
)

file_fopen function

This functions opens a file. This function is about to be redesigned. No Docs.

Note
TO BE DEPRECATED –> USE FATFS
Parameters
filefile handler.
fsfile system handler
filenamefile name.
modeoperation file mode. It shall be one of the following values:
  • MODE_READ
  • MODE_WRITE
  • MODE_APPEND
Returns
  • 0 - OK
  • Number < 0 - Failure
Examples:
sd_efsl.c.
euint32 file_read ( File file,
euint32  size,
euint8 *  buf 
)

file_read function

This function reads from a file, taking the FilePtr into account and advancing it according to the freadcall.

Note
TO BE DEPRECATED –> USE FATFS
Parameters
filefile handler.
sizesize of the data to read.
bufmemory buffer to store read data.
Returns
Value obtained from fread.
Examples:
sd_efsl.c.
euint32 file_write ( File file,
euint32  size,
euint8 *  buf 
)

file_write function

This function writes to a file, taking FilePtr into account and advancing it according to the fwritecall.

Note
TO BE DEPRECATED –> USE FATFS
Parameters
filefile handler.
sizesize of the data to write.
bufdata buffer to write.
Returns
Value obtained from fwrite
Examples:
sd_efsl.c.
esint8 fs_flushFs ( FileSystem fs)

fs_flushFs function

Unmont file system

Parameters
fs
Returns
0 - OK -1 - Failure
Examples:
sd_efsl.c.
esint8 fs_umount ( FileSystem fs)

fs_umount function

Unmont file system

Parameters
fs
Returns
0 - OK -1 - Failure
esint8 ls_getNext ( DirList dlist)

ls_getNext function

Select the next file stored in the DirList type variable.

Note
TO BE DEPRECATED –> USE FATFS
Parameters
dlistStored files to select to.
Returns
0 - OK
Examples:
sd_efsl.c.
esint8 ls_openDir ( DirList dlist,
FileSystem fs,
eint8 *  dirname 
)

ls_openDir function

Make a file list of the selected directory.

Note
TO BE DEPRECATED –> USE FATFS
Parameters
dlistmemory buffer to store files.
fsfile system handler.
dirnamename of the directory to open.
Returns
  • 0 - OK
  • -1 - Failure
Examples:
sd_efsl.c.
esint8 mkdir ( FileSystem fs,
eint8 *  dirname 
)

mkdir function

This function creates a new directory in the file system.

Note
TO BE DEPRECATED –> USE FATFS
Parameters
fsfile system handler.
dirnamename of the new directory.
Returns
  • 0 - OK
  • Number < 0 - Failure
esint16 rmfile ( FileSystem fs,
euint8 *  filename 
)

rmfile function

This function takes a filename as argument and deletes it, by freeing it's clusterchain, and deleting it's entry from the directory.

Note
TO BE DEPRECATED –> USE FATFS
Parameters
fsfile system handler.
filenamefile name.
Returns
  • 0 - OK
  • -1 - Failure.
Examples:
sd_efsl.c.