27 #ifndef UPM_UTILITIES_H_ 28 #define UPM_UTILITIES_H_ 30 #include <upm_platform.h> 36 #if defined(UPM_PLATFORM_LINUX) 43 typedef struct timespec upm_clock_t;
46 #if defined(UPM_PLATFORM_ZEPHYR) 49 #include <sys_clock.h> 51 #include <kernel_version.h> 53 #if defined(CONFIG_STDOUT_CONSOLE) 57 #include <misc/printk.h> 61 typedef uint64_t upm_clock_t;
70 void upm_delay(uint32_t time);
77 void upm_delay_ms(uint32_t time);
84 void upm_delay_us(uint32_t time);
94 void upm_delay_ns(uint64_t time);
109 upm_clock_t upm_clock_init(
void);
119 uint64_t upm_elapsed_ms(
const upm_clock_t *clock);
129 uint64_t upm_elapsed_us(
const upm_clock_t *clock);
142 uint64_t upm_elapsed_ns(
const upm_clock_t *clock);
151 int upm_ugm3_to_aqi (
double ugm3);