Nut/OS  4.10.3
API Reference
timer.h File Reference

Timer management definitions. More...

#include <sys/types.h>
#include <arch/timer.h>
#include <stdint.h>
Include dependency graph for timer.h:

Go to the source code of this file.

Data Structures

struct  _NUTTIMERINFO
 Timer information structure. More...

Defines

#define TM_ONESHOT   0x01
#define NUT_CACHE_LVALID   0x80000000UL
#define NUT_HWCLK_CPU   0
#define NUT_HWCLK_PERIPHERAL   NUT_HWCLK_CPU
#define NUT_HWCLK_MAX   NUT_HWCLK_PERIPHERAL
#define NutClockGet(i)   NutGetCpuClock()

Typedefs

typedef struct _NUTTIMERINFO NUTTIMERINFO
 Timer type.

Functions

void NutTimerInit (void)
 Initialize system timer.
NUTTIMERINFONutTimerCreate (uint32_t ticks, void(*callback)(HANDLE, void *), void *arg, uint8_t flags)
 Create a new system timer.
void NutTimerInsert (NUTTIMERINFO *tn)
 Insert a new timer in the global timer list.
void NutTimerProcessElapsed (void)
 Process elapsed timers.
void NutSleep (uint32_t ms)
 Temporarily suspends the current thread.
void NutDelay (uint8_t ms)
 Loop for a specified number of milliseconds.
void NutMicroDelay (uint32_t us)
 Loop for a specified number of microseconds.
uint32_t NutGetTickCount (void)
 Return the number of system timer ticks.
uint32_t NutGetSeconds (void)
 Return the seconds counter value.
uint32_t NutGetMillis (void)
 Return the milliseconds counter value.
HANDLE NutTimerStart (uint32_t ms, void(*callback)(HANDLE, void *), void *arg, uint8_t flags)
 Start a system timer.
HANDLE NutTimerStartTicks (uint32_t ticks, void(*callback)(HANDLE, void *), void *arg, uint8_t flags)
 Start a system timer.
void NutTimerStop (HANDLE handle)
 Stop a specified timer.
int NutClockSet (int idx, uint32_t freq)
 Return the specified clock frequency.
uint32_t NutGetCpuClock (void)
 Return the CPU clock frequency.

Variables

NUTTIMERINFOnutTimerList
 Double linked list of all system timers.

Detailed Description

Timer management definitions.

Definition in file timer.h.


Define Documentation

#define TM_ONESHOT   0x01
Examples:
timers/timers.c.

Definition at line 151 of file timer.h.

Referenced by main(), NutEventWait(), NutMsgQGetMessage(), NutMsgQStartTimer(), NutSleep(), and NutTimerCreate().

#define NUT_CACHE_LVALID   0x80000000UL

Definition at line 153 of file timer.h.

Referenced by NutGetCpuClock().

#define NUT_HWCLK_CPU   0

Definition at line 157 of file timer.h.

Referenced by NutArchClockGet(), and NutGetCpuClock().

#define NUT_HWCLK_PERIPHERAL   NUT_HWCLK_CPU

Definition at line 160 of file timer.h.

#define NUT_HWCLK_MAX   NUT_HWCLK_PERIPHERAL

Definition at line 163 of file timer.h.

#define NutClockGet (   i)    NutGetCpuClock()

Typedef Documentation

typedef struct _NUTTIMERINFO NUTTIMERINFO

Timer type.

Definition at line 121 of file timer.h.