mca-pendel/sketches/pendulum/timer.h
2018-04-04 11:51:21 +02:00

24 lines
529 B
C

#ifndef _TIMER_H_
#define _TIMER_H_
#include <avr/interrupt.h>
#include <avr/io.h>
#include <stdint.h>
void timer_init(void);
void timer_reset(void);
void timer_overflow(void);
// ISR(TIMER1_OVF_vect);
uint32_t timer_now32(void);
uint64_t timer_now64(void);
// counter | Timer1 | Timer0
// 61(31)...24 | 23...8 | 7...0 <- Bits
// 838.8608ms | 12.8µs | 50ns <- each lowest Bit represents
uint32_t volatile highBits32; // max: ~214.7483648s
uint64_t volatile highBits64; // max: ~29247a
#endif