|
oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
|
High-resolution timestamps and blocking delay utilities. More...
Functions | |
| int | ove_time_get_us (uint64_t *out) |
| Get the current monotonic time in microseconds. | |
| int | ove_time_get_ns (uint64_t *out) |
| Get the current monotonic time in nanoseconds. | |
| 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. | |
High-resolution timestamps and blocking delay utilities.
Provides monotonic time queries at microsecond and nanosecond resolution, as well as blocking delay functions for both millisecond and microsecond granularities.
Timestamp values are monotonically non-decreasing from an arbitrary epoch (typically system boot). The actual resolution is backend-dependent and may be coarser than the unit implies on some platforms.
CONFIG_OVE_TIME. | int ove_time_get_us | ( | uint64_t * | out | ) |
Get the current monotonic time in microseconds.
Reads the system timer and writes the elapsed microseconds since an arbitrary epoch (typically boot) to out.
| [out] | out | Receives the current timestamp in microseconds. |
CONFIG_OVE_TIME. | int ove_time_get_ns | ( | uint64_t * | out | ) |
Get the current monotonic time in nanoseconds.
Reads the system timer and writes the elapsed nanoseconds since an arbitrary epoch (typically boot) to out. Actual nanosecond resolution depends on the hardware timer; values may be rounded to the nearest tick.
| [out] | out | Receives the current timestamp in nanoseconds. |
CONFIG_OVE_TIME. | void ove_time_delay_ms | ( | uint32_t | ms | ) |
Block the calling task for at least ms milliseconds.
Suspends the current task for a minimum of ms milliseconds. The actual sleep duration may be longer due to scheduling granularity and system load. Passing 0 yields the CPU to any equal or higher-priority task.
| [in] | ms | Minimum delay in milliseconds. |
CONFIG_OVE_TIME. Must not be called from an ISR. | void ove_time_delay_us | ( | uint32_t | us | ) |
Block the calling task for at least us microseconds.
Suspends the current task for a minimum of us microseconds. For very short delays the implementation may busy-wait rather than yield, depending on the RTOS tick resolution.
| [in] | us | Minimum delay in microseconds. |
CONFIG_OVE_TIME. Must not be called from an ISR.