Go to the documentation of this file.
247 #define ZTIMER_CLOCK_NO_REQUIRED_PM_MODE (UINT8_MAX)
267 #if MODULE_ZTIMER_NOW64
281 void (*callback)(
void *arg);
319 #if MODULE_ZTIMER_EXTEND || MODULE_ZTIMER_NOW64 || DOXYGEN
325 #if MODULE_PM_LAYERED || DOXYGEN
403 #define MSG_ZTIMER 0xc83e
413 ztimer_now_t _ztimer_now_extend(ztimer_clock_t *clock);
424 #if MODULE_ZTIMER_NOW64
426 #elif MODULE_ZTIMER_EXTEND
434 return clock->
ops->
now(clock);
480 while ((end -
ztimer_now(clock)) <= duration) {}
524 #if defined(MODULE_ZTIMER_EXTEND) || defined(DOXYGEN)
void ztimer_remove(ztimer_clock_t *clock, ztimer_t *timer)
Remove a timer from a clock.
int16_t kernel_pid_t
Unique process identifier.
uint16_t adjust_sleep
will be subtracted on every sleep(), in addition to adjust_set
uint32_t offset
offset from last timer in list
ztimer_base_t list
list of active timers
Messaging API for inter process communication.
ztimer_now_t checkpoint
cumulated time at last now() call
Scheduler API definition.
void * arg
timer callback argument
ztimer_base_t * next
next timer in list
uint32_t(* now)(ztimer_clock_t *clock)
Get the current count of the timer.
ztimer_clock_t *const ZTIMER_MSEC
Default ztimer millisecond clock.
void ztimer_sleep(ztimer_clock_t *clock, uint32_t duration)
Put the calling thread to sleep for the specified number of ticks.
ztimer_clock_t *const ZTIMER_MSEC_BASE
Base ztimer for the millisecond clock (ZTIMER_MSEC)
void ztimer_set(ztimer_clock_t *clock, ztimer_t *timer, uint32_t val)
Set a timer on a clock.
static void ztimer_spin(ztimer_clock_t *clock, uint32_t duration)
Busy-wait specified duration.
ztimer_clock_t *const ZTIMER_USEC_BASE
Base ztimer for the microsecond clock (ZTIMER_USEC)
void ztimer_handler(ztimer_clock_t *clock)
main ztimer callback handler
static void ztimer_init_extend(ztimer_clock_t *clock)
Initialize possible ztimer extension intermediate timer.
ztimer_clock_t *const ZTIMER_USEC
Default ztimer microsecond clock.
const ztimer_ops_t * ops
pointer to methods structure
uint8_t required_pm_mode
min.
uint32_t max_value
maximum relative timer value
ztimer_now_t _ztimer_now_extend(ztimer_clock_t *clock)
ztimer_now() for extending timers
int ztimer_msg_receive_timeout(ztimer_clock_t *clock, msg_t *msg, uint32_t timeout)
receive a message (blocking, with timeout)
uint32_t ztimer_now_t
type for ztimer_now() result
uint16_t adjust_set
will be subtracted on every set()
void ztimer_set_timeout_flag(ztimer_clock_t *clock, ztimer_t *timer, uint32_t timeout)
Set timeout thread flag after timeout.
void ztimer_periodic_wakeup(ztimer_clock_t *clock, uint32_t *last_wakeup, uint32_t period)
Suspend the calling thread until the time (last_wakeup + period)
ztimer backend method structure
Describes a message object which can be sent between threads.
void ztimer_update_head_offset(ztimer_clock_t *clock)
Update ztimer clock head list offset.
void ztimer_set_msg(ztimer_clock_t *clock, ztimer_t *timer, uint32_t offset, msg_t *msg, kernel_pid_t target_pid)
Post a message after a delay.
uint32_t lower_last
timer value at last now() call
Minimum information for each timer.
static ztimer_now_t ztimer_now(ztimer_clock_t *clock)
Get the current time from a clock.
ztimer_base_t base
clock list entry
void ztimer_set_wakeup(ztimer_clock_t *clock, ztimer_t *timer, uint32_t offset, kernel_pid_t pid)
Set a timer that wakes up a thread.
void ztimer_init(void)
Initialize the board-specific default ztimer configuration.
void(* set)(ztimer_clock_t *clock, uint32_t val)
Set a new timer target.
ztimer_base_t * last
last timer in queue, for _is_set()