evtimer.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-17 Kaspar Schleiser <kaspar@schleiser.de>
3  * 2017 Freie Universit├Ąt Berlin
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
9 
43 #ifndef EVTIMER_H
44 #define EVTIMER_H
45 
46 #include <stdint.h>
47 
48 #include "xtimer.h"
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
57 typedef struct evtimer_event {
58  struct evtimer_event *next;
59  uint32_t offset;
61 
66 
70 typedef struct {
75 } evtimer_t;
76 
83 void evtimer_init(evtimer_t *evtimer, evtimer_callback_t handler);
84 
92 
100 
106 void evtimer_print(const evtimer_t *evtimer);
107 
108 #ifdef __cplusplus
109 }
110 #endif
111 
112 #endif /* EVTIMER_H */
113 
void evtimer_init(evtimer_t *evtimer, evtimer_callback_t handler)
Initializes an event timer.
void evtimer_del(evtimer_t *evtimer, evtimer_event_t *event)
Removes an event from an event timer.
void evtimer_add(evtimer_t *evtimer, evtimer_event_t *event)
Adds event to an event timer.
event structure
Definition: event.h:127
xtimer_t timer
Timer.
Definition: evtimer.h:71
struct evtimer_event * next
the next event in the queue
Definition: evtimer.h:58
uint32_t offset
offset in milliseconds from previous event
Definition: evtimer.h:59
void evtimer_print(const evtimer_t *evtimer)
Print overview of current state of an event timer.
evtimer_event_t * events
Event queue.
Definition: evtimer.h:74
Event timer.
Definition: evtimer.h:70
xtimer interface definitions
struct evtimer_event evtimer_event_t
Generic event.
evtimer_callback_t callback
Handler function for this evtimer&#39;s event type.
Definition: evtimer.h:72
xtimer timer structure
Definition: xtimer.h:70
void(* evtimer_callback_t)(evtimer_event_t *event)
Event timer callback type.
Definition: evtimer.h:65
Generic event.
Definition: evtimer.h:57