API Reference Manual  1.45.0
odp_timer_periodic_start_t Struct Reference

Periodic timer start parameters. More...

#include <timer_types.h>

Collaboration diagram for odp_timer_periodic_start_t:
[legend]

Data Fields

uint64_t first_tick
 First expiration time. More...
 
uint64_t freq_multiplier
 Base frequency multiplier. More...
 
odp_event_t tmo_ev
 Timeout event. More...
 

Detailed Description

Periodic timer start parameters.

A periodic timer pool can be thought as a wall clock, where the base frequency (odp_timer_pool_param_t::base_freq_hz) defines how many times per second a pointer travels around the clock face. When a timer (see "Timer A" in the figure) is started with the base frequency multiplier (odp_timer_periodic_start_t::freq_multiplier) of one, a single reference to it is placed into the clock face. When a timer (see "Timer B") is started with the multiplier value of two, two references to it is placed into opposite sides of the clock face, etc. When the pointer reaches a timer reference, the timer expires and a timeout event is sent to the destination queue. The maximum base frequency multiplier (odp_timer_pool_param_t::max_multiplier) defines the maximum number of references a timer can have on the clock face. The first expiration time parameter (odp_timer_periodic_start_t::first_tick) is used to tune timer reference placement on the clock face against the current time (the current pointer location).

Periodic timer pool
o
o o <--- Timer B
o \ o
\
Timer B ---> o \ o <--- Timer A
o
Timer pool: max_multiplier = 8
Timer A: freq_multiplier = 1
Timer B: freq_multiplier = 2
Examples
odp_timer_accuracy.c.

Definition at line 466 of file api/spec/timer_types.h.

Field Documentation

◆ first_tick

uint64_t odp_timer_periodic_start_t::first_tick

First expiration time.

The first expiration time in absolute timer ticks. When zero, the first expiration time is one period after the current time, or as close to that as the implementation can achieve. After the first expiration, timer expiration continues with the defined frequency. The tick value must be less than one timer period after the current time.

Examples
odp_timer_accuracy.c.

Definition at line 474 of file api/spec/timer_types.h.

◆ freq_multiplier

uint64_t odp_timer_periodic_start_t::freq_multiplier

Base frequency multiplier.

Periodic timer expiration frequency is defined as a multiple of the timer pool base frequency: timer frequency (Hz) = base_freq_hz * freq_multiplier. Valid values range from 1 to timer pool parameter 'max_multiplier'.

Depending on the implementation, a multiplier value that is a divisor of 'max_multiplier' may improve timer expiration accuracy: max_multiplier = k * freq_multiplier, where k is an integer.

Examples
odp_timer_accuracy.c.

Definition at line 486 of file api/spec/timer_types.h.

◆ tmo_ev

odp_event_t odp_timer_periodic_start_t::tmo_ev

Timeout event.

This event is enqueued to the destination queue when the timer expires. The event type must be ODP_EVENT_TIMEOUT.

Examples
odp_timer_accuracy.c.

Definition at line 493 of file api/spec/timer_types.h.


The documentation for this struct was generated from the following file: