timer.c File Reference

Hardware independent timer driver (implementation). More...

#include "timer.h"
#include <cpu/attr.h>
#include <cpu/types.h>
#include <cpu/irq.h>
#include <cfg/os.h>
#include <cfg/debug.h>
#include <cfg/module.h>
#include <appconfig.h>
#include <CPU_CSOURCE(timer)>

Go to the source code of this file.


Functions

void timer_add (Timer *timer)
 Add the specified timer to the software timer service queue.
Timertimer_abort (Timer *timer)
 Remove a timer from the timer queue before it has expired.
void timer_delayTicks (ticks_t delay)
 Wait for the specified amount of timer ticks.
void timer_busyWait (hptime_t delay)
 Busy wait until the specified amount of high-precision ticks have elapsed.
void timer_delayHp (hptime_t delay)
 Wait for the specified amount of time (expressed in microseconds).

Variables

volatile ticks_t _clock
 Master system clock (1 tick accuracy).
static REGISTER List timers_queue
 List of active asynchronous timers.

Detailed Description

Hardware independent timer driver (implementation).

Version:
Id
timer.c 1134 2008-02-18 15:44:16Z bernie
Author:
Bernardo Innocenti <bernie@develer.com>

Definition in file timer.c.


Function Documentation

void timer_add ( Timer timer  ) 

Add the specified timer to the software timer service queue.

When the delay indicated by the timer expires, the timer device will execute the event associated with it.

Note:
Interrupt safe

Definition at line 124 of file timer.c.

void timer_busyWait ( hptime_t  delay  ) 

Busy wait until the specified amount of high-precision ticks have elapsed.

Note:
This function is interrupt safe, the only requirement is a running hardware timer.

Definition at line 221 of file timer.c.

void timer_delayHp ( hptime_t  delay  ) 

Wait for the specified amount of time (expressed in microseconds).

Definition at line 249 of file timer.c.