Millisecond interval event timers

Provides timers for events up to $2^{32}$ milliseconds in the future. More...

Detailed Description

Provides timers for events up to $2^{32}$ milliseconds in the future.

Note
Experimental and likely to replaced with unified timer API

RIOT's main timer subsystem is xtimer, but for many applications xtimer's 64-bit absolute time values are wasteful or clumsy to use.

Compared to xtimer, evtimer offers:

Files

file  evtimer.h
 evtimer API definitions
 
file  evtimer_msg.h
 IPC-based evtimer definitions.
 

Data Structures

struct  evtimer_event
 Generic event. More...
 
struct  evtimer_t
 Event timer. More...
 
struct  evtimer_msg_event_t
 IPC-message event. More...
 

Typedefs

typedef struct evtimer_event evtimer_event_t
 Generic event.
 
typedef void(* evtimer_callback_t) (evtimer_event_t *event)
 Event timer callback type.
 
typedef evtimer_t evtimer_msg_t
 IPC-message event timer.
 

Functions

void evtimer_init (evtimer_t *evtimer, evtimer_callback_t handler)
 Initializes an event timer. More...
 
void evtimer_add (evtimer_t *evtimer, evtimer_event_t *event)
 Adds event to an event timer. More...
 
void evtimer_del (evtimer_t *evtimer, evtimer_event_t *event)
 Removes an event from an event timer. More...
 
void evtimer_print (const evtimer_t *evtimer)
 Print overview of current state of an event timer. More...
 
static void evtimer_add_msg (evtimer_msg_t *evtimer, evtimer_msg_event_t *event, kernel_pid_t target_pid)
 Adds event to an event timer that handles events via IPC. More...
 
static void _evtimer_msg_handler (evtimer_event_t *event)
 Event handler for IPC messages. More...
 
static void evtimer_init_msg (evtimer_t *evtimer)
 Initializes event timer to handle events via IPC. More...
 

Function Documentation

◆ _evtimer_msg_handler()

static void _evtimer_msg_handler ( evtimer_event_t event)
inlinestatic

Event handler for IPC messages.

Parameters
[in]eventThe event to handle

Definition at line 67 of file evtimer_msg.h.

◆ evtimer_add()

void evtimer_add ( evtimer_t evtimer,
evtimer_event_t event 
)

Adds event to an event timer.

Parameters
[in]evtimerAn event timer
[in]eventAn event

◆ evtimer_add_msg()

static void evtimer_add_msg ( evtimer_msg_t evtimer,
evtimer_msg_event_t event,
kernel_pid_t  target_pid 
)
inlinestatic

Adds event to an event timer that handles events via IPC.

Parameters
[in]evtimerAn event timer
[in]eventAn event
[in]target_pidThe PID of the thread that should receive the IPC message

Definition at line 53 of file evtimer_msg.h.

◆ evtimer_del()

void evtimer_del ( evtimer_t evtimer,
evtimer_event_t event 
)

Removes an event from an event timer.

Parameters
[in]evtimerAn event timer
[in]eventAn event

◆ evtimer_init()

void evtimer_init ( evtimer_t evtimer,
evtimer_callback_t  handler 
)

Initializes an event timer.

Parameters
[in]evtimerAn event timer
[in]handlerAn event handler function

◆ evtimer_init_msg()

static void evtimer_init_msg ( evtimer_t evtimer)
inlinestatic

Initializes event timer to handle events via IPC.

Parameters
[in]evtimerAn event timer

Definition at line 78 of file evtimer_msg.h.

◆ evtimer_print()

void evtimer_print ( const evtimer_t evtimer)

Print overview of current state of an event timer.

Parameters
[in]evtimerAn event timer