SZS ez430-RF2480 1.0

ZigBee Sensor Network with synchronized time and time-stamped measurements.
clock.h
Go to the documentation of this file.
1 /*
2  * clock.h
3  *
4  * Date: 19/06/2014
5  * Author: Fernando Biazi Nascimento
6  * Copyright © 2014 Fernando Biazi Nascimento. All rights reserved.
7  *
8  * License of use and copy on file license.txt
9  *
10  */
11 
20 #ifndef CLOCK_H_
21 #define CLOCK_H_
22 
23 /*
24  * ======== Includes ========
25  */
26 
27 #include <xdc/std.h>
28 
29 /*
30  * ======== Doxygen ========
31  */
44 /*
45  * ======== Constants ========
46  */
47 
48 /*
49  * ======== Macros ========
50  */
51 
52 /*
53  * ======== Types ========
54  */
55 
63 typedef struct clock_secondsCount {
64  UInt32 secondsLow;
65  UInt16 secondsHigh;
67 
75 typedef struct clock_timeStamp {
76  clock_secondsCount seconds;
77  UInt32 nanoSeconds;
79 
80 /*
81  * ======== Global Variables ========
82  */
83 
90 extern UInt32 clock_tickSize;
91 
92 /*
93  * ======== Global Functions ========
94  */
95 
96 void clock_init();
97 
98 void clock_tick();
100 
101 void clock_getTime(clock_timeStamp *destTime);
102 void clock_setTime(clock_timeStamp *sourceTime);
103 void clock_adjTime(int64_t *adjValue);
104 void clock_adjTimeValues(int64_t *adjValue, clock_timeStamp *time);
105 void clock_adjTick(Int32 adjValue);
106 
108 
112 #endif /* CLOCK_H_ */
void clock_adjTimeValues(int64_t *adjValue, clock_timeStamp *time)
Adjust time values.
Definition: clock.c:304
Seconds count.
Definition: clock.h:63
struct clock_secondsCount clock_secondsCount
Seconds count.
void clock_tick()
Clock tick.
Definition: clock.c:171
UInt32 clock_tickSize
Tick size (ns)
Definition: clock.c:102
Time stamp.
Definition: clock.h:75
void clock_init()
Clock Initialization.
Definition: clock.c:148
void clock_adjTick(Int32 adjValue)
Adjust tick.
Definition: clock.c:511
int64_t clock_timeDiff(clock_timeStamp *t1, clock_timeStamp *t2)
Time difference.
Definition: clock.c:533
void clock_checkDelayedTick()
Check delayed tick.
Definition: clock.c:202
struct clock_timeStamp clock_timeStamp
Time stamp.
void clock_setTime(clock_timeStamp *sourceTime)
Set time.
Definition: clock.c:237
void clock_adjTime(int64_t *adjValue)
Adjust time.
Definition: clock.c:256
void clock_getTime(clock_timeStamp *destTime)
Get time.
Definition: clock.c:218