Contiki 2.5
system-timer.h
Go to the documentation of this file.
1 /** @file hal/micro/system-timer.h
2  * @brief Header file for system_timer APIs
3  *
4  *
5  * <!--(C) COPYRIGHT 2010 STMicroelectronics. All rights reserved. -->
6 
7  */
8 
9 /** @addtogroup system_timer
10  * @brief Functions that provide access to the system clock.
11  *
12  * A single system tick (as returned by ::halCommonGetInt16uMillisecondTick() and
13  * ::halCommonGetInt32uMillisecondTick() ) is approximately 1 millisecond.
14  *
15  * - When used with a 32.768kHz crystal, the system tick is 0.976 milliseconds.
16  *
17  * - When used with a 3.6864MHz crystal, the system tick is 1.111 milliseconds.
18  *
19  * A single quarter-second tick (as returned by
20  * ::halCommonGetInt16uQuarterSecondTick() ) is approximately 0.25 seconds.
21  *
22  * The values used by the time support functions will wrap after an interval.
23  * The length of the interval depends on the length of the tick and the number
24  * of bits in the value. However, there is no issue when comparing time deltas
25  * of less than half this interval with a subtraction, if all data types are the
26  * same.
27  *
28  * See system-timer.h for source code.
29  *@{
30  */
31 
32 #ifndef __SYSTEM_TIMER_H__
33 #define __SYSTEM_TIMER_H__
34 
35 /**
36  * @brief Initializes the system tick.
37  *
38  * @return Time to update the async registers after RTC is started (units of 100
39  * microseconds).
40  */
41 int16u halInternalStartSystemTimer(void);
42 
43 
44 /**
45  * @brief Returns the current system time in system ticks, as a 16-bit
46  * value.
47  *
48  * @return The least significant 16 bits of the current system time, in system
49  * ticks.
50  */
52 
53 /**
54  * @brief Returns the current system time in system ticks, as a 32-bit
55  * value.
56  *
57  * @nostackusage
58  *
59  * @return The least significant 32 bits of the current system time, in
60  * system ticks.
61  */
63 
64 /**
65  * @brief Returns the current system time in quarter second ticks, as a
66  * 16-bit value.
67  *
68  * @nostackusage
69  *
70  * @return The least significant 16 bits of the current system time, in system
71  * ticks multiplied by 256.
72  */
74 
75 #endif //__SYSTEM_TIMER_H__
76 
77 /**@} //END addtogroup
78  */
79 
80 
81 
82