mikroSDK Reference Manual
fs_port.h
Go to the documentation of this file.
1
29#ifndef _FS_PORT_H
30#define _FS_PORT_H
31
32//Dependencies
33#include "fs_port_config.h"
34#include "os_port.h"
35#include "date_time.h"
36#include "error.h"
37
38//Maximum filename length
39#ifndef FS_MAX_NAME_LEN
40 #define FS_MAX_NAME_LEN 127
41#elif (FS_MAX_NAME_LEN < 11)
42 #error FS_MAX_NAME_LEN parameter is not valid
43#endif
44
45//C++ guard
46#ifdef __cplusplus
47extern "C" {
48#endif
49
50
55typedef enum
56{
57 FS_FILE_ATTR_READ_ONLY = 0x01,
58 FS_FILE_ATTR_HIDDEN = 0x02,
59 FS_FILE_ATTR_SYSTEM = 0x04,
60 FS_FILE_ATTR_VOLUME_NAME = 0x08,
61 FS_FILE_ATTR_DIRECTORY = 0x10,
62 FS_FILE_ATTR_ARCHIVE = 0x20
64
65
70typedef enum
71{
72 FS_FILE_MODE_READ = 1,
73 FS_FILE_MODE_WRITE = 2,
74 FS_FILE_MODE_CREATE = 4,
75 FS_FILE_MODE_TRUNC = 8
77
78
83typedef enum
84{
85 FS_SEEK_SET = 0,
86 FS_SEEK_CUR = 1,
87 FS_SEEK_END = 2
89
90
95typedef struct
96{
97 uint32_t attributes;
98 uint32_t size;
99 DateTime modified;
100} FsFileStat;
101
102
107typedef struct
108{
109 uint32_t attributes;
110 uint32_t size;
111 DateTime modified;
112 char_t name[FS_MAX_NAME_LEN + 1];
113} FsDirEntry;
114
115
116//FatFs port?
117#if defined(USE_FATFS)
118 #include "fs_port_fatfs.h"
119//RL-FlashFS port?
120#elif defined(USE_RL_FS)
121 #include "fs_port_rl_fs.h"
122//SPIFFS port?
123#elif defined(USE_SPIFFS)
124 #include "fs_port_spiffs.h"
125//Windows port?
126#elif defined(_WIN32)
127 #include "fs_port_posix.h"
128//POSIX port?
129#elif defined(__linux__) || defined(__FreeBSD__)
130 #include "fs_port_posix.h"
131//Custom port?
132#elif defined(USE_CUSTOM_FS)
133 #include "fs_port_custom.h"
134#endif
135
136//C++ guard
137#ifdef __cplusplus
138}
139#endif
140
141#endif
Date and time management.
Error codes description.
FsFileMode
File access mode.
Definition fs_port.h:71
FsFileAttributes
File attributes.
Definition fs_port.h:56
FsSeekOrigin
File seek origin.
Definition fs_port.h:84
File system configuration file.
File system abstraction layer (FatFs)
File system abstraction layer (POSIX)
File system abstraction layer (RL-FlashFS)
RTOS abstraction layer.
Date and time representation.
Definition date_time.h:47
Directory entry.
Definition fs_port.h:108
File status.
Definition fs_port.h:96