11/*
2- * Copyright (c) 2006-2023, 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 * 2017-12-23 Bernard first version
9+ * 2025-01-30 wumingzi transform to doxygen comment
910 */
1011
1112#include <rtdevice.h>
1213#include <rtthread.h>
1314#include <sys/errno.h>
1415
16+ /**
17+ * @addtogroup Drivers RTTHREAD Driver
18+ * @defgroup cputimer cputimer
19+ * @brief cputimer driver api
20+ * @ingroup Drivers
21+ * @addtogroup cputimer
22+ * @{
23+ */
24+
1525static const struct rt_clock_cputime_ops * _cputime_ops = RT_NULL ;
1626
1727/**
18- * The clock_cpu_getres() function shall return the resolution of CPU time, the
28+ * @brief The clock_cpu_getres() function shall return the resolution of CPU time, the
1929 * number of nanosecond per tick.
2030 *
21- * @return the number of nanosecond per tick(x (1000UL * 1000))
31+ * @return the number of nanosecond per tick(x (1000UL * 1000))
2232 */
2333uint64_t clock_cpu_getres (void )
2434{
@@ -30,9 +40,9 @@ uint64_t clock_cpu_getres(void)
3040}
3141
3242/**
33- * The clock_cpu_gettime() function shall return the current value of cpu time tick.
43+ * @brief The clock_cpu_gettime() function shall return the current value of cpu time tick.
3444 *
35- * @return the cpu tick
45+ * @return the cpu tick
3646 */
3747uint64_t clock_cpu_gettime (void )
3848{
@@ -44,13 +54,14 @@ uint64_t clock_cpu_gettime(void)
4454}
4555
4656/**
47- * The clock_cpu_settimeout() fucntion set timeout time and timeout callback function
57+ * @brief The clock_cpu_settimeout() fucntion set timeout time and timeout callback function
4858 * The timeout callback function will be called when the timeout time is reached
4959 *
5060 * @param tick the Timeout tick
5161 * @param timeout the Timeout function
52- * @param parameter the Parameters of timeout function
62+ * @param param the Parameters of timeout function
5363 *
64+ * @return RT_FALSE or RT_TURE
5465 */
5566int clock_cpu_settimeout (uint64_t tick , void (* timeout )(void * param ), void * param )
5667{
@@ -61,6 +72,11 @@ int clock_cpu_settimeout(uint64_t tick, void (*timeout)(void *param), void *para
6172 return 0 ;
6273}
6374
75+ /**
76+ * @brief Check if cputimer timeout callback function has been set
77+ *
78+ * @return RT_FALSE or RT_TURE
79+ */
6480int clock_cpu_issettimeout (void )
6581{
6682 if (_cputime_ops )
@@ -69,12 +85,12 @@ int clock_cpu_issettimeout(void)
6985}
7086
7187/**
72- * The clock_cpu_microsecond() fucntion shall return the microsecond according to
88+ * @brief The clock_cpu_microsecond() fucntion shall return the microsecond according to
7389 * cpu_tick parameter.
7490 *
7591 * @param cpu_tick the cpu tick
7692 *
77- * @return the microsecond
93+ * @return the microseconds
7894 */
7995uint64_t clock_cpu_microsecond (uint64_t cpu_tick )
8096{
@@ -84,12 +100,12 @@ uint64_t clock_cpu_microsecond(uint64_t cpu_tick)
84100}
85101
86102/**
87- * The clock_cpu_microsecond () fucntion shall return the millisecond according to
103+ * @brief The clock_cpu_millisecond () fucntion shall return the millisecond according to
88104 * cpu_tick parameter.
89105 *
90106 * @param cpu_tick the cpu tick
91107 *
92- * @return the millisecond
108+ * @return the milliseconds
93109 */
94110uint64_t clock_cpu_millisecond (uint64_t cpu_tick )
95111{
@@ -99,9 +115,9 @@ uint64_t clock_cpu_millisecond(uint64_t cpu_tick)
99115}
100116
101117/**
102- * The clock_cpu_seops() function shall set the ops of cpu time.
118+ * @brief The clock_cpu_seops() function shall set the ops of cpu time.
103119 *
104- * @return always return 0.
120+ * @return always return 0.
105121 */
106122int clock_cpu_setops (const struct rt_clock_cputime_ops * ops )
107123{
@@ -114,3 +130,4 @@ int clock_cpu_setops(const struct rt_clock_cputime_ops *ops)
114130
115131 return 0 ;
116132}
133+ /*! @}*/
0 commit comments