1
0
mirror of synced 2024-11-22 09:14:24 +01:00
avr_demo/button_debounce/timer.h

26 lines
561 B
C
Raw Normal View History

2011-10-10 23:18:21 +02:00
#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