2 * FreeRTOS+FAT build 191128 - Note: FreeRTOS+FAT is still in the lab!
\r
3 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
\r
4 * Authors include James Walmsley, Hein Tibosch and Richard Barry
\r
6 * Permission is hereby granted, free of charge, to any person obtaining a copy of
\r
7 * this software and associated documentation files (the "Software"), to deal in
\r
8 * the Software without restriction, including without limitation the rights to
\r
9 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
\r
10 * the Software, and to permit persons to whom the Software is furnished to do so,
\r
11 * subject to the following conditions:
\r
13 * The above copyright notice and this permission notice shall be included in all
\r
14 * copies or substantial portions of the Software.
\r
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
\r
18 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
\r
19 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
\r
20 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
23 * https://www.FreeRTOS.org
\r
30 This module allow to map several separate file-sub-systems into a root directory
\r
32 For instance, a system with 3 sub sytems:
\r
34 /flash : NAND flash driver
\r
35 /ram : RAM-disk driver
\r
38 In this example, the SD-card driver handles ALL files and directories which
\r
39 do not match /flash/ * or /ram/ *
\r
41 Now for instance a file call "/flash/etc/network.ini"
\r
42 will be stored as "/etc/network.ini" on the NAND drive
\r
44 This module along with ff_stdio.c make translations between absolute
\r
55 typedef struct FILE_SUB_SYSTEM
\r
58 BaseType_t xPathlen;
\r
59 FF_IOManager_t *pxManager;
\r
62 typedef struct FF_DIR_HANDLER
\r
77 * path will contain the relative path. It will be used when calling +FAT functions
\r
78 * like FF_FindFirst() / FF_FindNext()
\r
79 * For instance, for "/flash/etc" path will become "/etc"
\r
82 FF_IOManager_t *pxManager; /* Will point to handler of this partition. */
\r
83 BaseType_t xFSIndex; /* The index of this entry, where 0 always means: the root system. */
\r
87 * Initialise (clear) the file system table
\r
88 * This will also called by FF_FS_Add()
\r
90 void FF_FS_Init( void );
\r
94 * The path must be absolute, e.g. start with a slash
\r
95 * The second argument is the FF_Disk_t structure that is handling the driver
\r
97 int FF_FS_Add( const char *pcPath, FF_Disk_t *pxDisk );
\r
100 * Remove a file system
\r
101 * which ws earlier added by ff_fs_ad()
\r
103 void FF_FS_Remove( const char *pcPath );
\r
106 * Internally used by ff_stdio:
\r
107 * The ff_dir_handler helps to iterate through a mounte directory
\r
109 * FF_FS_Find() will find a ff_dir_handler for a given path
\r
111 int FF_FS_Find( const char *pcPath, FF_DirHandler_t *pxHandler );
\r
114 * For internal use:
\r
115 * Get the file system information, based on an index
\r
117 int FF_FS_Get( int iIndex, FF_SubSystem_t *pxSystem );
\r
120 * Returns the number of registered
\r
123 int FF_FS_Count( void );
\r
129 #endif /* FF_SYS_H */
\r