EE445M RTOS
Taken at the University of Texas Spring 2015
timer.h
Go to the documentation of this file.
1 /* -*- mode: c; c-basic-offset: 4; -*- */
2 #ifndef __TIMER__
3 #define __TIMER__
4 
5 #include <stdint.h>
6 #include <stdbool.h>
7 
8 #include "libhw/hardware.h"
9 
11 #define timer_metadata_init_(_name, _base, _frequency, _interrupt, _periodic) \
12  hw_metadata _name; \
13  _name.timer = (hw_timer_metadata) { \
14  .base = (memory_address_t) _base, \
15  .frequency = (uint32_t) _frequency, \
16  .interrupt = (uint32_t) _interrupt, \
17  .periodic = (uint32_t) _periodic \
18  }
19 
21 #define timer_metadata_init(_base, _frequency, _interrupt, _periodic) \
22  timer_metadata_init_(timer_metadata, _base, _frequency, _interrupt, _periodic)
23 
27 void timer_add_interrupt(hw_metadata metadata);
28 
29 #endif /* __TIMER__ */
void timer_add_interrupt(hw_metadata metadata)
Definition: timer.c:18