LibJuno 0.23.0
LibJuno is a lightweight C99 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
time_api.h
Go to the documentation of this file.
1/*
2 MIT License
3
4 Copyright (c) 2025 Robin A. Onsay
5
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files
8 (the "Software"), to deal in the Software without restriction,
9 including without limitation the rights to use, copy, modify, merge,
10 publish, distribute, sublicense, and/or sell copies of the Software,
11 and to permit persons to whom the Software is furnished to do so,
12 subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be
15 included in all copies or substantial portions of the Software.
16*/
21#ifndef JUNO_TIME_API_H
22#define JUNO_TIME_API_H
23#include "juno/status.h"
24#include "juno/module.h"
25#include <stddef.h>
26#include <stdint.h>
27#ifdef __cplusplus
28extern "C"
29{
30#endif
31
34JUNO_MODULE_BASE_DECLARE(JUNO_TIME_BASE_T);
36
37typedef uint64_t JUNO_TIME_SECONDS_T;
38typedef uint64_t JUNO_TIME_MILLIS_T;
39typedef uint64_t JUNO_TIME_MICROS_T;
40typedef uint64_t JUNO_TIME_NANOS_T;
41
43
51
53{
54 JUNO_STATUS_T (*GetTime)(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T *ptRetTime);
55 JUNO_STATUS_T (*AddTime)(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T *ptRetTime, JUNO_TIMESTAMP_T tTimeToAdd);
56 JUNO_STATUS_T (*SubtractTime)(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T *ptRetTime, JUNO_TIMESTAMP_T tTimeToSubtract);
57 JUNO_STATUS_T (*SleepTo)(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T tTimeToWakeup);
58 JUNO_STATUS_T (*Sleep)(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T tDuration);
59};
60
61#ifdef __cplusplus
62}
63#endif
64#endif // JUNO_TIME_API_H
65
#define JUNO_MODULE_BASE(name, API, members)
Definition module.h:81
#define JUNO_MODULE_EMPTY
Definition module.h:50
#define JUNO_MODULE_BASE_DECLARE(name)
Definition module.h:31
#define JUNO_MODULE_DECLARE(name)
Definition module.h:26
enum JUNO_STATUS_TAG JUNO_STATUS_T
Definition time_api.h:45
JUNO_TIME_NANOS_T iNanos
Definition time_api.h:49
JUNO_TIME_SECONDS_T iSeconds
Definition time_api.h:46
JUNO_TIME_MICROS_T iMicros
Definition time_api.h:48
JUNO_TIME_MILLIS_T iMillis
Definition time_api.h:47
Definition time_api.h:53
JUNO_STATUS_T(* SleepTo)(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T tTimeToWakeup)
Definition time_api.h:57
JUNO_STATUS_T(* GetTime)(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T *ptRetTime)
Definition time_api.h:54
JUNO_STATUS_T(* SubtractTime)(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T *ptRetTime, JUNO_TIMESTAMP_T tTimeToSubtract)
Definition time_api.h:56
JUNO_STATUS_T(* AddTime)(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T *ptRetTime, JUNO_TIMESTAMP_T tTimeToAdd)
Definition time_api.h:55
JUNO_STATUS_T(* Sleep)(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T tDuration)
Definition time_api.h:58
uint64_t JUNO_TIME_NANOS_T
Definition time_api.h:40
uint64_t JUNO_TIME_MICROS_T
Definition time_api.h:39
uint64_t JUNO_TIME_MILLIS_T
Definition time_api.h:38
uint64_t JUNO_TIME_SECONDS_T
Definition time_api.h:37