![]() |
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) |
uint32_t | efs_rename (const char *filename, IOB *fcb) |
uint32_t | efs_create (const char *fname, IOB *fcb) |
uint32_t | efs_delete (IOB *fcb) |
uint32_t | efs_free (EFS_VI *vi) |
uint32_t | efs_format (EFS_VI *vi) |
uint32_t | efs_ffind (fsFileInfo *info, IOB *fcb) |
uint32_t | efs_wclose (IOB *fcb) |
uint32_t | efs_read (IOB *fcb, uint8_t *buf, uint32_t len) |
uint32_t | efs_write (IOB *fcb, const uint8_t *buf, uint32_t len) |
uint32_t | efs_ensure (IOB *fcb) |
uint32_t | efs_seek (IOB *fcb, uint32_t pos) |
void | efs_fsize (IOB *fcb) |
uint32_t | efs_find (const char *name, IOB *fcb) |
int | efs_analyse (EFS_VI *vi) |
uint32_t | efs_check (EFS_VI *vi) |
uint32_t | efs_defrag (IOB *fcb) |
int | fat_init (FAT_VI *vi) |
uint32_t | fat_find (const char *fn, IOB *fcb) |
uint32_t | fat_seek (IOB *fcb, uint32_t pos) |
uint32_t | fat_read (IOB *fcb, uint8_t *buf, uint32_t len) |
uint32_t | fat_write (IOB *fcb, const uint8_t *buf, uint32_t len) |
uint64_t | fat_free (FAT_VI *vi) |
uint32_t | fat_delete (const char *fn, IOB *fcb) |
uint32_t | fat_wclose (IOB *fcb) |
uint32_t | fat_rename (const char *old, const char *newn, IOB *fcb) |
uint32_t | fat_create (const char *fn, IOB *fcb) |
uint32_t | fat_format (FAT_VI *vi, const char *param) |
uint32_t | fat_ffind (const char *fn, fsFileInfo *info, IOB *fcb) |
uint32_t | fat_jour_init (FAT_VI *vi) |
uint32_t | fat_path_valid (const char *path, IOB *fcb) |
uint32_t | fat_getlabel (IOB *fcb, char *buf) |
uint32_t | fat_attrib (IOB *fcb, const char *fn, uint32_t attrib) |
__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 | |
struct iob | _iob [NUM_FILES] |
uint16_t const | _NFILE = NUM_FILES |
uint16_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_USE (NOR0_ENABLE + NOR1_ENABLE) |
#define EXPAND_SYMBOL | ( | name, | |
port | |||
) | name##port |
#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 |
int efs_analyse | ( | EFS_VI * | vi | ) |
uint32_t efs_check | ( | EFS_VI * | vi | ) |
uint32_t efs_create | ( | const char * | fname, |
IOB * | fcb | ||
) |
uint32_t efs_defrag | ( | IOB * | fcb | ) |
uint32_t efs_delete | ( | IOB * | fcb | ) |
uint32_t efs_ensure | ( | IOB * | fcb | ) |
uint32_t efs_ffind | ( | fsFileInfo * | info, |
IOB * | fcb | ||
) |
uint32_t efs_find | ( | const char * | name, |
IOB * | fcb | ||
) |
uint32_t efs_format | ( | EFS_VI * | vi | ) |
uint32_t efs_free | ( | EFS_VI * | vi | ) |
void efs_fsize | ( | IOB * | fcb | ) |
uint32_t efs_read | ( | IOB * | fcb, |
uint8_t * | buf, | ||
uint32_t | len | ||
) |
uint32_t efs_rename | ( | const char * | filename, |
IOB * | fcb | ||
) |
uint32_t efs_seek | ( | IOB * | fcb, |
uint32_t | pos | ||
) |
uint32_t efs_wclose | ( | IOB * | fcb | ) |
uint32_t efs_write | ( | IOB * | fcb, |
const uint8_t * | buf, | ||
uint32_t | len | ||
) |
uint32_t fat_attrib | ( | IOB * | fcb, |
const char * | fn, | ||
uint32_t | attrib | ||
) |
uint32_t fat_create | ( | const char * | fn, |
IOB * | fcb | ||
) |
uint32_t fat_delete | ( | const char * | fn, |
IOB * | fcb | ||
) |
uint32_t fat_ffind | ( | const char * | fn, |
fsFileInfo * | info, | ||
IOB * | fcb | ||
) |
uint32_t fat_find | ( | const char * | fn, |
IOB * | fcb | ||
) |
uint32_t fat_format | ( | FAT_VI * | vi, |
const char * | param | ||
) |
uint64_t fat_free | ( | FAT_VI * | vi | ) |
uint32_t fat_getlabel | ( | IOB * | fcb, |
char * | buf | ||
) |
int fat_init | ( | FAT_VI * | vi | ) |
uint32_t fat_jour_init | ( | FAT_VI * | vi | ) |
uint32_t fat_path_valid | ( | const char * | path, |
IOB * | fcb | ||
) |
uint32_t fat_read | ( | IOB * | fcb, |
uint8_t * | buf, | ||
uint32_t | len | ||
) |
uint32_t fat_rename | ( | const char * | old, |
const char * | newn, | ||
IOB * | fcb | ||
) |
uint32_t fat_seek | ( | IOB * | fcb, |
uint32_t | pos | ||
) |
uint32_t fat_wclose | ( | IOB * | fcb | ) |
uint32_t fat_write | ( | IOB * | fcb, |
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" |
struct iob _iob[NUM_FILES] |
uint16_t const _NDRV = FS_NDRV |
uint16_t const _NFILE = NUM_FILES |
FAT_NCACHE_CFG fat_ncache |
FS_DEV fs_DevPool[FS_NDRV] |