Compounds | |
struct | timer |
struct | timeval |
Typedefs | |
typedef void(* | timer_overflow_handler )(void) |
typedef void | __attribute__ ((noreturn))(*func)() |
Functions | |
void | timer_initialize (void) |
void | timer_create (struct timer *t, unsigned long timeout, timer_handler handler, unsigned char flags) |
void | timer_insert (struct timer *t) |
void | timer_remove (struct timer *t) |
int | timer_is_active (struct timer *t) |
void | timer_gettime (struct timeval *tv) |
Get the current time. | |
void | timer_settime (struct timeval *tv) |
long | timer_adjtime (long adj_usec) |
void | timevalsub (struct timeval *to, struct timeval *val) |
void | timevaladd (struct timeval *to, struct timeval *val) |
unsigned long | usec_to_tcnt (unsigned long) |
Translate microseconds into a timer counter value. | |
void | __attribute__ ((interrupt)) timer_overflow_interrupt(void) |
void | set_timer_overflow_handler (timer_overflow_handler handler) |
|
Real time interrupt handler. This is the real time interrupt handler that must be installed in RTI_VECTOR to process real time interrupts and process the fast timers. |
|
Timer overflow handler. Definition at line 62 of file include/gel/timer.h. Referenced by set_timer_overflow_handler(). |
|
Timer overflow interrupt handler Definition at line 125 of file freqmeter.c. |
|
Install the timer overflow handler. Definition at line 268 of file include/gel/timer.h. References timer_overflow_handler. |
|
Adjust the time smoothly. This function has a similar functionality as the standard adjtime function (see RFC 1589). It adjust the current time by advancing or retarding it by the amount specified in adj_usec.
|
|
Create and register a timer. Initializes the timer object t and register the timer handler handler to be called after the time specified by timeout. The timeout is rounded up to a multiple of the timer resolution. The flags controls various aspects of the timer management. The timer module has two timer lists with different resolutions. A first list is connected to the real time interrupt; it is called the fast timers. The second list is connected to the timer overflow interrupt; it is called the slow timers. The timer object is inserted in one of the two timer list. The choice of the list is made by the TIMER_SLOW bit of the flags parameter. This flag also controls the unit in which the timeout is expressed. The two lists have different resolutions:
|
|
Get the current time. Get the current time. Returns in the tv parameter the current time. The current time is expressed in seconds and microseconds. The current time is computed by taking a snapshot of a timer overflow counter and the free running counter. A boot time is added to the second portion to obtain the current time. Accurracy of the result depends on the resolution of the free running counter. The value returned is also a snapshot of the time within timer_gettime. This function is intended to be close to the Unix gettimeofday operation.
|
|
Initialize the timer module. This function initializes the timer module and setup everything to handle timer overflow and real time interrupts. It must be called only once before using any other timer operation. When using the single or extending bootstrap mode, the following vectors must be installed in the vector table: RTI_VECTOR timer_interrupt TIMER_OVERFLOW_VECTOR timer_overflow_interrupt
|
|
Register a timer. This operation is similar to timer_create but it only registers the timer by inserting the object in the good list. The timer object pointed to by t must have its member initialized with the same values as timer_create. As for timer_create, the timer object is inserted in the slow or fast timers list depending on the flags member.
|
|
Return the status of a timer. Returns 1 if the timer object t is active and will be fired. Returns 0 if it is not inserted in one of the two timer lists.
Definition at line 329 of file include/gel/timer.h. References next. |
|
Remove a timer. Removes the timer object t from the timer list. When the last fast timer is removed, the real time interrupts are disabled. They are enabled again when the first fast timer is inserted.
|
|
Set the current time. Set the current time to tv. This function is intended to be close to the Unix settimeofday operation.
|
|
Add a timeval. Add in to the time in val.
|
|
Subtract a timeval. Subtract from to the time in val. The result time can become negative.
|