116 lines
5.1 KiB
XML
116 lines
5.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<module xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:noNamespaceSchemaLocation="http://www.chibios.org/xml/schema/ccode/modules.xsd"
|
|
name="hal_block_io" descr="Block I/O" editcode="false">
|
|
<brief>Block devices interface.</brief>
|
|
<imports>
|
|
<import>oop_base_interface.xml</import>
|
|
</imports>
|
|
<public>
|
|
<types>
|
|
<typedef name="hal_blk_info_t">
|
|
<brief>Type of structure representing a block device information.</brief>
|
|
<basetype ctype="struct hal_blk_info" />
|
|
</typedef>
|
|
<struct name="hal_blk_info">
|
|
<brief>Block device information structure.</brief>
|
|
<fields>
|
|
<field name="blk_size" ctype="uint32_t">
|
|
<brief>Block size in bytes, usually 512.</brief>
|
|
</field>
|
|
<field name="blk_num" ctype="uint32_t">
|
|
<brief>Total number of blocks.</brief>
|
|
</field>
|
|
</fields>
|
|
</struct>
|
|
<interface name="block_io" namespace="chn"
|
|
ancestorname="base_interface" descr="block device">
|
|
<brief>Base block device interface.</brief>
|
|
<details><![CDATA[This header defines an abstract interface useful
|
|
to access generic I/O block devices in a standardized way.]]></details>
|
|
<consts>
|
|
</consts>
|
|
<methods>
|
|
<method name="blkIsInserted" shortname="is_inserted"
|
|
ctype="bool">
|
|
<brief>Removable media detection.</brief>
|
|
<return>The media state.</return>
|
|
<retval value="false">If media not inserted.</retval>
|
|
<retval value="true">If media is inserted.</retval>
|
|
<api />
|
|
</method>
|
|
<method name="blkIsWriteProtected"
|
|
shortname="is_protected" ctype="bool">
|
|
<brief>Returns the media write protection status.</brief>
|
|
<return>The media state.</return>
|
|
<retval value="false">If media is writable.</retval>
|
|
<retval value="true">If media is not writable.</retval>
|
|
<api />
|
|
</method>
|
|
<method name="blkConnect" shortname="connect"
|
|
ctype="bool">
|
|
<brief>Connection to the block device.</brief>
|
|
<return>The operation status.</return>
|
|
<retval value="false">If the operation succeeded.</retval>
|
|
<retval value="true">If the operation failed.</retval>
|
|
<api />
|
|
</method>
|
|
<method name="blkDisonnect" shortname="disconnect"
|
|
ctype="bool">
|
|
<brief>Disconnection from the block device.</brief>
|
|
<return>The operation status.</return>
|
|
<retval value="false">If the operation succeeded.</retval>
|
|
<retval value="true">If the operation failed.</retval>
|
|
<api />
|
|
</method>
|
|
<method name="blkRead" shortname="read" ctype="bool">
|
|
<brief>Reads one or more blocks.</brief>
|
|
<param name="startblk" ctype="uint32_t">Initial block to read.
|
|
</param>
|
|
<param name="buffer" ctype="uint8_t *">Pointer to the read buffer.
|
|
</param>
|
|
<param name="n" ctype="uint32_t">Number of blocks to read.
|
|
</param>
|
|
<return>The operation status.</return>
|
|
<retval value="false">If the operation succeeded.</retval>
|
|
<retval value="true">If the operation failed.</retval>
|
|
<api />
|
|
</method>
|
|
<method name="blkWrite" shortname="write" ctype="bool">
|
|
<brief>Writes one or more blocks.</brief>
|
|
<param name="startblk" ctype="uint32_t">Initial block to write.
|
|
</param>
|
|
<param name="buffer" ctype="const uint8_t *">Pointer to the write
|
|
buffer.
|
|
</param>
|
|
<param name="n" ctype="uint32_t">Number of blocks to write.
|
|
</param>
|
|
<return>The operation status.</return>
|
|
<retval value="false">If the operation succeeded.</retval>
|
|
<retval value="true">If the operation failed.</retval>
|
|
<api />
|
|
</method>
|
|
<method name="blkSync" shortname="sync" ctype="bool">
|
|
<brief>Synchronization with asynchronous write operations.</brief>
|
|
<return>The operation status.</return>
|
|
<retval value="false">If the operation succeeded.</retval>
|
|
<retval value="true">If the operation failed.</retval>
|
|
<api />
|
|
</method>
|
|
<method name="blkGetInfo" shortname="getinfo"
|
|
ctype="bool">
|
|
<brief>Writes one or more blocks.</brief>
|
|
<param name="bdip" ctype="hal_blk_info_t *">Device information buffer
|
|
pointer.</param>
|
|
<return>The operation status.</return>
|
|
<retval value="false">If the operation succeeded.</retval>
|
|
<retval value="true">If the operation failed.</retval>
|
|
<api />
|
|
</method>
|
|
</methods>
|
|
</interface>
|
|
</types>
|
|
</public>
|
|
<private>
|
|
</private>
|
|
</module> |