1 /*
2  * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #pragma once
8 
9 #include "esp_vfs_fat.h"
10 #include "msc_host.h"
11 #include "esp_err.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 typedef struct msc_host_vfs *msc_host_vfs_handle_t;           /**< VFS handle to attached Mass Storage device */
18 
19 /**
20  * @brief Register MSC device to Virtual filesystem.
21  *
22  * @param[in]  device  Device handle obtained from MSC callback provided upon initialization
23  * @param[in]  base_path Base VFS path to be used to access file storage
24  * @param[in]  mount_config Mount configuration.
25  * @param[out] vfs_handle Handle to MSC device associated with registered VFS
26  * @return esp_err_t
27  */
28 esp_err_t msc_host_vfs_register(msc_host_device_handle_t device,
29                                 const char *base_path,
30                                 const esp_vfs_fat_mount_config_t *mount_config,
31                                 msc_host_vfs_handle_t *vfs_handle);
32 
33 
34 /**
35  * @brief Unregister MSC device from Virtual filesystem.
36  *
37  * @param[in]  vfs_handle  VFS handle obtained from MSC callback provided upon initialization
38  * @return esp_err_t
39  */
40 esp_err_t msc_host_vfs_unregister(msc_host_vfs_handle_t vfs_handle);
41 
42 #ifdef __cplusplus
43 }
44 #endif
45