Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
|
Various helper APIs for converting between time units. More...
Macros | |
#define | SYS_FOREVER_MS (-1) |
System-wide macro to denote "forever" in milliseconds. | |
#define | SYS_FOREVER_US (-1) |
System-wide macro to denote "forever" in microseconds. | |
#define | SYS_TIMEOUT_MS(ms) |
System-wide macro to convert milliseconds to kernel timeouts. | |
#define | TIME_CONSTEXPR |
#define | sys_clock_hw_cycles_per_sec() |
Get the system timer frequency. | |
#define | k_sec_to_cyc_floor32(t) |
Convert seconds to hardware cycles. | |
#define | k_sec_to_cyc_floor64(t) |
Convert seconds to hardware cycles. | |
#define | k_sec_to_cyc_near32(t) |
Convert seconds to hardware cycles. | |
#define | k_sec_to_cyc_near64(t) |
Convert seconds to hardware cycles. | |
#define | k_sec_to_cyc_ceil32(t) |
Convert seconds to hardware cycles. | |
#define | k_sec_to_cyc_ceil64(t) |
Convert seconds to hardware cycles. | |
#define | k_sec_to_ticks_floor32(t) |
Convert seconds to ticks. | |
#define | k_sec_to_ticks_floor64(t) |
Convert seconds to ticks. | |
#define | k_sec_to_ticks_near32(t) |
Convert seconds to ticks. | |
#define | k_sec_to_ticks_near64(t) |
Convert seconds to ticks. | |
#define | k_sec_to_ticks_ceil32(t) |
Convert seconds to ticks. | |
#define | k_sec_to_ticks_ceil64(t) |
Convert seconds to ticks. | |
#define | k_ms_to_cyc_floor32(t) |
Convert milliseconds to hardware cycles. | |
#define | k_ms_to_cyc_floor64(t) |
Convert milliseconds to hardware cycles. | |
#define | k_ms_to_cyc_near32(t) |
Convert milliseconds to hardware cycles. | |
#define | k_ms_to_cyc_near64(t) |
Convert milliseconds to hardware cycles. | |
#define | k_ms_to_cyc_ceil32(t) |
Convert milliseconds to hardware cycles. | |
#define | k_ms_to_cyc_ceil64(t) |
Convert milliseconds to hardware cycles. | |
#define | k_ms_to_ticks_floor32(t) |
Convert milliseconds to ticks. | |
#define | k_ms_to_ticks_floor64(t) |
Convert milliseconds to ticks. | |
#define | k_ms_to_ticks_near32(t) |
Convert milliseconds to ticks. | |
#define | k_ms_to_ticks_near64(t) |
Convert milliseconds to ticks. | |
#define | k_ms_to_ticks_ceil32(t) |
Convert milliseconds to ticks. | |
#define | k_ms_to_ticks_ceil64(t) |
Convert milliseconds to ticks. | |
#define | k_us_to_cyc_floor32(t) |
Convert microseconds to hardware cycles. | |
#define | k_us_to_cyc_floor64(t) |
Convert microseconds to hardware cycles. | |
#define | k_us_to_cyc_near32(t) |
Convert microseconds to hardware cycles. | |
#define | k_us_to_cyc_near64(t) |
Convert microseconds to hardware cycles. | |
#define | k_us_to_cyc_ceil32(t) |
Convert microseconds to hardware cycles. | |
#define | k_us_to_cyc_ceil64(t) |
Convert microseconds to hardware cycles. | |
#define | k_us_to_ticks_floor32(t) |
Convert microseconds to ticks. | |
#define | k_us_to_ticks_floor64(t) |
Convert microseconds to ticks. | |
#define | k_us_to_ticks_near32(t) |
Convert microseconds to ticks. | |
#define | k_us_to_ticks_near64(t) |
Convert microseconds to ticks. | |
#define | k_us_to_ticks_ceil32(t) |
Convert microseconds to ticks. | |
#define | k_us_to_ticks_ceil64(t) |
Convert microseconds to ticks. | |
#define | k_ns_to_cyc_floor32(t) |
Convert nanoseconds to hardware cycles. | |
#define | k_ns_to_cyc_floor64(t) |
Convert nanoseconds to hardware cycles. | |
#define | k_ns_to_cyc_near32(t) |
Convert nanoseconds to hardware cycles. | |
#define | k_ns_to_cyc_near64(t) |
Convert nanoseconds to hardware cycles. | |
#define | k_ns_to_cyc_ceil32(t) |
Convert nanoseconds to hardware cycles. | |
#define | k_ns_to_cyc_ceil64(t) |
Convert nanoseconds to hardware cycles. | |
#define | k_ns_to_ticks_floor32(t) |
Convert nanoseconds to ticks. | |
#define | k_ns_to_ticks_floor64(t) |
Convert nanoseconds to ticks. | |
#define | k_ns_to_ticks_near32(t) |
Convert nanoseconds to ticks. | |
#define | k_ns_to_ticks_near64(t) |
Convert nanoseconds to ticks. | |
#define | k_ns_to_ticks_ceil32(t) |
Convert nanoseconds to ticks. | |
#define | k_ns_to_ticks_ceil64(t) |
Convert nanoseconds to ticks. | |
#define | k_cyc_to_sec_floor32(t) |
Convert hardware cycles to seconds. | |
#define | k_cyc_to_sec_floor64(t) |
Convert hardware cycles to seconds. | |
#define | k_cyc_to_sec_near32(t) |
Convert hardware cycles to seconds. | |
#define | k_cyc_to_sec_near64(t) |
Convert hardware cycles to seconds. | |
#define | k_cyc_to_sec_ceil32(t) |
Convert hardware cycles to seconds. | |
#define | k_cyc_to_sec_ceil64(t) |
Convert hardware cycles to seconds. | |
#define | k_cyc_to_ms_floor32(t) |
Convert hardware cycles to milliseconds. | |
#define | k_cyc_to_ms_floor64(t) |
Convert hardware cycles to milliseconds. | |
#define | k_cyc_to_ms_near32(t) |
Convert hardware cycles to milliseconds. | |
#define | k_cyc_to_ms_near64(t) |
Convert hardware cycles to milliseconds. | |
#define | k_cyc_to_ms_ceil32(t) |
Convert hardware cycles to milliseconds. | |
#define | k_cyc_to_ms_ceil64(t) |
Convert hardware cycles to milliseconds. | |
#define | k_cyc_to_us_floor32(t) |
Convert hardware cycles to microseconds. | |
#define | k_cyc_to_us_floor64(t) |
Convert hardware cycles to microseconds. | |
#define | k_cyc_to_us_near32(t) |
Convert hardware cycles to microseconds. | |
#define | k_cyc_to_us_near64(t) |
Convert hardware cycles to microseconds. | |
#define | k_cyc_to_us_ceil32(t) |
Convert hardware cycles to microseconds. | |
#define | k_cyc_to_us_ceil64(t) |
Convert hardware cycles to microseconds. | |
#define | k_cyc_to_ns_floor32(t) |
Convert hardware cycles to nanoseconds. | |
#define | k_cyc_to_ns_floor64(t) |
Convert hardware cycles to nanoseconds. | |
#define | k_cyc_to_ns_near32(t) |
Convert hardware cycles to nanoseconds. | |
#define | k_cyc_to_ns_near64(t) |
Convert hardware cycles to nanoseconds. | |
#define | k_cyc_to_ns_ceil32(t) |
Convert hardware cycles to nanoseconds. | |
#define | k_cyc_to_ns_ceil64(t) |
Convert hardware cycles to nanoseconds. | |
#define | k_cyc_to_ticks_floor32(t) |
Convert hardware cycles to ticks. | |
#define | k_cyc_to_ticks_floor64(t) |
Convert hardware cycles to ticks. | |
#define | k_cyc_to_ticks_near32(t) |
Convert hardware cycles to ticks. | |
#define | k_cyc_to_ticks_near64(t) |
Convert hardware cycles to ticks. | |
#define | k_cyc_to_ticks_ceil32(t) |
Convert hardware cycles to ticks. | |
#define | k_cyc_to_ticks_ceil64(t) |
Convert hardware cycles to ticks. | |
#define | k_ticks_to_sec_floor32(t) |
Convert ticks to seconds. | |
#define | k_ticks_to_sec_floor64(t) |
Convert ticks to seconds. | |
#define | k_ticks_to_sec_near32(t) |
Convert ticks to seconds. | |
#define | k_ticks_to_sec_near64(t) |
Convert ticks to seconds. | |
#define | k_ticks_to_sec_ceil32(t) |
Convert ticks to seconds. | |
#define | k_ticks_to_sec_ceil64(t) |
Convert ticks to seconds. | |
#define | k_ticks_to_ms_floor32(t) |
Convert ticks to milliseconds. | |
#define | k_ticks_to_ms_floor64(t) |
Convert ticks to milliseconds. | |
#define | k_ticks_to_ms_near32(t) |
Convert ticks to milliseconds. | |
#define | k_ticks_to_ms_near64(t) |
Convert ticks to milliseconds. | |
#define | k_ticks_to_ms_ceil32(t) |
Convert ticks to milliseconds. | |
#define | k_ticks_to_ms_ceil64(t) |
Convert ticks to milliseconds. | |
#define | k_ticks_to_us_floor32(t) |
Convert ticks to microseconds. | |
#define | k_ticks_to_us_floor64(t) |
Convert ticks to microseconds. | |
#define | k_ticks_to_us_near32(t) |
Convert ticks to microseconds. | |
#define | k_ticks_to_us_near64(t) |
Convert ticks to microseconds. | |
#define | k_ticks_to_us_ceil32(t) |
Convert ticks to microseconds. | |
#define | k_ticks_to_us_ceil64(t) |
Convert ticks to microseconds. | |
#define | k_ticks_to_ns_floor32(t) |
Convert ticks to nanoseconds. | |
#define | k_ticks_to_ns_floor64(t) |
Convert ticks to nanoseconds. | |
#define | k_ticks_to_ns_near32(t) |
Convert ticks to nanoseconds. | |
#define | k_ticks_to_ns_near64(t) |
Convert ticks to nanoseconds. | |
#define | k_ticks_to_ns_ceil32(t) |
Convert ticks to nanoseconds. | |
#define | k_ticks_to_ns_ceil64(t) |
Convert ticks to nanoseconds. | |
#define | k_ticks_to_cyc_floor32(t) |
Convert ticks to hardware cycles. | |
#define | k_ticks_to_cyc_floor64(t) |
Convert ticks to hardware cycles. | |
#define | k_ticks_to_cyc_near32(t) |
Convert ticks to hardware cycles. | |
#define | k_ticks_to_cyc_near64(t) |
Convert ticks to hardware cycles. | |
#define | k_ticks_to_cyc_ceil32(t) |
Convert ticks to hardware cycles. | |
#define | k_ticks_to_cyc_ceil64(t) |
Convert ticks to hardware cycles. | |
Various helper APIs for converting between time units.
#define k_cyc_to_ms_ceil32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to milliseconds.
32 bits. Rounds up.
Converts time values in hardware cycles to milliseconds. Computes result in 32 bit precision. Rounds up to the next highest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_ms_ceil64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to milliseconds.
64 bits. Rounds up.
Converts time values in hardware cycles to milliseconds. Computes result in 64 bit precision. Rounds up to the next highest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_ms_floor32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to milliseconds.
32 bits. Truncates.
Converts time values in hardware cycles to milliseconds. Computes result in 32 bit precision. Truncates to the next lowest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_ms_floor64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to milliseconds.
64 bits. Truncates.
Converts time values in hardware cycles to milliseconds. Computes result in 64 bit precision. Truncates to the next lowest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_ms_near32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to milliseconds.
32 bits. Round nearest.
Converts time values in hardware cycles to milliseconds. Computes result in 32 bit precision. Rounds to the nearest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_ms_near64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to milliseconds.
64 bits. Round nearest.
Converts time values in hardware cycles to milliseconds. Computes result in 64 bit precision. Rounds to the nearest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_ns_ceil32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to nanoseconds.
32 bits. Rounds up.
Converts time values in hardware cycles to nanoseconds. Computes result in 32 bit precision. Rounds up to the next highest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_ns_ceil64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to nanoseconds.
64 bits. Rounds up.
Converts time values in hardware cycles to nanoseconds. Computes result in 64 bit precision. Rounds up to the next highest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_ns_floor32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to nanoseconds.
32 bits. Truncates.
Converts time values in hardware cycles to nanoseconds. Computes result in 32 bit precision. Truncates to the next lowest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_ns_floor64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to nanoseconds.
64 bits. Truncates.
Converts time values in hardware cycles to nanoseconds. Computes result in 64 bit precision. Truncates to the next lowest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_ns_near32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to nanoseconds.
32 bits. Round nearest.
Converts time values in hardware cycles to nanoseconds. Computes result in 32 bit precision. Rounds to the nearest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_ns_near64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to nanoseconds.
64 bits. Round nearest.
Converts time values in hardware cycles to nanoseconds. Computes result in 64 bit precision. Rounds to the nearest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_sec_ceil32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to seconds.
32 bits. Rounds up.
Converts time values in hardware cycles to seconds. Computes result in 32 bit precision. Rounds up to the next highest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_sec_ceil64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to seconds.
64 bits. Rounds up.
Converts time values in hardware cycles to seconds. Computes result in 64 bit precision. Rounds up to the next highest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_sec_floor32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to seconds.
32 bits. Truncates.
Converts time values in hardware cycles to seconds. Computes result in 32 bit precision. Truncates to the next lowest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_sec_floor64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to seconds.
64 bits. Truncates.
Converts time values in hardware cycles to seconds. Computes result in 64 bit precision. Truncates to the next lowest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_sec_near32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to seconds.
32 bits. Round nearest.
Converts time values in hardware cycles to seconds. Computes result in 32 bit precision. Rounds to the nearest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_sec_near64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to seconds.
64 bits. Round nearest.
Converts time values in hardware cycles to seconds. Computes result in 64 bit precision. Rounds to the nearest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_ticks_ceil32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to ticks.
32 bits. Rounds up.
Converts time values in hardware cycles to ticks. Computes result in 32 bit precision. Rounds up to the next highest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_ticks_ceil64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to ticks.
64 bits. Rounds up.
Converts time values in hardware cycles to ticks. Computes result in 64 bit precision. Rounds up to the next highest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_ticks_floor32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to ticks.
32 bits. Truncates.
Converts time values in hardware cycles to ticks. Computes result in 32 bit precision. Truncates to the next lowest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_ticks_floor64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to ticks.
64 bits. Truncates.
Converts time values in hardware cycles to ticks. Computes result in 64 bit precision. Truncates to the next lowest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_ticks_near32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to ticks.
32 bits. Round nearest.
Converts time values in hardware cycles to ticks. Computes result in 32 bit precision. Rounds to the nearest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_ticks_near64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to ticks.
64 bits. Round nearest.
Converts time values in hardware cycles to ticks. Computes result in 64 bit precision. Rounds to the nearest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_us_ceil32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to microseconds.
32 bits. Rounds up.
Converts time values in hardware cycles to microseconds. Computes result in 32 bit precision. Rounds up to the next highest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_us_ceil64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to microseconds.
64 bits. Rounds up.
Converts time values in hardware cycles to microseconds. Computes result in 64 bit precision. Rounds up to the next highest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_us_floor32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to microseconds.
32 bits. Truncates.
Converts time values in hardware cycles to microseconds. Computes result in 32 bit precision. Truncates to the next lowest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_us_floor64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to microseconds.
64 bits. Truncates.
Converts time values in hardware cycles to microseconds. Computes result in 64 bit precision. Truncates to the next lowest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_us_near32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to microseconds.
32 bits. Round nearest.
Converts time values in hardware cycles to microseconds. Computes result in 32 bit precision. Rounds to the nearest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_cyc_to_us_near64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert hardware cycles to microseconds.
64 bits. Round nearest.
Converts time values in hardware cycles to microseconds. Computes result in 64 bit precision. Rounds to the nearest output unit.
t | Source time in hardware cycles. uint64_t |
#define k_ms_to_cyc_ceil32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert milliseconds to hardware cycles.
32 bits. Rounds up.
Converts time values in milliseconds to hardware cycles. Computes result in 32 bit precision. Rounds up to the next highest output unit.
t | Source time in milliseconds. uint64_t |
#define k_ms_to_cyc_ceil64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert milliseconds to hardware cycles.
64 bits. Rounds up.
Converts time values in milliseconds to hardware cycles. Computes result in 64 bit precision. Rounds up to the next highest output unit.
t | Source time in milliseconds. uint64_t |
#define k_ms_to_cyc_floor32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert milliseconds to hardware cycles.
32 bits. Truncates.
Converts time values in milliseconds to hardware cycles. Computes result in 32 bit precision. Truncates to the next lowest output unit.
t | Source time in milliseconds. uint64_t |
#define k_ms_to_cyc_floor64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert milliseconds to hardware cycles.
64 bits. Truncates.
Converts time values in milliseconds to hardware cycles. Computes result in 64 bit precision. Truncates to the next lowest output unit.
t | Source time in milliseconds. uint64_t |
#define k_ms_to_cyc_near32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert milliseconds to hardware cycles.
32 bits. Round nearest.
Converts time values in milliseconds to hardware cycles. Computes result in 32 bit precision. Rounds to the nearest output unit.
t | Source time in milliseconds. uint64_t |
#define k_ms_to_cyc_near64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert milliseconds to hardware cycles.
64 bits. Round nearest.
Converts time values in milliseconds to hardware cycles. Computes result in 64 bit precision. Rounds to the nearest output unit.
t | Source time in milliseconds. uint64_t |
#define k_ms_to_ticks_ceil32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert milliseconds to ticks.
32 bits. Rounds up.
Converts time values in milliseconds to ticks. Computes result in 32 bit precision. Rounds up to the next highest output unit.
t | Source time in milliseconds. uint64_t |
#define k_ms_to_ticks_ceil64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert milliseconds to ticks.
64 bits. Rounds up.
Converts time values in milliseconds to ticks. Computes result in 64 bit precision. Rounds up to the next highest output unit.
t | Source time in milliseconds. uint64_t |
#define k_ms_to_ticks_floor32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert milliseconds to ticks.
32 bits. Truncates.
Converts time values in milliseconds to ticks. Computes result in 32 bit precision. Truncates to the next lowest output unit.
t | Source time in milliseconds. uint64_t |
#define k_ms_to_ticks_floor64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert milliseconds to ticks.
64 bits. Truncates.
Converts time values in milliseconds to ticks. Computes result in 64 bit precision. Truncates to the next lowest output unit.
t | Source time in milliseconds. uint64_t |
#define k_ms_to_ticks_near32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert milliseconds to ticks.
32 bits. Round nearest.
Converts time values in milliseconds to ticks. Computes result in 32 bit precision. Rounds to the nearest output unit.
t | Source time in milliseconds. uint64_t |
#define k_ms_to_ticks_near64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert milliseconds to ticks.
64 bits. Round nearest.
Converts time values in milliseconds to ticks. Computes result in 64 bit precision. Rounds to the nearest output unit.
t | Source time in milliseconds. uint64_t |
#define k_ns_to_cyc_ceil32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert nanoseconds to hardware cycles.
32 bits. Rounds up.
Converts time values in nanoseconds to hardware cycles. Computes result in 32 bit precision. Rounds up to the next highest output unit.
t | Source time in nanoseconds. uint64_t |
#define k_ns_to_cyc_ceil64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert nanoseconds to hardware cycles.
64 bits. Rounds up.
Converts time values in nanoseconds to hardware cycles. Computes result in 64 bit precision. Rounds up to the next highest output unit.
t | Source time in nanoseconds. uint64_t |
#define k_ns_to_cyc_floor32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert nanoseconds to hardware cycles.
32 bits. Truncates.
Converts time values in nanoseconds to hardware cycles. Computes result in 32 bit precision. Truncates to the next lowest output unit.
t | Source time in nanoseconds. uint64_t |
#define k_ns_to_cyc_floor64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert nanoseconds to hardware cycles.
64 bits. Truncates.
Converts time values in nanoseconds to hardware cycles. Computes result in 64 bit precision. Truncates to the next lowest output unit.
t | Source time in nanoseconds. uint64_t |
#define k_ns_to_cyc_near32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert nanoseconds to hardware cycles.
32 bits. Round nearest.
Converts time values in nanoseconds to hardware cycles. Computes result in 32 bit precision. Rounds to the nearest output unit.
t | Source time in nanoseconds. uint64_t |
#define k_ns_to_cyc_near64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert nanoseconds to hardware cycles.
64 bits. Round nearest.
Converts time values in nanoseconds to hardware cycles. Computes result in 64 bit precision. Rounds to the nearest output unit.
t | Source time in nanoseconds. uint64_t |
#define k_ns_to_ticks_ceil32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert nanoseconds to ticks.
32 bits. Rounds up.
Converts time values in nanoseconds to ticks. Computes result in 32 bit precision. Rounds up to the next highest output unit.
t | Source time in nanoseconds. uint64_t |
#define k_ns_to_ticks_ceil64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert nanoseconds to ticks.
64 bits. Rounds up.
Converts time values in nanoseconds to ticks. Computes result in 64 bit precision. Rounds up to the next highest output unit.
t | Source time in nanoseconds. uint64_t |
#define k_ns_to_ticks_floor32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert nanoseconds to ticks.
32 bits. Truncates.
Converts time values in nanoseconds to ticks. Computes result in 32 bit precision. Truncates to the next lowest output unit.
t | Source time in nanoseconds. uint64_t |
#define k_ns_to_ticks_floor64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert nanoseconds to ticks.
64 bits. Truncates.
Converts time values in nanoseconds to ticks. Computes result in 64 bit precision. Truncates to the next lowest output unit.
t | Source time in nanoseconds. uint64_t |
#define k_ns_to_ticks_near32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert nanoseconds to ticks.
32 bits. Round nearest.
Converts time values in nanoseconds to ticks. Computes result in 32 bit precision. Rounds to the nearest output unit.
t | Source time in nanoseconds. uint64_t |
#define k_ns_to_ticks_near64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert nanoseconds to ticks.
64 bits. Round nearest.
Converts time values in nanoseconds to ticks. Computes result in 64 bit precision. Rounds to the nearest output unit.
t | Source time in nanoseconds. uint64_t |
#define k_sec_to_cyc_ceil32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert seconds to hardware cycles.
32 bits. Rounds up.
Converts time values in seconds to hardware cycles. Computes result in 32 bit precision. Rounds up to the next highest output unit.
t | Source time in seconds. uint64_t |
#define k_sec_to_cyc_ceil64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert seconds to hardware cycles.
64 bits. Rounds up.
Converts time values in seconds to hardware cycles. Computes result in 64 bit precision. Rounds up to the next highest output unit.
t | Source time in seconds. uint64_t |
#define k_sec_to_cyc_floor32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert seconds to hardware cycles.
32 bits. Truncates.
Converts time values in seconds to hardware cycles. Computes result in 32 bit precision. Truncates to the next lowest output unit.
t | Source time in seconds. uint64_t |
#define k_sec_to_cyc_floor64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert seconds to hardware cycles.
64 bits. Truncates.
Converts time values in seconds to hardware cycles. Computes result in 64 bit precision. Truncates to the next lowest output unit.
t | Source time in seconds. uint64_t |
#define k_sec_to_cyc_near32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert seconds to hardware cycles.
32 bits. Round nearest.
Converts time values in seconds to hardware cycles. Computes result in 32 bit precision. Rounds to the nearest output unit.
t | Source time in seconds. uint64_t |
#define k_sec_to_cyc_near64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert seconds to hardware cycles.
64 bits. Round nearest.
Converts time values in seconds to hardware cycles. Computes result in 64 bit precision. Rounds to the nearest output unit.
t | Source time in seconds. uint64_t |
#define k_sec_to_ticks_ceil32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert seconds to ticks.
32 bits. Rounds up.
Converts time values in seconds to ticks. Computes result in 32 bit precision. Rounds up to the next highest output unit.
t | Source time in seconds. uint64_t |
#define k_sec_to_ticks_ceil64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert seconds to ticks.
64 bits. Rounds up.
Converts time values in seconds to ticks. Computes result in 64 bit precision. Rounds up to the next highest output unit.
t | Source time in seconds. uint64_t |
#define k_sec_to_ticks_floor32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert seconds to ticks.
32 bits. Truncates.
Converts time values in seconds to ticks. Computes result in 32 bit precision. Truncates to the next lowest output unit.
t | Source time in seconds. uint64_t |
#define k_sec_to_ticks_floor64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert seconds to ticks.
64 bits. Truncates.
Converts time values in seconds to ticks. Computes result in 64 bit precision. Truncates to the next lowest output unit.
t | Source time in seconds. uint64_t |
#define k_sec_to_ticks_near32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert seconds to ticks.
32 bits. Round nearest.
Converts time values in seconds to ticks. Computes result in 32 bit precision. Rounds to the nearest output unit.
t | Source time in seconds. uint64_t |
#define k_sec_to_ticks_near64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert seconds to ticks.
64 bits. Round nearest.
Converts time values in seconds to ticks. Computes result in 64 bit precision. Rounds to the nearest output unit.
t | Source time in seconds. uint64_t |
#define k_ticks_to_cyc_ceil32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to hardware cycles.
32 bits. Rounds up.
Converts time values in ticks to hardware cycles. Computes result in 32 bit precision. Rounds up to the next highest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_cyc_ceil64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to hardware cycles.
64 bits. Rounds up.
Converts time values in ticks to hardware cycles. Computes result in 64 bit precision. Rounds up to the next highest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_cyc_floor32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to hardware cycles.
32 bits. Truncates.
Converts time values in ticks to hardware cycles. Computes result in 32 bit precision. Truncates to the next lowest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_cyc_floor64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to hardware cycles.
64 bits. Truncates.
Converts time values in ticks to hardware cycles. Computes result in 64 bit precision. Truncates to the next lowest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_cyc_near32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to hardware cycles.
32 bits. Round nearest.
Converts time values in ticks to hardware cycles. Computes result in 32 bit precision. Rounds to the nearest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_cyc_near64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to hardware cycles.
64 bits. Round nearest.
Converts time values in ticks to hardware cycles. Computes result in 64 bit precision. Rounds to the nearest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_ms_ceil32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to milliseconds.
32 bits. Rounds up.
Converts time values in ticks to milliseconds. Computes result in 32 bit precision. Rounds up to the next highest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_ms_ceil64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to milliseconds.
64 bits. Rounds up.
Converts time values in ticks to milliseconds. Computes result in 64 bit precision. Rounds up to the next highest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_ms_floor32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to milliseconds.
32 bits. Truncates.
Converts time values in ticks to milliseconds. Computes result in 32 bit precision. Truncates to the next lowest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_ms_floor64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to milliseconds.
64 bits. Truncates.
Converts time values in ticks to milliseconds. Computes result in 64 bit precision. Truncates to the next lowest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_ms_near32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to milliseconds.
32 bits. Round nearest.
Converts time values in ticks to milliseconds. Computes result in 32 bit precision. Rounds to the nearest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_ms_near64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to milliseconds.
64 bits. Round nearest.
Converts time values in ticks to milliseconds. Computes result in 64 bit precision. Rounds to the nearest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_ns_ceil32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to nanoseconds.
32 bits. Rounds up.
Converts time values in ticks to nanoseconds. Computes result in 32 bit precision. Rounds up to the next highest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_ns_ceil64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to nanoseconds.
64 bits. Rounds up.
Converts time values in ticks to nanoseconds. Computes result in 64 bit precision. Rounds up to the next highest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_ns_floor32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to nanoseconds.
32 bits. Truncates.
Converts time values in ticks to nanoseconds. Computes result in 32 bit precision. Truncates to the next lowest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_ns_floor64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to nanoseconds.
64 bits. Truncates.
Converts time values in ticks to nanoseconds. Computes result in 64 bit precision. Truncates to the next lowest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_ns_near32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to nanoseconds.
32 bits. Round nearest.
Converts time values in ticks to nanoseconds. Computes result in 32 bit precision. Rounds to the nearest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_ns_near64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to nanoseconds.
64 bits. Round nearest.
Converts time values in ticks to nanoseconds. Computes result in 64 bit precision. Rounds to the nearest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_sec_ceil32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to seconds.
32 bits. Rounds up.
Converts time values in ticks to seconds. Computes result in 32 bit precision. Rounds up to the next highest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_sec_ceil64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to seconds.
64 bits. Rounds up.
Converts time values in ticks to seconds. Computes result in 64 bit precision. Rounds up to the next highest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_sec_floor32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to seconds.
32 bits. Truncates.
Converts time values in ticks to seconds. Computes result in 32 bit precision. Truncates to the next lowest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_sec_floor64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to seconds.
64 bits. Truncates.
Converts time values in ticks to seconds. Computes result in 64 bit precision. Truncates to the next lowest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_sec_near32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to seconds.
32 bits. Round nearest.
Converts time values in ticks to seconds. Computes result in 32 bit precision. Rounds to the nearest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_sec_near64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to seconds.
64 bits. Round nearest.
Converts time values in ticks to seconds. Computes result in 64 bit precision. Rounds to the nearest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_us_ceil32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to microseconds.
32 bits. Rounds up.
Converts time values in ticks to microseconds. Computes result in 32 bit precision. Rounds up to the next highest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_us_ceil64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to microseconds.
64 bits. Rounds up.
Converts time values in ticks to microseconds. Computes result in 64 bit precision. Rounds up to the next highest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_us_floor32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to microseconds.
32 bits. Truncates.
Converts time values in ticks to microseconds. Computes result in 32 bit precision. Truncates to the next lowest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_us_floor64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to microseconds.
64 bits. Truncates.
Converts time values in ticks to microseconds. Computes result in 64 bit precision. Truncates to the next lowest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_us_near32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to microseconds.
32 bits. Round nearest.
Converts time values in ticks to microseconds. Computes result in 32 bit precision. Rounds to the nearest output unit.
t | Source time in ticks. uint64_t |
#define k_ticks_to_us_near64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert ticks to microseconds.
64 bits. Round nearest.
Converts time values in ticks to microseconds. Computes result in 64 bit precision. Rounds to the nearest output unit.
t | Source time in ticks. uint64_t |
#define k_us_to_cyc_ceil32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert microseconds to hardware cycles.
32 bits. Rounds up.
Converts time values in microseconds to hardware cycles. Computes result in 32 bit precision. Rounds up to the next highest output unit.
t | Source time in microseconds. uint64_t |
#define k_us_to_cyc_ceil64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert microseconds to hardware cycles.
64 bits. Rounds up.
Converts time values in microseconds to hardware cycles. Computes result in 64 bit precision. Rounds up to the next highest output unit.
t | Source time in microseconds. uint64_t |
#define k_us_to_cyc_floor32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert microseconds to hardware cycles.
32 bits. Truncates.
Converts time values in microseconds to hardware cycles. Computes result in 32 bit precision. Truncates to the next lowest output unit.
t | Source time in microseconds. uint64_t |
#define k_us_to_cyc_floor64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert microseconds to hardware cycles.
64 bits. Truncates.
Converts time values in microseconds to hardware cycles. Computes result in 64 bit precision. Truncates to the next lowest output unit.
t | Source time in microseconds. uint64_t |
#define k_us_to_cyc_near32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert microseconds to hardware cycles.
32 bits. Round nearest.
Converts time values in microseconds to hardware cycles. Computes result in 32 bit precision. Rounds to the nearest output unit.
t | Source time in microseconds. uint64_t |
#define k_us_to_cyc_near64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert microseconds to hardware cycles.
64 bits. Round nearest.
Converts time values in microseconds to hardware cycles. Computes result in 64 bit precision. Rounds to the nearest output unit.
t | Source time in microseconds. uint64_t |
#define k_us_to_ticks_ceil32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert microseconds to ticks.
32 bits. Rounds up.
Converts time values in microseconds to ticks. Computes result in 32 bit precision. Rounds up to the next highest output unit.
t | Source time in microseconds. uint64_t |
#define k_us_to_ticks_ceil64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert microseconds to ticks.
64 bits. Rounds up.
Converts time values in microseconds to ticks. Computes result in 64 bit precision. Rounds up to the next highest output unit.
t | Source time in microseconds. uint64_t |
#define k_us_to_ticks_floor32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert microseconds to ticks.
32 bits. Truncates.
Converts time values in microseconds to ticks. Computes result in 32 bit precision. Truncates to the next lowest output unit.
t | Source time in microseconds. uint64_t |
#define k_us_to_ticks_floor64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert microseconds to ticks.
64 bits. Truncates.
Converts time values in microseconds to ticks. Computes result in 64 bit precision. Truncates to the next lowest output unit.
t | Source time in microseconds. uint64_t |
#define k_us_to_ticks_near32 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert microseconds to ticks.
32 bits. Round nearest.
Converts time values in microseconds to ticks. Computes result in 32 bit precision. Rounds to the nearest output unit.
t | Source time in microseconds. uint64_t |
#define k_us_to_ticks_near64 | ( | t | ) |
#include <zephyr/sys/time_units.h>
Convert microseconds to ticks.
64 bits. Round nearest.
Converts time values in microseconds to ticks. Computes result in 64 bit precision. Rounds to the nearest output unit.
t | Source time in microseconds. uint64_t |
#define sys_clock_hw_cycles_per_sec | ( | ) |
#include <zephyr/sys/time_units.h>
Get the system timer frequency.
#define SYS_FOREVER_MS (-1) |
#include <zephyr/sys/time_units.h>
System-wide macro to denote "forever" in milliseconds.
Usage of this macro is limited to APIs that want to expose a timeout value that can optionally be unlimited, or "forever". This macro can not be fed into kernel functions or macros directly. Use SYS_TIMEOUT_MS instead.
#define SYS_FOREVER_US (-1) |
#include <zephyr/sys/time_units.h>
System-wide macro to denote "forever" in microseconds.
See SYS_FOREVER_MS.
#define SYS_TIMEOUT_MS | ( | ms | ) |
#include <zephyr/sys/time_units.h>
System-wide macro to convert milliseconds to kernel timeouts.
#define TIME_CONSTEXPR |
#include <zephyr/sys/time_units.h>