API Reference Manual  1.45.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-2023 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 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 #include <odp/api/deprecated.h>
21 #include <odp/api/event_types.h>
22 #include <odp/api/std_types.h>
23 
71 typedef enum {
74 
77 
79 
83 typedef struct {
85  uint64_t res_ns;
86 
88  uint64_t res_hz;
89 
91  uint64_t min_tmo;
92 
94  uint64_t max_tmo;
95 
97 
101 typedef struct {
112 
114  uint64_t max_multiplier;
115 
117  uint64_t res_ns;
118 
120 
124 typedef struct {
131 
133  uint32_t max_pools;
134 
139  uint32_t max_timers;
140 
149  uint64_t highest_res_ns;
150 
163 
176 
187 
198 
200  struct {
205  uint32_t max_pools;
206 
208  uint32_t max_timers;
209 
212 
215 
216  } periodic;
217 
219 
227 typedef enum {
230 
233 
236 
239 
242 
245 
248 
250 
252 #define ODP_CLOCK_DEFAULT ODP_CLOCK_SRC_0
253 
263 typedef enum {
269 
278 
280 
284 typedef struct {
294 
299 
304 
309  uint64_t res_ns;
310 
314  uint64_t res_hz;
315 
324  uint64_t min_tmo;
325 
334  uint64_t max_tmo;
335 
340  struct {
363 
369  uint64_t max_multiplier;
370 
371  } periodic;
372 
374  uint32_t num_timers;
375 
379  int priv;
380 
382 
386 typedef enum {
393 
399 
401 
405 typedef struct odp_timer_start_t {
411 
416  uint64_t tick;
417 
428 
430 
474  uint64_t first_tick;
475 
486  uint64_t freq_multiplier;
487 
494 
496 
500 typedef enum {
507 
516 
524 
531  ODP_TIMER_FAIL = -3
532 
534 
541 
545 typedef struct odp_timer_tick_info_t {
558 
571 
587 
589 
593 typedef struct {
596 
598  uint32_t cur_timers;
599 
601  uint32_t hwm_timers;
602 
604  const char *name;
605 
608 
610 
615 #ifdef __cplusplus
616 }
617 #endif
618 
619 #include <odp/visibility_end.h>
620 #endif
ODP event API type definitions.
Standard C language types and definitions for ODP.
Control deprecated API definitions.
int odp_bool_t
Use odp boolean type to have it well-defined and known size, regardless which compiler is used as thi...
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.
#define ODP_DEPRECATE(x)
Macro to deprecate API definitions.
Unsigned 64 bit fractional number.
odp_fract_u64_t min_base_freq_hz
Minimum supported base frequency value.
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.
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.