3939#endif /* RT_USING_DEVICE_OPS */
4040
4141/**
42- * This function registers a device driver with specified name.
42+ * @brief This function registers a device driver with a specified name.
4343 *
44- * @param dev the pointer of device driver structure
45- * @param name the device driver's name
46- * @param flags the capabilities flag of device
44+ * @param dev is the pointer of device driver structure.
45+ *
46+ * @param name is the device driver's name.
47+ *
48+ * @param flags is the capabilities flag of device.
4749 *
4850 * @return the error code, RT_EOK on initialization successfully.
4951 */
@@ -72,9 +74,9 @@ rt_err_t rt_device_register(rt_device_t dev,
7274RTM_EXPORT (rt_device_register );
7375
7476/**
75- * This function removes a previously registered device driver
77+ * @brief This function removes a previously registered device driver.
7678 *
77- * @param dev the pointer of device driver structure
79+ * @param dev is the pointer of device driver structure.
7880 *
7981 * @return the error code, RT_EOK on successfully.
8082 */
@@ -91,9 +93,9 @@ rt_err_t rt_device_unregister(rt_device_t dev)
9193RTM_EXPORT (rt_device_unregister );
9294
9395/**
94- * This function finds a device driver by specified name.
96+ * @brief This function finds a device driver by specified name.
9597 *
96- * @param name the device driver's name
98+ * @param name is the device driver's name.
9799 *
98100 * @return the registered device driver on successful, or RT_NULL on failure.
99101 */
@@ -105,10 +107,11 @@ RTM_EXPORT(rt_device_find);
105107
106108#ifdef RT_USING_HEAP
107109/**
108- * This function creates a device object with user data size.
110+ * @brief This function creates a device object with user data size.
109111 *
110- * @param type, the kind type of this device object.
111- * @param attach_size, the size of user data.
112+ * @param type is the type of the device object.
113+ *
114+ * @param attach_size is the size of user data.
112115 *
113116 * @return the allocated device object, or RT_NULL when failed.
114117 */
@@ -134,9 +137,9 @@ rt_device_t rt_device_create(int type, int attach_size)
134137RTM_EXPORT (rt_device_create );
135138
136139/**
137- * This function destroy the specific device object.
140+ * @brief This function destroy the specific device object.
138141 *
139- * @param dev, the specific device object.
142+ * @param dev is a specific device object.
140143 */
141144void rt_device_destroy (rt_device_t dev )
142145{
@@ -153,11 +156,11 @@ RTM_EXPORT(rt_device_destroy);
153156#endif /* RT_USING_HEAP */
154157
155158/**
156- * This function will initialize the specified device
159+ * @brief This function will initialize the specified device.
157160 *
158- * @param dev the pointer of device driver structure
161+ * @param dev is the pointer of device driver structure.
159162 *
160- * @return the result
163+ * @return the result, RT_EOK on successfully.
161164 */
162165rt_err_t rt_device_init (rt_device_t dev )
163166{
@@ -187,12 +190,13 @@ rt_err_t rt_device_init(rt_device_t dev)
187190}
188191
189192/**
190- * This function will open a device
193+ * @brief This function will open a device.
194+ *
195+ * @param dev is the pointer of device driver structure.
191196 *
192- * @param dev the pointer of device driver structure
193- * @param oflag the flags for device open
197+ * @param oflag is the flags for device open.
194198 *
195- * @return the result
199+ * @return the result, RT_EOK on successfully.
196200 */
197201rt_err_t rt_device_open (rt_device_t dev , rt_uint16_t oflag )
198202{
@@ -253,11 +257,11 @@ rt_err_t rt_device_open(rt_device_t dev, rt_uint16_t oflag)
253257RTM_EXPORT (rt_device_open );
254258
255259/**
256- * This function will close a device
260+ * @brief This function will close a device.
257261 *
258- * @param dev the pointer of device driver structure
262+ * @param dev is the pointer of device driver structure.
259263 *
260- * @return the result
264+ * @return the result, RT_EOK on successfully.
261265 */
262266rt_err_t rt_device_close (rt_device_t dev )
263267{
@@ -289,12 +293,15 @@ rt_err_t rt_device_close(rt_device_t dev)
289293RTM_EXPORT (rt_device_close );
290294
291295/**
292- * This function will read some data from a device.
296+ * @brief This function will read some data from a device.
297+ *
298+ * @param dev is the pointer of device driver structure.
299+ *
300+ * @param pos is the position when reading.
301+ *
302+ * @param buffer is a data buffer to save the read data.
293303 *
294- * @param dev the pointer of device driver structure
295- * @param pos the position of reading
296- * @param buffer the data buffer to save read data
297- * @param size the size of buffer
304+ * @param size is the size of buffer.
298305 *
299306 * @return the actually read size on successful, otherwise negative returned.
300307 *
@@ -328,12 +335,15 @@ rt_size_t rt_device_read(rt_device_t dev,
328335RTM_EXPORT (rt_device_read );
329336
330337/**
331- * This function will write some data to a device.
338+ * @brief This function will write some data to a device.
332339 *
333- * @param dev the pointer of device driver structure
334- * @param pos the position of written
335- * @param buffer the data buffer to be written to device
336- * @param size the size of buffer
340+ * @param dev is the pointer of device driver structure.
341+ *
342+ * @param pos is the position when writing.
343+ *
344+ * @param buffer is the data buffer to be written to device.
345+ *
346+ * @param size is the size of buffer.
337347 *
338348 * @return the actually written size on successful, otherwise negative returned.
339349 *
@@ -367,13 +377,15 @@ rt_size_t rt_device_write(rt_device_t dev,
367377RTM_EXPORT (rt_device_write );
368378
369379/**
370- * This function will perform a variety of control functions on devices.
380+ * @brief This function will perform a variety of control functions on devices.
381+ *
382+ * @param dev is the pointer of device driver structure.
371383 *
372- * @param dev the pointer of device driver structure
373- * @param cmd the command sent to device
374- * @param arg the argument of command
384+ * @param cmd is the command sent to device.
375385 *
376- * @return the result
386+ * @param arg is the argument of command.
387+ *
388+ * @return the result, -RT_ENOSYS for failed.
377389 */
378390rt_err_t rt_device_control (rt_device_t dev , int cmd , void * arg )
379391{
@@ -391,11 +403,12 @@ rt_err_t rt_device_control(rt_device_t dev, int cmd, void *arg)
391403RTM_EXPORT (rt_device_control );
392404
393405/**
394- * This function will set the reception indication callback function. This callback function
395- * is invoked when this device receives data.
406+ * @brief This function will set the reception indication callback function. This callback function
407+ * is invoked when this device receives data.
408+ *
409+ * @param dev is the pointer of device driver structure.
396410 *
397- * @param dev the pointer of device driver structure
398- * @param rx_ind the indication callback function
411+ * @param rx_ind is the indication callback function.
399412 *
400413 * @return RT_EOK
401414 */
@@ -413,11 +426,12 @@ rt_device_set_rx_indicate(rt_device_t dev,
413426RTM_EXPORT (rt_device_set_rx_indicate );
414427
415428/**
416- * This function will set the indication callback function when device has
417- * written data to physical hardware.
429+ * @brief This function will set a callback function. The callback function
430+ * will be called when device has written data to physical hardware.
431+ *
432+ * @param dev is the pointer of device driver structure.
418433 *
419- * @param dev the pointer of device driver structure
420- * @param tx_done the indication callback function
434+ * @param tx_done is the indication callback function.
421435 *
422436 * @return RT_EOK
423437 */
0 commit comments