2016-07-22 17:48:59 -07:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Intel Corporation.
|
|
|
|
*
|
2017-01-18 17:01:01 -08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2016-07-22 17:48:59 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _FS_INTERFACE_H_
|
|
|
|
#define _FS_INTERFACE_H_
|
|
|
|
|
2018-02-22 13:32:57 +05:30
|
|
|
#ifdef CONFIG_FAT_FILESYSTEM_ELM
|
|
|
|
#include <ff.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_FILE_SYSTEM_NFFS
|
|
|
|
#include <nffs/nffs.h>
|
|
|
|
#endif
|
|
|
|
|
2016-07-22 17:48:59 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2018-02-22 13:32:57 +05:30
|
|
|
#ifdef CONFIG_FILE_SYSTEM_NFFS
|
|
|
|
#define MAX_FILE_NAME 256
|
|
|
|
#else /* FAT_FS */
|
|
|
|
#define MAX_FILE_NAME 12 /* Uses 8.3 SFN */
|
|
|
|
#endif
|
2016-07-22 17:48:59 -07:00
|
|
|
|
2018-02-22 13:32:57 +05:30
|
|
|
struct fs_mount_t;
|
2016-07-22 17:48:59 -07:00
|
|
|
|
2018-02-22 13:32:57 +05:30
|
|
|
/**
|
|
|
|
* @brief File object representing an open file
|
2016-07-22 17:48:59 -07:00
|
|
|
*
|
2018-02-22 13:32:57 +05:30
|
|
|
* @param fatfs_fp FATFS file object structure
|
|
|
|
* @param nffs_fp NFFS file object structure
|
|
|
|
* @param mp Pointer to mount point structure
|
2016-07-22 17:48:59 -07:00
|
|
|
*/
|
2018-02-22 13:32:57 +05:30
|
|
|
struct fs_file_t {
|
|
|
|
union {
|
|
|
|
#ifdef CONFIG_FAT_FILESYSTEM_ELM
|
|
|
|
FIL fatfs_fp;
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_FILE_SYSTEM_NFFS
|
|
|
|
struct nffs_file *nffs_fp;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
const struct fs_mount_t *mp;
|
|
|
|
};
|
2016-07-22 17:48:59 -07:00
|
|
|
|
2018-02-22 13:32:57 +05:30
|
|
|
/**
|
|
|
|
* @brief Directory object representing an open directory
|
|
|
|
*
|
|
|
|
* @param fatfs_dp FATFS directory object structure
|
|
|
|
* @param nffs_dp NFFS directory object structure
|
|
|
|
* @param mp Pointer to mount point structure
|
|
|
|
*/
|
|
|
|
struct fs_dir_t {
|
|
|
|
union {
|
2017-09-30 08:49:22 -04:00
|
|
|
#ifdef CONFIG_FAT_FILESYSTEM_ELM
|
2018-02-22 13:32:57 +05:30
|
|
|
DIR fatfs_dp;
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_FILE_SYSTEM_NFFS
|
|
|
|
struct nffs_dir *nffs_dp;
|
2016-07-22 17:48:59 -07:00
|
|
|
#endif
|
2018-02-22 13:32:57 +05:30
|
|
|
};
|
|
|
|
const struct fs_mount_t *mp;
|
|
|
|
};
|
2016-07-22 17:48:59 -07:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _FS_INTERFACE_H_ */
|