Xenomai API  2.6.5
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

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

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

void rtdm_timer_destroy ( rtdm_timer_t *  timer)

Destroy a timer.

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

Environments:

This service can be called from:

  • Kernel module initialization/cleanup code
  • Kernel-based task
  • User-space task (RT, non-RT)

Rescheduling: never.

References xntimer_destroy().

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

Environments:

This service can be called from:

  • Kernel module initialization/cleanup code
  • Kernel-based task
  • User-space task (RT, non-RT)

Rescheduling: never.

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.

Environments:

This service can be called from:

  • Kernel module initialization/cleanup code
  • Interrupt service routine
  • Kernel-based task
  • User-space task (RT, non-RT)

Rescheduling: never.

References xntimer_start().

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.

Environments:

This service can be called from:

  • Timer handler

Rescheduling: never.

void rtdm_timer_stop ( rtdm_timer_t *  timer)

Stop a timer.

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

Environments:

This service can be called from:

  • Kernel module initialization/cleanup code
  • Interrupt service routine
  • Kernel-based task
  • User-space task (RT, non-RT)

Rescheduling: never.

References xntimer_stop().

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()

Environments:

This service can be called from:

  • Timer handler

Rescheduling: never.