Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages | Examples

include/sys/timer.h File Reference


Detailed Description

Timer management definitions.


Data Structures

struct  _NUTTIMERINFO
 Timer information structure. More...


Defines

#define TM_ONESHOT

Typedefs

typedef _NUTTIMERINFO NUTTIMERINFO
 Timer type.


Functions

void NutTimerInit (void)
 Initialize system timer.

HANDLE NutTimerStart (u_long ms, void(*callback)(HANDLE, void *), void *arg, u_char flags)
 Create an asynchronous timer.

void NutTimerStop (HANDLE handle)
 Stop a specified timer.

void NutTimerStopAsync (HANDLE handle)
 Asynchronously stop a specified timer.

void NutSleep (u_long ms)
 Temporarily suspends the current thread.

void NutDelay (u_char ms)
 Loop for a specified number of milliseconds.

u_long NutGetCpuClock (void)
 Return the CPU clock in Hertz.

u_long NutGetTickCount (void)
 Return the number of timer ticks.

u_long NutGetSeconds (void)
 Return the seconds counter value.

u_long NutGetMillis (void)
 Return the milliseconds counter value.


Variables

NUTTIMERINFO *volatile nutTimerList
 Linked list of all system timers.

NUTTIMERINFO *volatile nutTimerPool


Function Documentation

void NutDelay u_char  ms  ) 
 

Loop for a specified number of milliseconds.

This call will not release the CPU and will not switch to another thread. However, because of absent thread switching, this delay time is very exact.

Use NutSleep() to avoid blocking the CPU, if no exact timing is needed.

Parameters:
ms Delay time in milliseconds, maximum is 255.

void NutTimerInit void   ) 
 

Initialize system timer.

This function is automatically called by Nut/OS during system initialization.

Nut/OS uses on-chip timer 0 for its timer services. Applications should not modify any registers of this timer, but make use of the Nut/OS timer API. Timer 1 and timer 2 are available to applications.


© 2000-2003 by egnite Software GmbH - visit http://www.ethernut.de/