void rt_set_oneshot_mode (void);
void rt_set_periodic_mode (void);
rt_set_periodic_mode sets the periodic mode for the timer. It consists of a fixed frequency timing of the tasks in multiple of the period set with a call to start_rt_timer. The resolution is that of the 8254 frequency (1193180 hz). Any timing request not an integer multiple of the period is satisfied at the closest period tick. It is the default mode when no call is made to set the oneshot mode.
Oneshot mode can be set initially also with OneShot command line parameter of the rtai_sched module.
RTIME start_rt_timer (int period);
void stop_rt_timer (void);
stop_rt_timer stops the timer. The timer mode is set to periodic.
RTIME count2nano (RTIME timercounts);
RTIME nano2count (RTIME nanosecs);
nano2count converts the time of nanosecs nanoseconds into internal counts units.
Remember that the count units are related to the cpu frequency in oneshot mode and to the 8254 frequency (1193180 Hz) in periodic mode.
RTIME rt_get_time (void);
RTIME rt_get_time_ns (void);
RTIME rt_get_cpu_time_ns (void);
rt_get_time_ns is the same as rt_get_time but the returned time is converted to nanoseconds.
rt_get_cpu_time_ns ???
RTIME next_period (void);
void rt_busy_sleep (int nanosecs);
void rt_sleep (RTIME delay);
void rt_sleep_until (RTIME time);
rt_sleep suspends execution of the caller task for a time of delay internal count units. During this time the CPU is used by other tasks.
rt_sleep_until is similar to rt_sleep but the parameter time is the absolute time till the task have to be suspended. If the given time is already passed this call has no effect.
Note: a higher priority task or interrupt handler can run during wait so the actual time spent in these functions may be longer than the specified.