aboutsummaryrefslogtreecommitdiff
path: root/include/timer.h
blob: c0b9fe88e67c358a5298613b12599c52e0fe92b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <avr/io.h>
#include <avr/interrupt.h>
#include <stdint.h>

#include "mcu/mcu_def.h"
#include "utils/narray.h"

#ifndef _IOE_TIMER_H_
#define _IOE_TIMER_H_
#ifdef CONFIG_IOE_TIMERS

enum timerDivider {
	TIMER_DIVIDER_1,
	TIMER_DIVIDER_8,
	TIMER_DIVIDER_64,
	TIMER_DIVIDER_256,
	TIMER_DIVIDER_1024
};

void timer_init(uint8_t timer, enum timerDivider div);
void timer_disable(uint8_t timer);
void timer_reset(uint8_t timer);
uint16_t timer_value(uint8_t timer);
void timer_sethook(uint8_t timer, void (*fnc) (void));
void timer_remhook(uint8_t timer, void (*fnc) (void));

#endif /* CONFIG_IOE_TIMERS */
#endif /* _IOE_TIMER_H_ */