API Reference Manual  1.47.0
api/spec/timer_types.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2013-2018 Linaro Limited
3  * Copyright (c) 2019-2025 Nokia
4  */
5 
12 #ifndef ODP_API_SPEC_TIMER_TYPES_H_
13 #define ODP_API_SPEC_TIMER_TYPES_H_
14 #include <odp/visibility_begin.h>
15 
16 #include <odp/api/event_types.h>
17 #include <odp/api/std_types.h>
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
70 typedef enum {
73 
76 
78 
82 typedef struct {
84  uint64_t res_ns;
85 
87  uint64_t res_hz;
88 
90  uint64_t min_tmo;
91 
93  uint64_t max_tmo;
94 
96 
100 typedef struct {
111 
113  uint64_t max_multiplier;
114 
116  uint64_t res_ns;
117 
119 
123 typedef struct {
130 
132  uint32_t max_pools;
133 
135  uint16_t max_priority;
136 
141  uint32_t max_timers;
142 
151  uint64_t highest_res_ns;
152 
165 
178 
189 
200 
202  struct {
207  uint32_t max_pools;
208 
210  uint16_t max_priority;
211 
213  uint32_t max_timers;
214 
217 
220 
221  } periodic;
222 
224 
232 typedef enum {
235 
238 
241 
244 
247 
250 
253 
255 
257 #define ODP_CLOCK_DEFAULT ODP_CLOCK_SRC_0
258 
268 typedef enum {
274 
283 
285 
289 typedef struct {
299 
304 
309 
314  uint64_t res_ns;
315 
319  uint64_t res_hz;
320 
329  uint64_t min_tmo;
330 
339  uint64_t max_tmo;
340 
345  struct {
368 
374  uint64_t max_multiplier;
375 
376  } periodic;
377 
379  uint32_t num_timers;
380 
389  uint16_t priority;
390 
394  int priv;
395 
397 
401 typedef enum {
408 
414 
416 
420 typedef struct odp_timer_start_t {
426 
431  uint64_t tick;
432 
443 
445 
489  uint64_t first_tick;
490 
501  uint64_t freq_multiplier;
502 
509 
511 
515 typedef enum {
522 
531 
539 
546  ODP_TIMER_FAIL = -3
547 
549 
553 typedef struct odp_timer_tick_info_t {
566 
579 
595 
597 
601 typedef struct {
604 
606  uint32_t cur_timers;
607 
609  uint32_t hwm_timers;
610 
612  const char *name;
613 
616 
618 
623 #ifdef __cplusplus
624 }
625 #endif
626 
627 #include <odp/visibility_end.h>
628 #endif
ODP event API type definitions.
Standard C language types and definitions for ODP.
bool odp_bool_t
Boolean type.
struct odp_timer_periodic_start_t odp_timer_periodic_start_t
Periodic timer start parameters.
struct odp_timer_start_t odp_timer_start_t
Timer start parameters.
odp_timer_clk_src_t
Clock sources for timer pools.
odp_timer_retval_t
Return values for timer start, restart and cancel calls.
odp_timer_type_t
Timer type.
struct odp_timer_tick_info_t odp_timer_tick_info_t
Timer tick information.
odp_timer_exp_mode_t
Timer expiration mode.
odp_timer_tick_type_t
Timer tick type.
@ ODP_CLOCK_SRC_1
Clock source number 1.
@ ODP_CLOCK_SRC_3
Clock source number 3
@ ODP_CLOCK_SRC_2
Clock source number 2.
@ ODP_CLOCK_NUM_SRC
Number of clock source enumerations.
@ ODP_CLOCK_SRC_5
Clock source number 5
@ ODP_CLOCK_SRC_4
Clock source number 4
@ ODP_CLOCK_SRC_0
Clock source number 0.
@ ODP_TIMER_SUCCESS
Timer operation succeeded.
@ ODP_TIMER_TOO_NEAR
Timer operation failed, too near to the current time.
@ ODP_TIMER_TOO_FAR
Timer operation failed, too far from the current time.
@ ODP_TIMER_FAIL
Timer operation failed.
@ ODP_TIMER_TYPE_PERIODIC
Periodic timer.
@ ODP_TIMER_TYPE_SINGLE
Single shot timer.
@ ODP_TIMER_EXP_RELAXED
Expiration relaxed.
@ ODP_TIMER_EXP_AFTER
Expiration after the target time.
@ ODP_TIMER_TICK_REL
Relative ticks.
@ ODP_TIMER_TICK_ABS
Absolute ticks.
Unsigned 64 bit fractional number.
odp_fract_u64_t min_base_freq_hz
Minimum supported base frequency value.
uint16_t max_priority
Maximum single shot timer pool priority.
uint32_t max_timers
Maximum number of single shot timers in a pool.
uint32_t max_pools_combined
Maximum number of timer pools.
uint32_t max_pools
Maximum number of timer pools for single shot timers (per clock source)
odp_timer_res_capability_t max_tmo
Maximum timeout length.
odp_fract_u64_t max_base_freq_hz
Maximum supported base frequency value.
odp_timer_res_capability_t max_res
Maximum resolution.
odp_bool_t queue_type_plain
Plain queue destination support.
uint64_t highest_res_ns
Highest timer resolution in nanoseconds.
odp_bool_t queue_type_sched
Scheduled queue destination support.
Periodic timer capability.
odp_fract_u64_t base_freq_hz
Periodic timer pool base frequency in hertz.
uint64_t res_ns
Timeout resolution in nanoseconds.
uint64_t max_multiplier
Maximum base frequency multiplier.
Periodic timer start parameters.
odp_event_t tmo_ev
Timeout event.
uint64_t freq_multiplier
Base frequency multiplier.
uint64_t first_tick
First expiration time.
ODP timer pool information and configuration.
odp_timer_tick_info_t tick_info
Timer pool tick information.
uint32_t hwm_timers
High watermark of allocated timers.
uint32_t cur_timers
Number of currently allocated timers.
odp_timer_pool_param_t param
Parameters specified at creation.
const char * name
Name of timer pool.
Timer pool parameters.
uint64_t res_ns
Timeout resolution in nanoseconds.
uint64_t res_hz
Timeout resolution in hertz.
odp_timer_type_t timer_type
Timer type.
uint64_t max_multiplier
Maximum base frequency multiplier.
odp_fract_u64_t base_freq_hz
Timer pool base frequency in hertz.
uint16_t priority
Timer pool priority.
int priv
Thread private timer pool.
uint64_t min_tmo
Minimum relative timeout in nanoseconds.
uint32_t num_timers
Number of timers in the pool.
odp_timer_exp_mode_t exp_mode
Timer expiration mode.
odp_timer_clk_src_t clk_src
Clock source for timers.
uint64_t max_tmo
Maximum relative timeout in nanoseconds.
Timer resolution capability.
uint64_t res_hz
Timeout resolution in hertz.
uint64_t max_tmo
Maximum relative timeout in nanoseconds.
uint64_t min_tmo
Minimum relative timeout in nanoseconds.
uint64_t res_ns
Timeout resolution in nanoseconds.
Timer start parameters.
uint64_t tick
Expiration time in ticks.
odp_event_t tmo_ev
Timeout event.
odp_timer_tick_type_t tick_type
Tick type.
Timer tick information.
odp_fract_u64_t clk_cycle
One timer tick in source clock cycles.
odp_fract_u64_t freq
Timer tick frequency in hertz.
odp_fract_u64_t nsec
One timer tick in nanoseconds.