mirror of https://github.com/rusefi/ChibiOS.git
270 lines
10 KiB
XML
270 lines
10 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!-- C module definition -->
|
|
<module xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:noNamespaceSchemaLocation="http://www.chibios.org/xml/schema/ccode/modules.xsd"
|
|
name="drvlittlefs" descr="VFS Little Driver"
|
|
check="VFS_CFG_ENABLE_DRV_LITTLEFS == TRUE" sourcepath="drivers/littlefs"
|
|
headerpath="drivers/littlefs" editcode="true">
|
|
<imports>
|
|
<import>vfs_nodes.xml</import>
|
|
<import>vfs_drivers.xml</import>
|
|
</imports>
|
|
<public>
|
|
<includes>
|
|
<include style="regular">oop_sequential_stream.h</include>
|
|
</includes>
|
|
<configs>
|
|
<config name="DRV_CFG_LITTLEFS_FS_NUM" default="1">
|
|
<brief>Maximum number of LittleFS file systems mounted.</brief>
|
|
<assert invalid="$N < 1" />
|
|
</config>
|
|
<config name="DRV_CFG_LITTLEFS_DIR_NODES_NUM" default="1">
|
|
<brief>Number of directory nodes pre-allocated in the pool.</brief>
|
|
<assert invalid="$N < 1" />
|
|
</config>
|
|
<config name="DRV_CFG_LITTLEFS_FILE_NODES_NUM" default="1">
|
|
<brief>Number of file nodes pre-allocated in the pool.</brief>
|
|
<assert invalid="$N < 1" />
|
|
</config>
|
|
</configs>
|
|
<types>
|
|
<class type="regular" name="vfs_littlefs_driver" namespace="lfsdrv"
|
|
ancestorname="vfs_driver" descr="VFS littlefs driver">
|
|
<fields></fields>
|
|
<methods>
|
|
<objinit callsuper="true">
|
|
<implementation><![CDATA[]]></implementation>
|
|
</objinit>
|
|
<dispose>
|
|
<implementation><![CDATA[]]></implementation>
|
|
</dispose>
|
|
<override>
|
|
<method shortname="setcwd">
|
|
<implementation><![CDATA[]]></implementation>
|
|
</method>
|
|
<method shortname="getcwd">
|
|
<implementation><![CDATA[]]></implementation>
|
|
</method>
|
|
<method shortname="stat">
|
|
<implementation><![CDATA[]]></implementation>
|
|
</method>
|
|
<method shortname="opendir">
|
|
<implementation><![CDATA[]]></implementation>
|
|
</method>
|
|
<method shortname="openfile">
|
|
<implementation><![CDATA[]]></implementation>
|
|
</method>
|
|
<method shortname="unlink">
|
|
<implementation><![CDATA[]]></implementation>
|
|
</method>
|
|
<method shortname="rename">
|
|
<implementation><![CDATA[]]></implementation>
|
|
</method>
|
|
<method shortname="mkdir">
|
|
<implementation><![CDATA[]]></implementation>
|
|
</method>
|
|
<method shortname="rmdir">
|
|
<implementation><![CDATA[]]></implementation>
|
|
</method>
|
|
</override>
|
|
</methods>
|
|
</class>
|
|
</types>
|
|
<variables>
|
|
<variable name="vfs_littlefs_driver_static"
|
|
ctype="struct vfs_littlefs_driver_static_struct">
|
|
<brief>Global state of @p vfs_littlefs_driver_c</brief>
|
|
</variable>
|
|
</variables>
|
|
<functions>
|
|
<function name="__drv_littlefs_init" ctype="void">
|
|
<brief>Module initialization.</brief>
|
|
<init />
|
|
<implementation><![CDATA[
|
|
|
|
/* Initializing pools.*/
|
|
chPoolObjectInit(&vfs_littlefs_driver_static.dir_nodes_pool,
|
|
sizeof (vfs_littlefs_dir_node_c),
|
|
chCoreAllocAlignedI);
|
|
chPoolObjectInit(&vfs_littlefs_driver_static.file_nodes_pool,
|
|
sizeof (vfs_littlefs_file_node_c),
|
|
chCoreAllocAlignedI);
|
|
chPoolObjectInit(&vfs_littlefs_driver_static.info_nodes_pool,
|
|
sizeof (struct lfs_info),
|
|
chCoreAllocAlignedI);
|
|
chPoolObjectInit(&vfs_littlefs_driver_static.fs_pool,
|
|
sizeof (lfs_t),
|
|
chCoreAllocAlignedI);
|
|
|
|
/* Preloading pools.*/
|
|
chPoolLoadArray(&vfs_littlefs_driver_static.dir_nodes_pool,
|
|
&vfs_littlefs_driver_static.dir_nodes[0],
|
|
DRV_CFG_LITTLEFS_DIR_NODES_NUM);
|
|
chPoolLoadArray(&vfs_littlefs_driver_static.file_nodes_pool,
|
|
&vfs_littlefs_driver_static.file_nodes[0],
|
|
DRV_CFG_LITTLEFS_FILE_NODES_NUM);
|
|
chPoolLoadArray(&vfs_littlefs_driver_static.fs_pool,
|
|
&vfs_littlefs_driver_static.fs[0],
|
|
DRV_CFG_LITTLEFS_FS_NUM);]]></implementation>
|
|
</function>
|
|
<function name="lfsdrvMount" ctype="msg_t">
|
|
<brief>Mounts a LittleFS volume.</brief>
|
|
<param name="name" ctype="const char *" dir="in"><![CDATA[Name to
|
|
be assigned to the volume, see LittleFS @p f_mount() documentation
|
|
because there are several options.]]></param>
|
|
<param name="config" ctype="const struct lfsdrvMount *" dir="in">
|
|
LFS configuration for the mounted file system.</param>
|
|
<return>The operation result.</return>
|
|
<api />
|
|
<implementation><![CDATA[
|
|
]]></implementation>
|
|
</function>
|
|
<function name="lfsdrvUnmount" ctype="msg_t">
|
|
<brief>Unmounts a LittleFS volume.</brief>
|
|
<param name="name" ctype="const char *" dir="in">Name of the volume to
|
|
be unmounted.</param>
|
|
<return>The operation result.</return>
|
|
<api />
|
|
<implementation><![CDATA[
|
|
]]></implementation>
|
|
</function>
|
|
</functions>
|
|
</public>
|
|
<private>
|
|
<includes_always>
|
|
<include style="regular">vfs.h</include>
|
|
</includes_always>
|
|
<includes>
|
|
<include style="regular">ff.h</include>
|
|
</includes>
|
|
<types>
|
|
<class type="regular" name="vfs_littlefs_dir_node" namespace="lfsdir"
|
|
ancestorname="vfs_directory_node" descr="VFS littlefs directory node">
|
|
<fields>
|
|
<field name="dir" ctype="lfs_dir_t">
|
|
<brief>LittleFS inner @p lfs_dir_t structure.</brief>
|
|
</field>
|
|
</fields>
|
|
<methods>
|
|
<objinit callsuper="false">
|
|
<param name="driver" ctype="vfs_driver_c *" dir="in">Pointer to
|
|
the controlling driver.</param>
|
|
<param name="mode" ctype="vfs_mode_t" dir="in">Node mode flags.</param>
|
|
<implementation><![CDATA[
|
|
self = __vfsdir_objinit_impl(ip, vmt, (vfs_driver_c *)driver, mode);]]></implementation>
|
|
</objinit>
|
|
<dispose>
|
|
<implementation><![CDATA[]]></implementation>
|
|
</dispose>
|
|
<override>
|
|
<method shortname="stat">
|
|
<implementation><![CDATA[]]></implementation>
|
|
</method>
|
|
<method shortname="first">
|
|
<implementation><![CDATA[]]></implementation>
|
|
</method>
|
|
<method shortname="next">
|
|
<implementation><![CDATA[]]></implementation>
|
|
</method>
|
|
</override>
|
|
</methods>
|
|
</class>
|
|
<class type="regular" name="vfs_littlefs_file_node" namespace="lfsfile"
|
|
ancestorname="vfs_file_node" descr="VFS littlefs file node">
|
|
<implements>
|
|
<if name="sequential_stream">
|
|
<method shortname="write">
|
|
<implementation><![CDATA[
|
|
]]></implementation>
|
|
</method>
|
|
<method shortname="read">
|
|
<implementation><![CDATA[
|
|
]]></implementation>
|
|
</method>
|
|
<method shortname="put">
|
|
<implementation><![CDATA[
|
|
]]></implementation>
|
|
</method>
|
|
<method shortname="get">
|
|
<implementation><![CDATA[
|
|
]]></implementation>
|
|
</method>
|
|
</if>
|
|
</implements>
|
|
<fields>
|
|
<field name="file" ctype="lfs_file_t">
|
|
<brief>LittleFS inner @p lfs_file_t structure.</brief>
|
|
</field>
|
|
</fields>
|
|
<methods>
|
|
<objinit callsuper="false">
|
|
<param name="driver" ctype="vfs_driver_c *" dir="in">Pointer to
|
|
the controlling driver.
|
|
</param>
|
|
<param name="mode" ctype="vfs_mode_t" dir="in">Node mode flags.
|
|
</param>
|
|
<implementation><![CDATA[
|
|
self = __vfsfile_objinit_impl(ip, vmt, (vfs_driver_c *)driver, mode);]]></implementation>
|
|
</objinit>
|
|
<dispose>
|
|
<implementation><![CDATA[]]></implementation>
|
|
</dispose>
|
|
<override>
|
|
<method shortname="stat">
|
|
<implementation><![CDATA[
|
|
]]></implementation>
|
|
</method>
|
|
<method shortname="read">
|
|
<implementation><![CDATA[
|
|
]]></implementation>
|
|
</method>
|
|
<method shortname="write">
|
|
<implementation><![CDATA[
|
|
]]></implementation>
|
|
</method>
|
|
<method shortname="setpos">
|
|
<implementation><![CDATA[
|
|
]]></implementation>
|
|
</method>
|
|
<method shortname="getpos">
|
|
<implementation><![CDATA[
|
|
]]></implementation>
|
|
</method>
|
|
<method shortname="getstream">
|
|
<implementation><![CDATA[
|
|
]]></implementation>
|
|
</method>
|
|
</override>
|
|
</methods>
|
|
</class>
|
|
<struct name="vfs_littlefs_driver_static_struct">
|
|
<brief>Global state of @p vfs_littlefs_driver_c.</brief>
|
|
<fields>
|
|
<field name="fs_pool" ctype="memory_pool_t">
|
|
<brief>Pool of file system objects.</brief>
|
|
</field>
|
|
<field name="info_nodes_pool" ctype="memory_pool_t">
|
|
<brief>Pool of file info objects.</brief>
|
|
</field>
|
|
<field name="dir_nodes_pool" ctype="memory_pool_t">
|
|
<brief>Pool of directory nodes.</brief>
|
|
</field>
|
|
<field name="file_nodes_pool" ctype="memory_pool_t">
|
|
<brief>Pool of file nodes.</brief>
|
|
</field>
|
|
<field name="fs" ctype="lfs_t$I$N[DRV_CFG_LITTLEFS_FS_NUM]">
|
|
<brief>Pool of file system objects.</brief>
|
|
</field>
|
|
<field name="dir_nodes"
|
|
ctype="vfs_littlefs_dir_node_c$I$N[DRV_CFG_LITTLEFS_DIR_NODES_NUM]">
|
|
<brief>Static storage of directory nodes.</brief>
|
|
</field>
|
|
<field name="file_nodes"
|
|
ctype="vfs_littlefs_file_node_c$I$N[DRV_CFG_LITTLEFS_FILE_NODES_NUM]">
|
|
<brief>Static storage of file nodes.</brief>
|
|
</field>
|
|
</fields>
|
|
</struct>
|
|
</types>
|
|
</private>
|
|
</module> |