oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
Loading...
Searching...
No Matches
time.h
1/*
2 * Copyright (C) 2026 Kamil Lulko <kamil.lulko@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 *
6 * This file is part of oveRTOS.
7 */
8
26#ifndef OVE_TIME_H
27#define OVE_TIME_H
28
29#include "ove/types.h"
30#include "ove_config.h"
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36#ifdef CONFIG_OVE_TIME
37
48int ove_time_get_us(uint64_t *out);
49
61int ove_time_get_ns(uint64_t *out);
62
73void ove_time_delay_ms(uint32_t ms);
74
85void ove_time_delay_us(uint32_t us);
86
87#else /* !CONFIG_OVE_TIME */
88
89static inline int ove_time_get_us(uint64_t *o) { if (o) { *o = 0; } return OVE_ERR_NOT_SUPPORTED; }
90static inline int ove_time_get_ns(uint64_t *o) { if (o) { *o = 0; } return OVE_ERR_NOT_SUPPORTED; }
91static inline void ove_time_delay_ms(uint32_t ms) { (void)ms; }
92static inline void ove_time_delay_us(uint32_t us) { (void)us; }
93
94#endif /* CONFIG_OVE_TIME */
95
96#ifdef __cplusplus
97}
98#endif
99
/* end of ove_time group */
101
102#endif /* OVE_TIME_H */
void ove_time_delay_ms(uint32_t ms)
Block the calling task for at least ms milliseconds.
void ove_time_delay_us(uint32_t us)
Block the calling task for at least us microseconds.
int ove_time_get_ns(uint64_t *out)
Get the current monotonic time in nanoseconds.
int ove_time_get_us(uint64_t *out)
Get the current monotonic time in microseconds.
#define OVE_ERR_NOT_SUPPORTED
The requested feature is not supported by the active backend.
Definition types.h:38