X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=firmware%2Ftimer.h;fp=firmware%2Ftimer.h;h=2fbda8e8582a5e96195cda269ddedc532e2a1afb;hb=4a84796ece27d02c5d72cb85f95ee4cd0b29e04d;hp=fa2cd863ae93f18220da8fc07785079091cda232;hpb=258600f95f62ba4fbe745da4aebdd1a496af0050;p=r2c2.git diff --git a/firmware/timer.h b/firmware/timer.h index fa2cd86..2fbda8e 100644 --- a/firmware/timer.h +++ b/firmware/timer.h @@ -1,9 +1,23 @@ +/* $Id$ + +This file is part of the MSP Märklin suite +Copyright © 2010 Mikkosoft Productions, Mikko Rasa +Distributed under the GPL +*/ + #ifndef TIMER_H_ #define TIMER_H_ -typedef void TimerCallback(void); +#include + +#define TIMER_SET_CALLBACK(n, f) \ + ISR(TIMER ## n ## _COMPA_vect) \ + { \ + f(); \ + } -void timer_init(uint16_t, uint8_t); -void timer_set_callback(TimerCallback *); +void timer_start_hz(uint8_t, uint32_t, uint8_t); +void timer_start_us(uint8_t, uint32_t); +void timer_stop(uint8_t); #endif