The FAT32 Embedded Flash File System for Flash Cards, EFFS-FAT
#include< api_f.h>
.
More...
|
| #define | f_delvolume(drvnumber) |
| | Un-mounts a flash card.
|
| #define | f_getfreespace(drivenum, pspace) |
| | Provides information about the drive space usage.
|
| #define | f_chdir(dirname) |
| | Change the directory.
|
| #define | f_mkdir(dirname) |
| | Makes a new directory.
|
| #define | f_rmdir(dirname) |
| | Removes a directory.
|
| #define | f_findfirst(filename, find) |
| | Find the first file or subdirectory in a specified directory.
|
| #define | f_findnext(find) |
| | Finds the next file or subdirectory in a specified directory after a previous call to f_findfirst() or f_findnext().
|
| #define | f_close(filehandle) |
| | Closes an opened file.
|
| #define | f_open(filename, mode) |
| | Opens a file in the file system.
|
| #define | f_read(buf, size, size_st, filehandle) |
| | Read data from the current position in a file.
|
| #define | f_write(buf, size, size_st, filehandle) |
| | Write data to the file at the current position.
|
| #define | f_seek(filehandle, offset, whence) |
| | Move the stream position of an open file.
|
| #define | f_rewind(filehandle) |
| | Sets the file position in the open target file to the start of the file.
|
| #define | f_eof(filehandle) |
| | Check whether the current position in the open target file is the end of the file.
|
| #define | f_gettimedate(filename, pctime, pcdate) |
| | Get the time and date of a file or directory.
|
| #define | f_settimedate(filename, ctime, cdate) |
| | Set the time and date of a file or directory.
|
| #define | f_delete(filename) |
| | Deletes a file.
|
|
| int | f_enterFS (void) |
| | Adds a new task priority to the task list used by the file system.
|
| void | f_releaseFS (void) |
| | Removes a task priority from the task list used by the file system.
|
The FAT32 Embedded Flash File System for Flash Cards, EFFS-FAT
#include< api_f.h>
.
◆ f_chdir
| #define f_chdir |
( |
| dirname | ) |
|
#include <api_f.h>
Value:
Change the directory.
- Parameters
-
| dirname | The directory to change to. |
- Return values
-
| F_NO_ERROR | If able to change to the directory |
| !F_NO_ERROR | If unable to change to the directory |
- See also
- f_mkdir()
-
f_rmdir()
◆ f_close
| #define f_close |
( |
| filehandle | ) |
|
#include <api_f.h>
Value:
Closes an opened file.
- Parameters
-
| filehandle | A handle to the file to close. |
- Return values
-
| F_NO_ERROR | If able to close the file |
| !F_NO_ERROR | If unable to close the file |
◆ f_delete
| #define f_delete |
( |
| filename | ) |
|
#include <api_f.h>
Value:
Deletes a file.
A read-only or open file cannot be deleted.
- Parameters
-
| filename | The name of the file to be deleted. |
- Return values
-
| F_NO_ERROR | If able to delete the file |
| !F_NO_ERROR | If unable to delete the file |
◆ f_delvolume
| #define f_delvolume |
( |
| drvnumber | ) |
|
#include <api_f.h>
Value:
Un-mounts a flash card.
- Parameters
-
| drvnumber | The drive to be un-mount. |
◆ f_eof
| #define f_eof |
( |
| filehandle | ) |
|
#include <api_f.h>
Value:
Check whether the current position in the open target file is the end of the file.
- Parameters
-
| filehandle | A handle to the file to check. |
- Return values
-
| 0 | Nothing at the end of the file |
| !0 | The end of the file, or an error |
◆ f_findfirst
| #define f_findfirst |
( |
| filename, |
|
|
| find ) |
#include <api_f.h>
Value:fm_findfirst(filename, find)
Find the first file or subdirectory in a specified directory.
Note: If this is called with "*.*" and this is not the root directory, the first entry found will be ".", which is the current directory.
- Parameters
-
| filename | The name of the file to find. |
| find | Where to store the found information. |
- Return values
-
| F_NO_ERROR | If the file was found |
| !F_NO_ERROR | If the file wasn't found or there are errors |
- See also
- f_findnext()
◆ f_findnext
| #define f_findnext |
( |
| find | ) |
|
#include <api_f.h>
Value:
Finds the next file or subdirectory in a specified directory after a previous call to f_findfirst() or f_findnext().
Note: If this is called with "*.*" and this is not the root directory, the first entry found will be ".", which is the current directory.
- Parameters
-
| find | Where to store the found information. |
- Return values
-
| F_NO_ERROR | If the file was found |
| !F_NO_ERROR | If the file wasn't found or there are errors |
- See also
- f_findfirst()
◆ f_getfreespace
| #define f_getfreespace |
( |
| drivenum, |
|
|
| pspace ) |
#include <api_f.h>
Value:fm_getfreespace(drivenum, pspace)
Provides information about the drive space usage.
- Parameters
-
| drivenum | The drive number to get space usage for. |
| pspace | The structure to store the usage information in. |
- Return values
-
| F_NO_ERROR | If able to get the drive space usage |
| !F_NO_ERROR | If unable to get the drive space usage |
◆ f_gettimedate
| #define f_gettimedate |
( |
| filename, |
|
|
| pctime, |
|
|
| pcdate ) |
#include <api_f.h>
Value:fm_gettimedate(filename, pctime, pcdate)
Get the time and date of a file or directory.
- Parameters
-
| filename | The name of the file or directory to modify. |
| [out] | pctime | A pointer to store the creation time of the file or directory. |
| [out] | pcdate | A pointer to store the creation date of the file or directory. |
- Return values
-
| F_NO_ERROR | If able to get time and date |
| !F_NO_ERROR | If unable to get time and date |
◆ f_mkdir
| #define f_mkdir |
( |
| dirname | ) |
|
#include <api_f.h>
Value:
Makes a new directory.
- Parameters
-
| dirname | The name to use for the new directory. |
- Return values
-
| F_NO_ERROR | If able to make the directory |
| !F_NO_ERROR | If unable to make the directory |
- See also
- f_chdir()
-
f_rmdir()
◆ f_open
| #define f_open |
( |
| filename, |
|
|
| mode ) |
#include <api_f.h>
Value:
Opens a file in the file system.
- Parameters
-
| filename | The name of the file to open. |
| mode | The mode to open the file in. The following options are available:
- "r": Reading. The stream is positioned at the beginning of the file.
- "r+": Reading and writing. The stream is positioned at the beginning of the file.
- "w": Truncate file to 0 length or create for writing. The stream is positioned at the beginning of the file.
- "w+": Reading and writing. Create if it doesn't exist, or truncate if it does. The stream is positioned at the beginning of the file.
- "a": Append, and create if it doesn't exist. The stream is positioned at the end of the file.
- "a+": Reading and appending, and create if it doesn't exist. The stream is positioned at the end of the file.
|
- Return values
-
| F_FILE* | Pointer to the file if it could be opened |
| 0 | If it a file could not be opened |
- See also
- f_close()
◆ f_read
| #define f_read |
( |
| buf, |
|
|
| size, |
|
|
| size_st, |
|
|
| filehandle ) |
#include <api_f.h>
Value:fm_read(buf, size, size_st, filehandle)
Read data from the current position in a file.
- Parameters
-
| buf | A pointer where the data should be read. |
| size | The size of the items to be read. |
| size_st | The number of items to be read. |
| filehandle | A handle to the file to read to. |
- Returns
- The number of items read.
◆ f_rewind
| #define f_rewind |
( |
| filehandle | ) |
|
#include <api_f.h>
Value:
Sets the file position in the open target file to the start of the file.
- Parameters
-
| filehandle | A handle to the file operate on. |
- Return values
-
| F_NO_ERROR | If successful |
| !F_NO_ERROR | If there was an error |
◆ f_rmdir
| #define f_rmdir |
( |
| dirname | ) |
|
#include <api_f.h>
Value:
Removes a directory.
Note: The target directory must be empty, otherwise an error code is returned.
- Parameters
-
| dirname | The name of the directory to remove. |
- Return values
-
| F_NO_ERROR | If able to remove the directory |
| !F_NO_ERROR | If unable to remove the directory |
- See also
- f_chdir()
-
f_mkdir()
◆ f_seek
| #define f_seek |
( |
| filehandle, |
|
|
| offset, |
|
|
| whence ) |
#include <api_f.h>
Value:fm_seek(filehandle, offset, whence)
Move the stream position of an open file.
- Parameters
-
| filehandle | A handle to the file to move the position of. |
| offset | The relative byte position according to whence. |
| whence | Where to calculate the offset from. Can be a value from FAT File System Seek Codes. |
- Return values
-
| F_NO_ERROR | If the seek operation was successful |
| !F_NO_ERROR | If there was an error |
◆ f_settimedate
| #define f_settimedate |
( |
| filename, |
|
|
| ctime, |
|
|
| cdate ) |
#include <api_f.h>
Value:fm_settimedate(filename, ctime, cdate)
Set the time and date of a file or directory.
- Parameters
-
| filename | The name of the file or directory to modify. |
| ctime | The creation time of the file or directory. |
| cdate | The creation date of the file or directory. |
- Return values
-
| F_NO_ERROR | If able to set time and date |
| !F_NO_ERROR | If unable to set time and date |
◆ f_write
| #define f_write |
( |
| buf, |
|
|
| size, |
|
|
| size_st, |
|
|
| filehandle ) |
#include <api_f.h>
Value:fm_write(buf, size, size_st, filehandle)
Write data to the file at the current position.
- Parameters
-
| buf | A pointer to the data to write. |
| size | The size of the items to write. |
| size_st | The number of items to write. |
| filehandle | A handle to the file to write to. |
- Returns
- The number of items written.
◆ f_enterFS()
#include <api_f.h>
Adds a new task priority to the task list used by the file system.
This function needs to be called when a new task wants to use the file system, before any other calls to other file system functions. Up to 10 tasks can be assigned to use the file system at any given time.
Note: The task priority level is associated with the task list, not the task itself. This means that a task switched priority levels and still wants to use the file system, it will need to be called again.
- Return values
-
| 0 | If successful |
| !0 | If there were errors |
- See also
- f_releaseFS()
◆ f_releaseFS()
| void f_releaseFS |
( |
void | | ) |
|
|
extern |
#include <api_f.h>
Removes a task priority from the task list used by the file system.
When a task no longer needs to use the file system, or prior to task changing priorities, this should be called. In the case of a task changing priorities, if access to the file system is still desired, another call to f_enterFS() should be made.
- See also
- f_releaseFS()