mikroSDK Reference Manual
fs_port_fatfs.h
Go to the documentation of this file.
1
29#ifndef _FS_PORT_FATFS_H
30#define _FS_PORT_FATFS_H
31
32//Dependencies
33#include "os_port.h"
34#include "ff.h"
35
36//Number of files that can be opened simultaneously
37#ifndef FS_MAX_FILES
38 #define FS_MAX_FILES 8
39#elif (FS_MAX_FILES < 1)
40 #error FS_MAX_FILES parameter is not valid
41#endif
42
43//Number of directories that can be opened simultaneously
44#ifndef FS_MAX_DIRS
45 #define FS_MAX_DIRS 8
46#elif (FS_MAX_DIRS < 1)
47 #error FS_MAX_DIRS parameter is not valid
48#endif
49
50//C++ guard
51#ifdef __cplusplus
52extern "C" {
53#endif
54
55
60typedef void FsFile;
61
62
67typedef void FsDir;
68
69
70//File system abstraction layer
71error_t fsInit(void);
72
73bool_t fsFileExists(const char_t *path);
74error_t fsGetFileSize(const char_t *path, uint32_t *size);
75error_t fsGetFileStat(const char_t *path, FsFileStat *fileStat);
76error_t fsRenameFile(const char_t *oldPath, const char_t *newPath);
77error_t fsDeleteFile(const char_t *path);
78
79FsFile *fsOpenFile(const char_t *path, uint_t mode);
80error_t fsSeekFile(FsFile *file, int_t offset, uint_t origin);
81error_t fsWriteFile(FsFile *file, void *data, size_t length);
82error_t fsReadFile(FsFile *file, void *data, size_t size, size_t *length);
83void fsCloseFile(FsFile *file);
84
85bool_t fsDirExists(const char_t *path);
86error_t fsCreateDir(const char_t *path);
87error_t fsRemoveDir(const char_t *path);
88
89FsDir *fsOpenDir(const char_t *path);
90error_t fsReadDir(FsDir *dir, FsDirEntry *dirEntry);
91void fsCloseDir(FsDir *dir);
92
93//C++ guard
94#ifdef __cplusplus
95}
96#endif
97
98#endif
error_t
Error codes.
Definition error.h:43
void FsFile
File descriptor.
Definition fs_port_fatfs.h:60
void FsDir
Directory descriptor.
Definition fs_port_fatfs.h:67
RTOS abstraction layer.
Directory entry.
Definition fs_port.h:108
Directory descriptor.
Definition fs_port_posix.h:60
File status.
Definition fs_port.h:96