Go to the documentation of this file.
33 #ifndef PERIPH_TIMER_H
34 #define PERIPH_TIMER_H
39 #include "periph_cpu.h"
40 #include "periph_conf.h"
52 #define TIMER_DEV(x) (x)
59 #define TIMER_UNDEF (UINT_MAX)
77 #ifndef TIM_FLAG_RESET_ON_SET
78 #define TIM_FLAG_RESET_ON_SET (0x01)
88 #ifndef TIM_FLAG_RESET_ON_MATCH
89 #define TIM_FLAG_RESET_ON_MATCH (0x02)
103 #ifndef HAVE_TIMER_ISR_CTX_T
int timer_init(tim_t dev, uint32_t freq, timer_cb_t cb, void *arg)
Initialize the given timer.
int timer_set_absolute(tim_t dev, int channel, unsigned int value)
Set an absolute timeout value for the given channel of the given timer.
void(* timer_cb_t)(void *arg, int channel)
Signature of event callback functions triggered from interrupts.
unsigned int tim_t
Default timer type.
timer_cb_t cb
callback executed from timer interrupt
int timer_set(tim_t dev, int channel, unsigned int timeout)
Set a given timer channel for the given timer device.
void * arg
optional argument given to that callback
Default interrupt context entry holding callback and argument.
void timer_start(tim_t dev)
Start the given timer.
unsigned int timer_read(tim_t dev)
Read the current value of the given timer device.
int timer_set_periodic(tim_t dev, int channel, unsigned int value, uint8_t flags)
Set an absolute timeout value for the given channel of the given timer.
void timer_stop(tim_t dev)
Stop the given timer.
int timer_clear(tim_t dev, int channel)
Clear the given channel of the given timer device.