![]() |
File System Component
Version 5.0
MDK-Professional Middleware for Devices with Flash File System
|
#include <absacc.h>
#include <string.h>
#include <rt_sys.h>
#include "rl_fs_lib.h"
Go to the source code of this file.
Functions | |
void | fs_config (void) |
bool | efs_path_valid (const char *path) |
int32_t | efs_handle_get (fsEFS_Volume *vol) |
fsStatus | efs_open (int32_t handle, const char *fn, int openmode) |
fsStatus | efs_close (int32_t handle) |
int32_t | efs_read (int32_t handle, uint8_t *buf, uint32_t len) |
int32_t | efs_write (int32_t handle, const uint8_t *buf, uint32_t len) |
fsStatus | efs_flush (int32_t handle) |
int32_t | efs_flen (int32_t handle) |
fsStatus | efs_seek (int32_t handle, uint32_t pos) |
fsStatus | efs_ffind (int32_t handle, fsFileInfo *info) |
fsStatus | efs_find (int32_t handle, const char *fname) |
fsStatus | efs_delete (int32_t handle) |
int32_t | efs_analyse (fsEFS_Volume *vol) |
fsStatus | efs_check (fsEFS_Volume *vol) |
fsStatus | efs_format (fsEFS_Volume *vol) |
uint32_t | efs_free (fsEFS_Volume *vol) |
fsStatus | efs_defrag (fsEFS_Volume *vol) |
int32_t | fat_handle_get (fsFAT_Volume *vol) |
fsStatus | fat_open (int32_t handle, const char *path, int32_t openmode) |
fsStatus | fat_close (int32_t handle) |
int32_t | fat_read (int32_t handle, uint8_t *buf, uint32_t len) |
int32_t | fat_write (int32_t handle, const uint8_t *buf, uint32_t len) |
int32_t | fat_flen (int32_t handle) |
fsStatus | fat_seek (int32_t handle, uint32_t pos) |
int32_t | fat_init (fsFAT_Volume *vol) |
fsStatus | fat_ffind (const char *fn, fsFileInfo *info, fsFAT_Volume *vol) |
fsStatus | fat_delete (const char *fn, fsFAT_Volume *vol) |
fsStatus | fat_rename (const char *path, const char *newname, fsFAT_Volume *vol) |
fsStatus | fat_format (fsFAT_Volume *vol, const char *opt) |
uint64_t | fat_free (fsFAT_Volume *vol) |
fsStatus | fat_attrib (fsFAT_Volume *vol, const char *fn, uint32_t attrib) |
fsStatus | fat_read_label (fsFAT_Volume *vol, char *buf) |
fsStatus | fat_read_serial (fsFAT_Volume *vol, uint32_t *serial) |
fsStatus | fat_mkdir (const char *path, fsFAT_Volume *vol) |
uint32_t | fat_jour_init (fsFAT_Volume *vi) |
uint32_t | elink_init (void) |
uint32_t | elink_init_path (const char *drvLet) |
uint32_t | elink_flush (const char *drvLet) |
uint32_t | elink_cmd (uint32_t i, uint32_t j) |
uint32_t | elink_insert (void *p, uint32_t i, uint32_t j) |
uint32_t | elink_delete (void *p, uint32_t i) |
uint32_t | elink_scan (uint32_t i, void **pp, uint32_t j) |
__weak int | stdio_getc (void) |
__weak int | stdio_putc (int ch) |
__weak void | _ttywrch (int ch) |
FILEHANDLE | _sys_open (const char *name, int openmode) |
int | _sys_close (FILEHANDLE fh) |
int | _sys_write (FILEHANDLE fh, const uint8_t *buf, uint32_t len, int mode) |
int | _sys_read (FILEHANDLE fh, uint8_t *buf, uint32_t len, int mode) |
int | _sys_istty (FILEHANDLE fh) |
int | _sys_seek (FILEHANDLE fh, long pos) |
int | _sys_ensure (FILEHANDLE fh) |
long | _sys_flen (FILEHANDLE fh) |
__weak void | _sys_exit (int return_code) |
Variables | |
fsFAT_Handle | fs_fat_fh [FAT_HANDLE_COUNT] |
uint8_t const | FS_FAT_MAX_FILES = FAT_MAX_OPEN_FILES |
fsEFS_Handle | fs_efs_fh [EFS_HANDLE_COUNT] |
uint8_t const | FS_EFS_MAX_FILES = EFS_MAX_OPEN_FILES |
uint8_t const | _NDRV = FS_NDRV |
FAT_NCACHE_CFG | fat_ncache |
FS_DEV | fs_DevPool [FS_NDRV] |
const char | __stdin_name [] = "STDIN" |
const char | __stdout_name [] = "STDOUT" |
const char | __stderr_name [] = "STDERR" |
#define __DEF |
#define CREATE_SYMBOL | ( | name, | |
port | |||
) | EXPAND_SYMBOL(name, port) |
#define EFS_HANDLE_COUNT ((EFS_MAX_OPEN_FILES > 0) ? EFS_MAX_OPEN_FILES : 1) |
#define EFS_MAX_OPEN_FILES NUM_FILES |
#define EFS_USE (NOR0_ENABLE + NOR1_ENABLE) |
#define EXPAND_SYMBOL | ( | name, | |
port | |||
) | name##port |
#define FAT_HANDLE_COUNT ((FAT_MAX_OPEN_FILES > 0) ? FAT_MAX_OPEN_FILES : 1) |
#define FAT_MAX_OPEN_FILES NUM_FILES |
#define FAT_SECT_RSVD 64 |
#define FAT_USE (RAM0_ENABLE + MC0_ENABLE + MC1_ENABLE + USB0_ENABLE + USB1_ENABLE + NAND0_ENABLE + NAND1_ENABLE) |
#define FS_FAT_NDRV |
#define FS_NAND_NDRV (NAND0_ENABLE + NAND1_ENABLE) |
#define FS_NDRV |
#define FSJ_USE |
#define MC0_DEFAULT_DRIVE 0 |
#define MC0_ENABLE 0 |
#define MC1_DEFAULT_DRIVE 0 |
#define MC1_ENABLE 0 |
#define NAND0_DEFAULT_DRIVE 0 |
#define NAND0_ENABLE 0 |
#define NAND1_DEFAULT_DRIVE 0 |
#define NAND1_ENABLE 0 |
#define NAND_INFO0 NULL |
#define NAND_INFO0_SZ 0 |
#define NAND_INFO1 NULL |
#define NAND_INFO1_SZ 0 |
#define NOR0_DEFAULT_DRIVE 0 |
#define NOR0_ENABLE 0 |
#define NOR1_DEFAULT_DRIVE 0 |
#define NOR1_ENABLE 0 |
#define RAM0_DEFAULT_DRIVE 0 |
#define RAM0_ENABLE 0 |
#define STDERR 0x8003 |
#define STDIN 0x8001 |
#define STDOUT 0x8002 |
#define STREAM_LIST_LOCK |
#define USB0_DEFAULT_DRIVE 0 |
#define USB0_ENABLE 0 |
#define USB1_DEFAULT_DRIVE 0 |
#define USB1_ENABLE 0 |
int _sys_close | ( | FILEHANDLE | fh | ) |
Defined in rt_sys.h, this function closes a file previously opened with _sys_open().
This function must be defined if any input/output function is to be used.
[in] | fh | File handle |
int _sys_ensure | ( | FILEHANDLE | fh | ) |
This function is deprecated. It is never called by any other library function, and you are not required to re-implement it if you are retargeting standard I/O (stdio).
__weak void _sys_exit | ( | int | return_code | ) |
Defined in rt_sys.h, this is the library exit function. All exits from the library eventually call _sys_exit().
This function must not return. You can intercept application exit at a higher level by either:
[in] | return_code | Library return code |
long _sys_flen | ( | FILEHANDLE | fh | ) |
Defined in rt_sys.h, this function returns the current length of a file.
This function is used by sys_seek() to convert an offset relative to the end of a file into an offset relative to the beginning of the file. You do not have to define _sys_flen() if you do not intend to use fseek(). If you retarget at system _sys*() level, you must supply _sys_flen(), even if the underlying system directly supports seeking relative to the end of a file.
[in] | fh | File handle |
int _sys_istty | ( | FILEHANDLE | fh | ) |
Defined in rt_sys.h, this function determines if a file handle identifies a terminal.
When a file is connected to a terminal device, this function is used to provide unbuffered behavior by default (in the absence of a call to set(v)buf) and to prohibit seeking.
[in] | fh | File handle |
FILEHANDLE _sys_open | ( | const char * | name, |
int | openmode | ||
) |
Defined in rt_sys.h, this function opens a file.
The _sys_open() function is required by fopen() and freopen(). These functions in turn are required if any file input/output function is to be used. The openmode parameter is a bitmap whose bits mostly correspond directly to the ISO mode specification. Target-dependent extensions are possible, but freopen() must also be extended.
[in] | name | File name |
[in] | openmode | Mode specification bitmap |
int _sys_read | ( | FILEHANDLE | fh, |
uint8_t * | buf, | ||
uint32_t | len, | ||
int | mode | ||
) |
Defined in rt_sys.h, this function reads the contents of a file into a buffer.
Reading up to and including the last byte of data does not turn on the EOF indicator. The EOF indicator is only reached when an attempt is made to read beyond the last byte of data. The target-independent code is capable of handling:
[in] | fh | File handle |
[in] | buf | Data buffer |
[in] | len | Data length |
[in] | mode | Ignore this parameter |
int _sys_seek | ( | FILEHANDLE | fh, |
long | pos | ||
) |
Defined in rt_sys.h, this function puts the file pointer at offset pos from the beginning of the file.
This function sets the current read or write position to the new location pos relative to the start of the current file fh.
[in] | fh | File handle |
[in] | pos | File pointer offset |
int _sys_write | ( | FILEHANDLE | fh, |
const uint8_t * | buf, | ||
uint32_t | len, | ||
int | mode | ||
) |
Defined in rt_sys.h, this function writes the contents of a buffer to a file previously opened with _sys_open().
[in] | fh | File handle |
[in] | buf | Data buffer |
[in] | len | Data length |
[in] | mode | Ignore this parameter |
__weak void _ttywrch | ( | int | ch | ) |
Defined in rt_sys.h, this function writes a character to the console. The console might have been redirected. You can use this function as a last resort error handling routine.
The default implementation of this function uses semihosting. You can redefine this function, or __raise(), even if there is no other input/output. For example, it might write an error message to a log kept in nonvolatile memory.
[in] | ch | character to write |
int32_t efs_analyse | ( | fsEFS_Volume * | vol | ) |
fsStatus efs_check | ( | fsEFS_Volume * | vol | ) |
fsStatus efs_close | ( | int32_t | handle | ) |
fsStatus efs_defrag | ( | fsEFS_Volume * | vol | ) |
fsStatus efs_delete | ( | int32_t | handle | ) |
fsStatus efs_ffind | ( | int32_t | handle, |
fsFileInfo * | info | ||
) |
fsStatus efs_find | ( | int32_t | handle, |
const char * | fname | ||
) |
int32_t efs_flen | ( | int32_t | handle | ) |
fsStatus efs_flush | ( | int32_t | handle | ) |
fsStatus efs_format | ( | fsEFS_Volume * | vol | ) |
uint32_t efs_free | ( | fsEFS_Volume * | vol | ) |
int32_t efs_handle_get | ( | fsEFS_Volume * | vol | ) |
fsStatus efs_open | ( | int32_t | handle, |
const char * | fn, | ||
int | openmode | ||
) |
bool efs_path_valid | ( | const char * | path | ) |
int32_t efs_read | ( | int32_t | handle, |
uint8_t * | buf, | ||
uint32_t | len | ||
) |
fsStatus efs_seek | ( | int32_t | handle, |
uint32_t | pos | ||
) |
int32_t efs_write | ( | int32_t | handle, |
const uint8_t * | buf, | ||
uint32_t | len | ||
) |
uint32_t elink_cmd | ( | uint32_t | i, |
uint32_t | j | ||
) |
uint32_t elink_delete | ( | void * | p, |
uint32_t | i | ||
) |
uint32_t elink_flush | ( | const char * | drvLet | ) |
uint32_t elink_init | ( | void | ) |
uint32_t elink_init_path | ( | const char * | drvLet | ) |
uint32_t elink_insert | ( | void * | p, |
uint32_t | i, | ||
uint32_t | j | ||
) |
uint32_t elink_scan | ( | uint32_t | i, |
void ** | pp, | ||
uint32_t | j | ||
) |
fsStatus fat_attrib | ( | fsFAT_Volume * | vol, |
const char * | fn, | ||
uint32_t | attrib | ||
) |
fsStatus fat_close | ( | int32_t | handle | ) |
fsStatus fat_delete | ( | const char * | fn, |
fsFAT_Volume * | vol | ||
) |
fsStatus fat_ffind | ( | const char * | fn, |
fsFileInfo * | info, | ||
fsFAT_Volume * | vol | ||
) |
int32_t fat_flen | ( | int32_t | handle | ) |
fsStatus fat_format | ( | fsFAT_Volume * | vol, |
const char * | opt | ||
) |
uint64_t fat_free | ( | fsFAT_Volume * | vol | ) |
int32_t fat_handle_get | ( | fsFAT_Volume * | vol | ) |
int32_t fat_init | ( | fsFAT_Volume * | vol | ) |
uint32_t fat_jour_init | ( | fsFAT_Volume * | vi | ) |
fsStatus fat_mkdir | ( | const char * | path, |
fsFAT_Volume * | vol | ||
) |
fsStatus fat_open | ( | int32_t | handle, |
const char * | path, | ||
int32_t | openmode | ||
) |
int32_t fat_read | ( | int32_t | handle, |
uint8_t * | buf, | ||
uint32_t | len | ||
) |
fsStatus fat_read_label | ( | fsFAT_Volume * | vol, |
char * | buf | ||
) |
fsStatus fat_read_serial | ( | fsFAT_Volume * | vol, |
uint32_t * | serial | ||
) |
fsStatus fat_rename | ( | const char * | path, |
const char * | newname, | ||
fsFAT_Volume * | vol | ||
) |
fsStatus fat_seek | ( | int32_t | handle, |
uint32_t | pos | ||
) |
int32_t fat_write | ( | int32_t | handle, |
const uint8_t * | buf, | ||
uint32_t | len | ||
) |
void fs_config | ( | void | ) |
__weak int stdio_getc | ( | void | ) |
__weak int stdio_putc | ( | int | ch | ) |
const char __stderr_name[] = "STDERR" |
const char __stdin_name[] = "STDIN" |
const char __stdout_name[] = "STDOUT" |
uint8_t const _NDRV = FS_NDRV |
FAT_NCACHE_CFG fat_ncache |
FS_DEV fs_DevPool[FS_NDRV] |
fsEFS_Handle fs_efs_fh[EFS_HANDLE_COUNT] |
uint8_t const FS_EFS_MAX_FILES = EFS_MAX_OPEN_FILES |
fsFAT_Handle fs_fat_fh[FAT_HANDLE_COUNT] |
uint8_t const FS_FAT_MAX_FILES = FAT_MAX_OPEN_FILES |