extern void  rt_set_oneshot_mode
(void);
  
return to index
  

SYNOPSIS

#include  "rtl_sched.h"

DESCRIPTION

Set the oneshot mode for the timer. It consists in a variable timing based on the cpu clock frequency. This allows task to be timed arbitrarily. It must be called before using any time related function, including conversions.

RETURN VALUE

None

ERRORS

None


extern void  rt_set_periodic_mode

(void);
  
return to index
  

SYNOPSIS

#include  "rtl_sched.h"

DESCRIPTION

Set 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.

RETURN VALUE

None

ERRORS

None


extern RTIME  start_rt_timer

(int period);
  
return to index
  

SYNOPSIS

#include  "rtl_sched.h"

DESCRIPTION

Start the timer with a period, in internal count units, defined by period.  The period is in internal count units and is required only for the periodic mode. In the oneshot case any value can be adopted as it is not used, a call to start_rt_timer must be made anyhow.

RETURN VALUE

The period in internal count units.

ERRORS

None


extern void  stop_rt_timer

(void);
  
return to index
  

SYNOPSIS

#include  "rtl_sched.h"

DESCRIPTION

Stop the timer previously started by a call to start_rt_timer.

RETURN VALUE

None

ERRORS

None


extern RTIME  count2nano

(RTIME timercounts);
  
return to index
  

SYNOPSIS

#include  "rtl_sched.h"

DESCRIPTION

Converts the internal count units defined by timercounts in nanoseconds. It is recalled that the count units are related to the cpu frequency in oneshot mode and to the 8254 frequency (1193180 Hz) in periodic mode.

RETURN VALUE

Nanoseconds is returned. 

ERRORS

 None


extern RTIME  nano2count

(RTIME nanosecs);
  
return to index
  

SYNOPSIS

#include  "rtl_sched.h"

DESCRIPTION

Converts the nanoseconds defined by nanosecs in internal counts unit

RETURN VALUE

Counts unit is returned.  It is recalled that the count units are related to the cpu frequency in oneshot mode and to the 8254 frequency (1193180 hz) in periodic mode.

ERRORS

None


extern RTIME   rt_get_time

(void);
  
return to index
  

SYNOPSIS

#include  "rtl_sched.h"

DESCRIPTION

Returns the number of real time clock ticks since RT_TIMER bootup. This number is multiple of the 8254 period in periodic mode, while is multiple of cpu clock period in oneshot mode.

RETURN VALUE

Number of clock ticks

ERRORS

None


extern RTIME   rt_get_time_ns

(void);
  
return to index
  

SYNOPSIS

#include  "rtl_sched.h"

DESCRIPTION

Returns the number of nanoseconds since RT_TIMER bootup.

RETURN VALUE

Number of nanoseconds

ERRORS

None


extern RTIME   rt_get_cpu_time_ns

(void);
  
return to index
  

SYNOPSIS

#include  "rtl_sched.h"

DESCRIPTION

Returns the number of nanoseconds since system bootup with respect to the cpu clock.

RETURN VALUE

Number of nanoseconds

ERRORS

None


extern int  rt_task_make_periodic

(RT_TASK *task, RTIME start_time,
RTIME period);
  
return to index
  

SYNOPSIS

#include  "rtl_sched.h"

DESCRIPTION

Marks the real time task , previously created with a call to rt_task_init, as suitable for a periodic execution, with period period, when rt_task_wait_period is called.
The desired start time is specified by start_time ; the first execution of the task will occur at start_time clock ticks from the the time when the rt timer was started.
If immediate execution is desired, the return value of rt_get_time can be used for start_time.

RETURN VALUE

On success, 0 is returned. On failure, a negative value is returned .

ERRORS

Errors may occur when task is already in use by another task or when space could not be allocated for the real-time task.


extern void  rt_task_wait_period

(void);
  
return to index
  

SYNOPSIS

#include  "rtl_sched.h"

DESCRIPTION

Suspend the execution of the currently running real time task until the next period is reached. The task must have been previously marked for execution using rt_task_make_periodic.
Note that the task is suspended only temporarily, i.e. it simply gives up control until the next time period.

RETURN VALUE

None

ERRORS

None


extern RTIME next_period

(void);
  
return to index
  

SYNOPSIS

#include  "rtl_sched.h"

DESCRIPTION

Returns the next period time.

RETURN VALUE

Next period time

ERRORS

None


extern void  rt_busy_sleep

(int nanosecs);
  
return to index
  

SYNOPSIS

#include  "rtl_sched.h"

DESCRIPTION

The current task blocks itself, sucking all the cpu time, in a busy wait for a time specified by nanosecs. It must be used for very short synchronization delays. 

RETURN VALUE

None

ERRORS

None


extern void  rt_sleep

(RTIME delay);
  
return to index
  

SYNOPSIS

#include  "rtl_sched.h"

DESCRIPTION

Suspend execution of the currently running real time task for a time defined by delay. During this time the cpu is released to other tasks.

RETURN VALUE

None 

ERRORS

None


extern void  rt_sleep_until

(RTIME time);
  
return to index
  

SYNOPSIS

#include  "rtl_sched.h"

DESCRIPTION

Suspend execution of the currently running real time task until the time defined by time is reached. During this time the cpu is released to other tasks.

RETURN VALUE

None 

ERRORS

None