Xenomai  3.0.5
Timer management services

Services for reading and spinning on the hardware timer. More...

Collaboration diagram for Timer management services:

Data Structures

struct  rt_timer_info
 Timer status descriptor. More...
 

Typedefs

typedef struct rt_timer_info RT_TIMER_INFO
 Timer status descriptor. More...
 

Functions

static RTIME rt_timer_read (void)
 Return the current system time. More...
 
SRTIME rt_timer_ns2ticks (SRTIME ns)
 Convert nanoseconds to Alchemy clock ticks. More...
 
SRTIME rt_timer_ticks2ns (SRTIME ticks)
 Convert Alchemy clock ticks to nanoseconds. More...
 
void rt_timer_inquire (RT_TIMER_INFO *info)
 Inquire about the Alchemy clock. More...
 
void rt_timer_spin (RTIME ns)
 Busy wait burning CPU cycles. More...
 

Detailed Description

Services for reading and spinning on the hardware timer.

Typedef Documentation

◆ RT_TIMER_INFO

typedef struct rt_timer_info RT_TIMER_INFO

Timer status descriptor.

This structure reports information about the Alchemy clock, returned by a call to rt_timer_inquire().

Function Documentation

◆ rt_timer_inquire()

void rt_timer_inquire ( RT_TIMER_INFO info)

Inquire about the Alchemy clock.

Return status information about the Alchemy clock.

Parameters
infoThe address of a structure to fill with the clock information.
Tags
unrestricted

References rt_timer_info::period.

◆ rt_timer_ns2ticks()

SRTIME rt_timer_ns2ticks ( SRTIME  ns)

Convert nanoseconds to Alchemy clock ticks.

Convert a count of nanoseconds to Alchemy clock ticks. This routine operates on signed nanosecond values. This is the converse call to rt_timer_ticks2ns().

Parameters
nsThe count of nanoseconds to convert.
Returns
The corresponding value expressed in clock ticks of the Alchemy clock. The resolution of the Alchemy clock can be set using the –alchemy-clock-resolution option when starting the application process (defaults to 1 nanosecond).
Tags
unrestricted
Examples:
cross-link.c, and rtcansend.c.

◆ rt_timer_read()

RTIME rt_timer_read ( void  )
inlinestatic

Return the current system time.

Return the current time maintained by the Xenomai core clock.

Returns
The current time expressed in clock ticks (see note).
Tags
unrestricted
Note
The time value is a multiple of the Alchemy clock resolution (see –alchemy-clock-resolution option, defaults to 1 nanosecond).
Examples:
cross-link.c.

◆ rt_timer_spin()

void rt_timer_spin ( RTIME  ns)

Busy wait burning CPU cycles.

Enter a busy waiting loop for a count of nanoseconds.

Since this service is always called with interrupts enabled, the caller might be preempted by other real-time activities, therefore the actual delay might be longer than specified.

Parameters
nsThe time to wait expressed in nanoseconds.
Tags
unrestricted

◆ rt_timer_ticks2ns()

SRTIME rt_timer_ticks2ns ( SRTIME  ns)

Convert Alchemy clock ticks to nanoseconds.

Convert a count of Alchemy clock ticks to nanoseconds. This routine operates on signed nanosecond values. This is the converse call to rt_timer_ns2ticks().

Parameters
nsThe count of nanoseconds to convert.
Returns
The corresponding value expressed in nanoseconds. The resolution of the Alchemy clock can be set using the –alchemy-clock-resolution option when starting the application process (defaults to 1 nanosecond).
Tags
unrestricted