Xenomai  3.0.8
Collaboration diagram for Timer Services:

Typedefs

typedef void(* rtdm_timer_handler_t) (rtdm_timer_t *timer)
 Timer handler. More...
 

Functions

int rtdm_timer_init (rtdm_timer_t *timer, rtdm_timer_handler_t handler, const char *name)
 Initialise a timer. More...
 
void rtdm_timer_destroy (rtdm_timer_t *timer)
 Destroy a timer. More...
 
int rtdm_timer_start (rtdm_timer_t *timer, nanosecs_abs_t expiry, nanosecs_rel_t interval, enum rtdm_timer_mode mode)
 Start a timer. More...
 
void rtdm_timer_stop (rtdm_timer_t *timer)
 Stop a timer. More...
 
int rtdm_timer_start_in_handler (rtdm_timer_t *timer, nanosecs_abs_t expiry, nanosecs_rel_t interval, enum rtdm_timer_mode mode)
 Start a timer from inside a timer handler. More...
 
void rtdm_timer_stop_in_handler (rtdm_timer_t *timer)
 Stop a timer from inside a timer handler. More...
 

RTDM_TIMERMODE_xxx

Timer operation modes

enum  rtdm_timer_mode { RTDM_TIMERMODE_RELATIVE = XN_RELATIVE, RTDM_TIMERMODE_ABSOLUTE = XN_ABSOLUTE, RTDM_TIMERMODE_REALTIME = XN_REALTIME }
 

Detailed Description

Typedef Documentation

◆ rtdm_timer_handler_t

typedef void(* rtdm_timer_handler_t) (rtdm_timer_t *timer)

Timer handler.

Parameters
[in]timerTimer handle as returned by rtdm_timer_init()

Enumeration Type Documentation

◆ rtdm_timer_mode

Enumerator
RTDM_TIMERMODE_RELATIVE 

Monotonic timer with relative timeout.

RTDM_TIMERMODE_ABSOLUTE 

Monotonic timer with absolute timeout.

RTDM_TIMERMODE_REALTIME 

Adjustable timer with absolute timeout.

Function Documentation

◆ rtdm_timer_destroy()

void rtdm_timer_destroy ( rtdm_timer_t *  timer)

Destroy a timer.

Parameters
[in,out]timerTimer handle as returned by rtdm_timer_init()
Tags cobalt-core-tags "task-unrestricted"

◆ rtdm_timer_init()

int rtdm_timer_init ( rtdm_timer_t *  timer,
rtdm_timer_handler_t  handler,
const char *  name 
)

Initialise a timer.

Parameters
[in,out]timerTimer handle
[in]handlerHandler to be called on timer expiry
[in]nameOptional timer name
Returns
0 on success, otherwise negative error code
Tags cobalt-core-tags "task-unrestricted"

◆ rtdm_timer_start()

int rtdm_timer_start ( rtdm_timer_t *  timer,
nanosecs_abs_t  expiry,
nanosecs_rel_t  interval,
enum rtdm_timer_mode  mode 
)

Start a timer.

Parameters
[in,out]timerTimer handle as returned by rtdm_timer_init()
[in]expiryFiring time of the timer, mode defines if relative or absolute
[in]intervalRelative reload value, > 0 if the timer shall work in periodic mode with the specific interval, 0 for one-shot timers
[in]modeDefines the operation mode, see RTDM_TIMERMODE_xxx for possible values
Returns
0 on success, otherwise:
  • -ETIMEDOUT is returned if expiry describes an absolute date in the past. In such an event, the timer is nevertheless armed for the next shot in the timeline if interval is non-zero.
Tags cobalt-core-tags "unrestricted"

◆ rtdm_timer_start_in_handler()

int rtdm_timer_start_in_handler ( rtdm_timer_t *  timer,
nanosecs_abs_t  expiry,
nanosecs_rel_t  interval,
enum rtdm_timer_mode  mode 
)

Start a timer from inside a timer handler.

Parameters
[in,out]timerTimer handle as returned by rtdm_timer_init()
[in]expiryFiring time of the timer, mode defines if relative or absolute
[in]intervalRelative reload value, > 0 if the timer shall work in periodic mode with the specific interval, 0 for one-shot timers
[in]modeDefines the operation mode, see RTDM_TIMERMODE_xxx for possible values
Returns
0 on success, otherwise:
  • -ETIMEDOUT is returned if expiry describes an absolute date in the past.
Tags cobalt-core-tags "coreirq-only"

◆ rtdm_timer_stop()

void rtdm_timer_stop ( rtdm_timer_t *  timer)

Stop a timer.

Parameters
[in,out]timerTimer handle as returned by rtdm_timer_init()
Tags cobalt-core-tags "unrestricted"

◆ rtdm_timer_stop_in_handler()

void rtdm_timer_stop_in_handler ( rtdm_timer_t *  timer)

Stop a timer from inside a timer handler.

Parameters
[in,out]timerTimer handle as returned by rtdm_timer_init()
Tags cobalt-core-tags "coreirq-only"