Skip to content

Commit 4d4c966

Browse files
authored
[doxygen] add doxygen comment for blk.h (#9947)
Signed-off-by: 1078249029 <[email protected]>
1 parent 7432b0a commit 4d4c966

File tree

1 file changed

+51
-2
lines changed
  • components/drivers/include/drivers

1 file changed

+51
-2
lines changed

components/drivers/include/drivers/blk.h

+51-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
/*
2-
* Copyright (c) 2006-2022, RT-Thread Development Team
2+
* Copyright (c) 2006-2025 RT-Thread Development Team
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
66
* Change Logs:
77
* Date Author Notes
88
* 2023-02-25 GuEe-GUI first version
9+
* 2025-01-24 wumingzi add doxygen comment
910
*/
1011

1112
#ifndef __BLK_H__
@@ -15,10 +16,22 @@
1516
#include <rtthread.h>
1617
#include <drivers/classes/block.h>
1718

19+
/**
20+
* @addtogroup Drivers RTTHREAD Driver
21+
* @defgroup blk blk
22+
* @brief blk driver api
23+
* @ingroup Drivers
24+
* @addtogroup blk
25+
* @{
26+
*/
27+
1828
struct rt_dm_ida;
1929
struct rt_blk_device;
2030
struct rt_blk_disk_ops;
2131

32+
/**
33+
* @brief Physical blk device
34+
*/
2235
struct rt_blk_disk
2336
{
2437
struct rt_device parent;
@@ -44,6 +57,9 @@ struct rt_blk_disk
4457
struct rt_semaphore usr_lock;
4558
};
4659

60+
/**
61+
* @brief Configure the blk device.
62+
*/
4763
struct rt_blk_disk_ops
4864
{
4965
rt_ssize_t (*read)(struct rt_blk_disk *disk, rt_off_t sector, void *buffer,
@@ -60,6 +76,9 @@ struct rt_blk_disk_ops
6076
#ifndef __DFS_H__
6177
#include <dfs_fs.h>
6278

79+
/**
80+
* @brief Logical blk device, if you don't used DFS it will be defined by default.
81+
*/
6382
struct rt_blk_device
6483
{
6584
struct rt_device parent;
@@ -77,11 +96,41 @@ struct rt_blk_device
7796
struct rt_blk_device;
7897
#endif /* __DFS_H__ */
7998

99+
/**
100+
* @brief Register the blk disk device
101+
* @param disk Point to blk disk
102+
* @return rt_err_t error code
103+
*/
80104
rt_err_t rt_hw_blk_disk_register(struct rt_blk_disk *disk);
105+
106+
/**
107+
* @brief Unregister the blk disk device
108+
* @param disk Point to blk disk
109+
* @return rt_err_t error code
110+
*/
81111
rt_err_t rt_hw_blk_disk_unregister(struct rt_blk_disk *disk);
82112

113+
/**
114+
* @brief Probe and register the blk disk partition
115+
* @param disk Point to blk disk
116+
* @return rt_err_t error code
117+
*/
83118
rt_err_t rt_blk_disk_probe_partition(struct rt_blk_disk *disk);
119+
120+
/**
121+
* @brief Get the blk disk capacity
122+
* @param disk Point to blk disk
123+
* @return rt_ssize_t sector count or error code
124+
*/
84125
rt_ssize_t rt_blk_disk_get_capacity(struct rt_blk_disk *disk);
126+
127+
/**
128+
* @brief Get the sector size
129+
* @param disk Point to blk disk
130+
* @return rt_ssize_t bytes per sector or error code
131+
*/
85132
rt_ssize_t rt_blk_disk_get_logical_block_size(struct rt_blk_disk *disk);
86133

87-
#endif /* __BLK_H__ */
134+
/*! @}*/
135+
136+
#endif /* __BLK_H__ */

0 commit comments

Comments
 (0)