MicrOS
timer.h
Go to the documentation of this file.
1 #ifndef TIMER_H
2 #define TIMER_H
3 
4 #define CHANNEL0_PORT 0x40
5 #define MODE_COMMAND_REGISTER 0x43
6 
7 #define TIMER_FREQUENCY_HZ 1193182
8 #define TARGET_FREQUENCY 1000
9 
10 #include "cpu/pic/pic.h"
11 #include "cpu/idt/idt.h"
12 #include "assembly/io.h"
13 
14 void timer_init();
15 uint16_t timer_get_reload_value();
18 bool timer_interrupt();
19 
21 
25 
27 
32 bool timer_does_elapsed(uint32_t start_time, uint32_t time_to_elapsed);
33 
34 #endif
bool timer_interrupt()
Definition: timer.c:59
time_t time(time_t *timer)
Get current time.
Definition: time.c:5
void timer_init()
Definition: timer.c:9
void timer_sleep(uint32_t time)
Function makes sleep by checking how much time elapsed.
Definition: timer.c:73
uint16_t timer_get_reload_value()
Definition: timer.c:43
uint32_t timer_get_expected_clock_fraction()
Definition: timer.c:49
uint32_t timer_get_system_clock()
Definition: timer.c:54
bool timer_does_elapsed(uint32_t start_time, uint32_t time_to_elapsed)
Measures if enought time elapsed from start.
Definition: timer.c:87
size_t uint32_t
Unsigned integral type.
Definition: string.h:8