Nut/OS  5.0.5
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 NutTimerIntr (void *arg)
 Related CPU frequency for loops per microsecond.
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.


Define Documentation

#define TM_ONESHOT   0x01
#define NUT_CACHE_LVALID   0x80000000UL

Referenced by NutGetCpuClock().

#define NUT_HWCLK_PERIPHERAL   NUT_HWCLK_CPU
#define NUT_HWCLK_MAX   NUT_HWCLK_PERIPHERAL

Typedef Documentation

typedef struct _NUTTIMERINFO NUTTIMERINFO

Timer type.