agileRTOS (zrtos)  Version 0.8.0 (ghostbuster)
time.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2024 ykat UG (haftungsbeschraenkt) - All Rights Reserved
3  *
4  * Permission for non-commercial use is hereby granted,
5  * free of charge, without warranty of any kind.
6  */
7 #ifndef ZRTOS_TIME_H
8 #define ZRTOS_TIME_H
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 
14 #include <zrtos/board.h>
15 
16 
17 typedef struct _zrtos_time_ticks_t{
18  uint64_t ticks;
20 
21 typedef struct _zrtos_time_t{
22  uint64_t ts;
24 
26  zrtos_time_ticks_t ret = {
27  .ticks = zrtos_board__get_ticks();
28  };
29  return ret;
30 }
31 
33  zrtos_time_t ret = {
34  .ts = zrtos_board__get_microseconds()
35  };
36  return ret;
37 }
38 
40  zrtos_time_t ret = {
41  .ts = zrtos_board__get_microseconds() / 1000
42  };
43  return ret;
44 }
45 
47  zrtos_time_t ret = {
48  .ts = zrtos_board__get_microseconds() / 1000000
49  };
50  return ret;
51 }
52 
53 
54 #ifdef __cplusplus
55 }
56 #endif
57 #endif
struct _zrtos_time_ticks_t zrtos_time_ticks_t
zrtos_time_t zrtos_time__get_seconds()
Definition: time.h:46
zrtos_time_t zrtos_time__get_microseconds()
Definition: time.h:32
uint64_t ticks
Definition: time.h:18
zrtos_time_t zrtos_time__get_milliseconds()
Definition: time.h:39
uint64_t ts
Definition: time.h:22
struct _zrtos_time_t zrtos_time_t
zrtos_time_ticks_t zrtos_time__get_ticks()
Definition: time.h:25