]> git.tdb.fi Git - model-railway-devices.git/blobdiff - common/timer.h
Reorganize the directory structure
[model-railway-devices.git] / common / timer.h
diff --git a/common/timer.h b/common/timer.h
new file mode 100644 (file)
index 0000000..2869caa
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef TIMER_H_
+#define TIMER_H_
+
+#include <avr/interrupt.h>
+
+#define TIMER_SET_CALLBACK(n, f) \
+       ISR(TIMER ## n ## _COMPA_vect) \
+       { \
+               f(); \
+       }
+
+void timer_start_hz(uint8_t, uint32_t, uint8_t);
+void timer_start_us(uint8_t, uint32_t);
+void timer_stop(uint8_t);
+
+#endif