Wirepas SDK
wms_time.h
Go to the documentation of this file.
1 /* Copyright 2017 Wirepas Ltd. All Rights Reserved.
2  *
3  * See file LICENSE.txt for full license details.
4  *
5  */
6 
18 #ifndef APP_LIB_TIME_H_
19 #define APP_LIB_TIME_H_
20 
21 #include <stdlib.h>
22 #include <stdint.h>
23 #include <stdbool.h>
24 
26 #define APP_LIB_TIME_NAME 0x0013c24d
27 
28 
29 #define APP_LIB_TIME_VERSION 0x200
30 
41 typedef uint32_t app_lib_time_timestamp_hp_t;
42 
51 
67 
84 
92 typedef uint32_t
94 
131  uint32_t time_to_add_us);
132 
150 typedef bool
153 
169 typedef uint32_t
172 
186 typedef uint32_t
188 
192 typedef struct
193 {
202 
203 #endif /* APP_LIB_TIME_H_ */
app_lib_time_t::addUsToHpTimestamp
app_lib_time_add_us_to_timestamp_hp_f addUsToHpTimestamp
Definition: wms_time.h:197
app_lib_time_get_max_delay_hp_us_f
uint32_t(* app_lib_time_get_max_delay_hp_us_f)(void)
Return the maximum valid period for high-precision timestamps comparison.
Definition: wms_time.h:187
app_lib_time_get_timestamp_hp_f
app_lib_time_timestamp_hp_t(* app_lib_time_get_timestamp_hp_f)(void)
Get current time as a high-precision timestamp.
Definition: wms_time.h:66
app_lib_time_t::getTimestampHp
app_lib_time_get_timestamp_hp_f getTimestampHp
Definition: wms_time.h:194
app_lib_time_t::getTimestampS
app_lib_time_get_timestamp_s_f getTimestampS
Definition: wms_time.h:196
app_lib_time_t::isHpTimestampBefore
app_lib_time_is_timestamp_hp_before_f isHpTimestampBefore
Definition: wms_time.h:198
app_lib_time_is_timestamp_hp_before_f
bool(* app_lib_time_is_timestamp_hp_before_f)(app_lib_time_timestamp_hp_t time1, app_lib_time_timestamp_hp_t time2)
Compare two high-precision timestamps.
Definition: wms_time.h:151
app_lib_time_get_timestamp_coarse_f
app_lib_time_timestamp_coarse_t(* app_lib_time_get_timestamp_coarse_f)(void)
Get current time as a coarse timestamp.
Definition: wms_time.h:83
app_lib_time_get_time_difference_us_f
uint32_t(* app_lib_time_get_time_difference_us_f)(app_lib_time_timestamp_hp_t time1, app_lib_time_timestamp_hp_t time2)
Calculate the difference between two high-precision timestamps in microseconds.
Definition: wms_time.h:170
app_lib_time_t::getMaxHpDelay
app_lib_time_get_max_delay_hp_us_f getMaxHpDelay
Definition: wms_time.h:200
app_lib_time_t::getTimeDiffUs
app_lib_time_get_time_difference_us_f getTimeDiffUs
Definition: wms_time.h:199
app_lib_time_t::getTimestampCoarse
app_lib_time_get_timestamp_coarse_f getTimestampCoarse
Definition: wms_time.h:195
app_lib_time_timestamp_coarse_t
uint32_t app_lib_time_timestamp_coarse_t
Coarse timestamp type.
Definition: wms_time.h:50
app_lib_time_add_us_to_timestamp_hp_f
app_lib_time_timestamp_hp_t(* app_lib_time_add_us_to_timestamp_hp_f)(app_lib_time_timestamp_hp_t base, uint32_t time_to_add_us)
Add a given number of microseconds to a high-precision timestamp base.
Definition: wms_time.h:130
app_lib_time_get_timestamp_s_f
uint32_t(* app_lib_time_get_timestamp_s_f)(void)
Get current time as a number of seconds since the node started up.
Definition: wms_time.h:93
app_lib_time_t
List of library functions.
Definition: wms_time.h:192
app_lib_time_timestamp_hp_t
uint32_t app_lib_time_timestamp_hp_t
Highest-precision timestamp type available on the platform.
Definition: wms_time.h:41