@@ -22,17 +22,21 @@ struct rt_data_item
2222};
2323
2424/**
25- * @brief This function will initialize a data queue.Calling this function will
26- * initialize the data queue control block and set the notification callback function.
25+ * @brief This function will initialize a data queue.Calling this function will
26+ * initialize the data queue control block and set the notification callback function.
2727 *
28- * @param queue The data queue object
29- * @param size The maximum number of data in the data queue
30- * @param lwm Low water mark, when the number of data in the data queue is less than this value,
31- * will wake up the thread waiting for write data.
32- * @param evt_notify The notification callback function
28+ * @param queue is a pointer to a data queue object.
3329 *
34- * @return the operation status, RT_EOK on successful,
35- * RT_ENOMEM on insufficient memory allocation failed.
30+ * @param size is the maximum number of data in the data queue.
31+ *
32+ * @param lwm is low water mark.
33+ * When the number of data in the data queue is less than this value,will
34+ * wake up the thread waiting for write data.
35+ *
36+ * @param evt_notify is the notification callback function.
37+ *
38+ * @return Return the operation status. When the return value is RT_EOK, the initialization is successful.
39+ * When the return value is RT_ENOMEM, it means insufficient memory allocation failed.
3640 */
3741rt_err_t
3842rt_data_queue_init (struct rt_data_queue * queue ,
@@ -68,15 +72,18 @@ rt_data_queue_init(struct rt_data_queue *queue,
6872RTM_EXPORT (rt_data_queue_init );
6973
7074/**
71- * @brief This function will write data to the data queue. If the data queue is full,
72- * the thread will suspend for the specified amount of time.
75+ * @brief This function will write data to the data queue. If the data queue is full,
76+ * the thread will suspend for the specified amount of time.
7377 *
74- * @param queue The data queue object
75- * @param data_ptr The buffer pointer of the data to be written
76- * @param size The size in bytes of the data to be written
77- * @param timeout The waiting time
78+ * @param queue is a pointer to a data queue object.
79+ * .
80+ * @param data_ptr is the buffer pointer of the data to be written.
7881 *
79- * @return the operation status, RT_EOK on successful
82+ * @param size is the size in bytes of the data to be written.
83+ *
84+ * @param timeout is the waiting time.
85+ *
86+ * @return Return the operation status. When the return value is RT_EOK, the operation is successful.
8087 */
8188rt_err_t rt_data_queue_push (struct rt_data_queue * queue ,
8289 const void * data_ptr ,
@@ -178,18 +185,21 @@ rt_err_t rt_data_queue_push(struct rt_data_queue *queue,
178185RTM_EXPORT (rt_data_queue_push );
179186
180187/**
181- * @brief This function will pop data from the data queue. If the data queue is empty,
182- * the thread will suspend for the specified amount of time.
188+ * @brief This function will pop data from the data queue. If the data queue is empty,the thread
189+ * will suspend for the specified amount of time.
190+ *
191+ * @note when the number of data in the data queue is less than lwm(low water mark),will
192+ * wake up the thread waiting for write data.
183193 *
184- * @attention when the number of data in the data queue is less than lwm(low water mark),
185- * will wake up the thread waiting for write data.
194+ * @param queue is a pointer to a data queue object.
186195 *
187- * @param queue The data queue object
188- * @param data_ptr The buffer pointer of the data to be fetched
189- * @param size The size in bytes of the data to be fetched
190- * @param timeout The waiting time
196+ * @param data_ptr is the buffer pointer of the data to be fetched.
191197 *
192- * @return Operation status, RT_EOK on successful, RT_ETIMEOUT on timeout.
198+ * @param size is the size in bytes of the data to be fetched.
199+ *
200+ * @param timeout is the waiting time.
201+ *
202+ * @return Return the operation status. When the return value is RT_EOK, the operation is successful.
193203 */
194204rt_err_t rt_data_queue_pop (struct rt_data_queue * queue ,
195205 const void * * data_ptr ,
@@ -303,13 +313,15 @@ rt_err_t rt_data_queue_pop(struct rt_data_queue *queue,
303313RTM_EXPORT (rt_data_queue_pop );
304314
305315/**
306- * @brief This function will fetching but retaining data in the data queue.
316+ * @brief This function will fetching but retaining data in the data queue.
317+ *
318+ * @param queue is a pointer to a data queue object.
307319 *
308- * @param queue The data queue object
309- * @param data_ptr The buffer pointer of the data to be fetched
310- * @param size The size in bytes of the data to be fetched
320+ * @param data_ptr is the buffer pointer of the data to be fetched.
311321 *
312- * @return The operation status, RT_EOK on successful
322+ * @param size is the size in bytes of the data to be fetched.
323+ *
324+ * @return Return the operation status. When the return value is RT_EOK, the operation is successful.
313325 */
314326rt_err_t rt_data_queue_peek (struct rt_data_queue * queue ,
315327 const void * * data_ptr ,
@@ -337,10 +349,12 @@ rt_err_t rt_data_queue_peek(struct rt_data_queue *queue,
337349RTM_EXPORT (rt_data_queue_peek );
338350
339351/**
340- * @brief Reset a data queue. Calling this function will wake up all threads on the data queue
341- * that are hanging and waiting.
352+ * @brief This function will reset a data queue.
353+ *
354+ * @note Calling this function will wake up all threads on the data queue
355+ * that are hanging and waiting.
342356 *
343- * @param queue The data queue object
357+ * @param queue is a pointer to a data queue object.
344358 */
345359void rt_data_queue_reset (struct rt_data_queue * queue )
346360{
@@ -416,11 +430,11 @@ void rt_data_queue_reset(struct rt_data_queue *queue)
416430RTM_EXPORT (rt_data_queue_reset );
417431
418432/**
419- * @brief Deinit a data queue.
433+ * @brief This function will deinit a data queue.
420434 *
421- * @param queue The data queue object
435+ * @param queue is a pointer to a data queue object.
422436 *
423- * @return operation status, RT_EOK on successful.
437+ * @return Return the operation status. When the return value is RT_EOK, the operation is successful.
424438 */
425439rt_err_t rt_data_queue_deinit (struct rt_data_queue * queue )
426440{
@@ -443,10 +457,11 @@ rt_err_t rt_data_queue_deinit(struct rt_data_queue *queue)
443457RTM_EXPORT (rt_data_queue_deinit );
444458
445459/**
446- * @brief This function get the number of data in the data queue.
460+ * @brief This function will get the number of data in the data queue.
461+ *
462+ * @param queue is a pointer to a data queue object.
447463 *
448- * @param queue The data queue object
449- * @return The number of data in the data queue
464+ * @return Return the number of data in the data queue.
450465 */
451466rt_uint16_t rt_data_queue_len (struct rt_data_queue * queue )
452467{
0 commit comments