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
47
extern
"C"
{
48
#endif
49
50
55
typedef
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
63
}
FsFileAttributes
;
64
65
70
typedef
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
76
}
FsFileMode
;
77
78
83
typedef
enum
84
{
85
FS_SEEK_SET = 0,
86
FS_SEEK_CUR = 1,
87
FS_SEEK_END = 2
88
}
FsSeekOrigin
;
89
90
95
typedef
struct
96
{
97
uint32_t attributes;
98
uint32_t size;
99
DateTime
modified;
100
}
FsFileStat
;
101
102
107
typedef
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_time.h
Date and time management.
error.h
Error codes description.
FsFileMode
FsFileMode
File access mode.
Definition
fs_port.h:71
FsFileAttributes
FsFileAttributes
File attributes.
Definition
fs_port.h:56
FsSeekOrigin
FsSeekOrigin
File seek origin.
Definition
fs_port.h:84
fs_port_config.h
File system configuration file.
fs_port_fatfs.h
File system abstraction layer (FatFs)
fs_port_posix.h
File system abstraction layer (POSIX)
fs_port_rl_fs.h
File system abstraction layer (RL-FlashFS)
os_port.h
RTOS abstraction layer.
DateTime
Date and time representation.
Definition
date_time.h:47
FsDirEntry
Directory entry.
Definition
fs_port.h:108
FsFileStat
File status.
Definition
fs_port.h:96