26 lines
561 B
C
26 lines
561 B
C
|
#ifndef TIMER_H
|
||
|
#define TIMER_H
|
||
|
|
||
|
#include <avr/io.h>
|
||
|
#include <avr/interrupt.h>
|
||
|
|
||
|
/*
|
||
|
* Initializes the timer, and resets the timer count to 0. Sets up the ISRs
|
||
|
* linked with timer1.
|
||
|
*/
|
||
|
void timer_init();
|
||
|
|
||
|
/*
|
||
|
* Returns the number of milliseconds which have elapsed since the
|
||
|
* last time timer_init() was called. Overflows after about 49 days.
|
||
|
*/
|
||
|
uint64_t timer_millis();
|
||
|
|
||
|
/*
|
||
|
* Returns the number of microseconds which have elapsed since the
|
||
|
* last time timer_init() was called. Overflows after about 71 minutes.
|
||
|
*/
|
||
|
uint64_t timer_micros();
|
||
|
|
||
|
#endif
|