The friendly Operating System for the Internet of Things
timer.h File Reference

Low-level timer peripheral driver interface definitions. More...

Detailed Description

#include <limits.h>
#include "periph_cpu.h"
#include "periph/dev_enums.h"
+ Include dependency graph for timer.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  timer_isr_ctx_t
 Default interrupt context entry holding callback and argument. More...
 

Macros

#define TIMER_DEV(x)   (x)
 Default timer definition macro. More...
 
#define TIMER_UNDEF   (UINT_MAX)
 Default value for timer not defined.
 

Typedefs

typedef unsigned int tim_t
 Default timer type. More...
 
typedef void(* timer_cb_t) (void *arg, int channel)
 Signature of event callback functions triggered from interrupts. More...
 

Functions

int timer_init (tim_t dev, unsigned long freq, timer_cb_t cb, void *arg)
 Initialize the given timer. More...
 
int timer_set (tim_t dev, int channel, unsigned int timeout)
 Set a given timer channel for the given timer device. More...
 
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. More...
 
int timer_clear (tim_t dev, int channel)
 Clear the given channel of the given timer device. More...
 
unsigned int timer_read (tim_t dev)
 Read the current value of the given timer device. More...
 
void timer_start (tim_t dev)
 Start the given timer. More...
 
void timer_stop (tim_t dev)
 Stop the given timer. More...