1 /* ----> DO NOT REMOVE THE FOLLOWING NOTICE <----
\r
3 Copyright (c) 2014-2015 Datalight, Inc.
\r
4 All Rights Reserved Worldwide.
\r
6 This program is free software; you can redistribute it and/or modify
\r
7 it under the terms of the GNU General Public License as published by
\r
8 the Free Software Foundation; use version 2 of the License.
\r
10 This program is distributed in the hope that it will be useful,
\r
11 but "AS-IS," WITHOUT ANY WARRANTY; without even the implied warranty
\r
12 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 GNU General Public License for more details.
\r
15 You should have received a copy of the GNU General Public License along
\r
16 with this program; if not, write to the Free Software Foundation, Inc.,
\r
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\r
19 /* Businesses and individuals that for commercial or other reasons cannot
\r
20 comply with the terms of the GPLv2 license may obtain a commercial license
\r
21 before incorporating Reliance Edge into proprietary software for
\r
22 distribution in any form. Visit http://www.datalight.com/reliance-edge for
\r
26 @brief Interface for the Reliance Edge FSE API.
\r
28 The FSE (File Systems Essentials) API is a minimalist file system API
\r
29 intended for simple use cases with a fixed number of statically-defined
\r
30 files. It does not support creating or deleting files dynamically. Files
\r
31 are referenced by a fixed file number, rather than by name; there are no
\r
32 file names and no directories. There are also no file handles: files are
\r
33 not opened or closed, and file offsets are given explicitly.
\r
35 If the FSE API is too limited to meet the needs of your application,
\r
36 consider using the more feature-rich POSIX-like file system API instead.
\r
41 /* This header is intended for application use; some applications are written
\r
48 #include <redconf.h>
\r
50 #if REDCONF_API_FSE == 1
\r
52 #include <redtypes.h>
\r
53 #include "redapimacs.h"
\r
54 #include "rederrno.h"
\r
57 /** @brief First valid file number.
\r
59 This macro can be used to statically define file numbers for given files,
\r
60 as in the below example:
\r
63 #define LOG_FILE (RED_FILENUM_FIRST_VALID)
\r
64 #define DATABASE_FILE (RED_FILENUM_FIRST_VALID + 1U)
\r
65 #define ICON1_FILE (RED_FILENUM_FIRST_VALID + 2U)
\r
66 #define ICON2_FILE (RED_FILENUM_FIRST_VALID + 3U)
\r
69 #define RED_FILENUM_FIRST_VALID (2U)
\r
72 REDSTATUS RedFseInit(void);
\r
73 REDSTATUS RedFseUninit(void);
\r
74 REDSTATUS RedFseMount(uint8_t bVolNum);
\r
75 REDSTATUS RedFseUnmount(uint8_t bVolNum);
\r
76 #if (REDCONF_READ_ONLY == 0) && (REDCONF_API_FSE_FORMAT == 1)
\r
77 REDSTATUS RedFseFormat(uint8_t bVolNum);
\r
79 int32_t RedFseRead(uint8_t bVolNum, uint32_t ulFileNum, uint64_t ullFileOffset, uint32_t ulLength, void *pBuffer);
\r
80 #if REDCONF_READ_ONLY == 0
\r
81 int32_t RedFseWrite(uint8_t bVolNum, uint32_t ulFileNum, uint64_t ullFileOffset, uint32_t ulLength, const void *pBuffer);
\r
83 #if (REDCONF_READ_ONLY == 0) && (REDCONF_API_FSE_TRUNCATE == 1)
\r
84 REDSTATUS RedFseTruncate(uint8_t bVolNum, uint32_t ulFileNum, uint64_t ullNewFileSize);
\r
86 int64_t RedFseSizeGet(uint8_t bVolNum, uint32_t ulFileNum);
\r
87 #if (REDCONF_READ_ONLY == 0) && (REDCONF_API_FSE_TRANSMASKSET == 1)
\r
88 REDSTATUS RedFseTransMaskSet(uint8_t bVolNum, uint32_t ulEventMask);
\r
90 #if REDCONF_API_FSE_TRANSMASKGET == 1
\r
91 REDSTATUS RedFseTransMaskGet(uint8_t bVolNum, uint32_t *pulEventMask);
\r
93 #if REDCONF_READ_ONLY == 0
\r
94 REDSTATUS RedFseTransact(uint8_t bVolNum);
\r
97 #endif /* REDCONF_API_FSE == 1 */
\r