1 /*
2  * Copyright (C) 2015-2017 Alibaba Group Holding Limited
3  */
4 
5 #ifndef K_TIME_H
6 #define K_TIME_H
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 /** @addtogroup aos_rhino time
13  *  Time management
14  *
15  *  @{
16  */
17 
18 /**
19  * Systick routine handler.
20  *
21  * @param[in]  NULL
22  *
23  * @return  NULL
24  */
25 void krhino_tick_proc(void);
26 
27 /**
28  * Get the current time from system startup, in ms.
29  *
30  * @param[in]  NULL
31  *
32  * @return  system time
33  */
34 sys_time_t krhino_sys_time_get(void);
35 
36 /**
37  * Get the current time from system startup, in ticks.
38  *
39  * @param[in]  NULL
40  *
41  * @return  system ticks
42  */
43 tick_t krhino_sys_tick_get(void);
44 
45 /**
46  * Convert ms to ticks.
47  *
48  * @param[in]  ms  ms which will be converted to ticks
49  *
50  * @return  the ticks of the ms
51  */
52 tick_t krhino_ms_to_ticks(sys_time_t ms);
53 
54 /**
55  * Convert ticks to ms.
56  *
57  * @param[in]  ticks  ticks which will be converted to ms
58  *
59  * @return  the ms of the ticks
60  */
61 sys_time_t krhino_ticks_to_ms(tick_t ticks);
62 
63 /** @} */
64 
65 #ifdef __cplusplus
66 }
67 #endif
68 
69 #endif /* K_TIME_H */
70 
71