MicrOS
timer.h File Reference
#include "cpu/pic/pic.h"
#include "cpu/idt/idt.h"
#include "assembly/io.h"

Go to the source code of this file.

Macros

#define CHANNEL0_PORT   0x40
 
#define MODE_COMMAND_REGISTER   0x43
 
#define TIMER_FREQUENCY_HZ   1193182
 
#define TARGET_FREQUENCY   1000
 

Functions

void timer_init ()
 
uint16_t timer_get_reload_value ()
 
uint32_t timer_get_expected_clock_fraction ()
 
uint32_t timer_get_system_clock ()
 
bool timer_interrupt ()
 
void timer_sleep (uint32_t time)
 Function makes sleep by checking how much time elapsed. More...
 
bool timer_does_elapsed (uint32_t start_time, uint32_t time_to_elapsed)
 Measures if enought time elapsed from start. More...
 

Macro Definition Documentation

◆ CHANNEL0_PORT

#define CHANNEL0_PORT   0x40

◆ MODE_COMMAND_REGISTER

#define MODE_COMMAND_REGISTER   0x43

◆ TARGET_FREQUENCY

#define TARGET_FREQUENCY   1000

◆ TIMER_FREQUENCY_HZ

#define TIMER_FREQUENCY_HZ   1193182

Function Documentation

◆ timer_does_elapsed()

bool timer_does_elapsed ( uint32_t  start_time,
uint32_t  time_to_elapsed 
)

Measures if enought time elapsed from start.

Parameters
start_timeTime from which we start count in miliseconds.
time_to_elapsedTime in miliseonds that should elapsed since start_time.
Returns
true if time_to_elapsed elapsed since start_time

◆ timer_get_expected_clock_fraction()

uint32_t timer_get_expected_clock_fraction ( )

◆ timer_get_reload_value()

uint16_t timer_get_reload_value ( )

◆ timer_get_system_clock()

uint32_t timer_get_system_clock ( )

◆ timer_init()

void timer_init ( )

◆ timer_interrupt()

bool timer_interrupt ( )

◆ timer_sleep()

void timer_sleep ( uint32_t  time)

Function makes sleep by checking how much time elapsed.

Parameters
timeTime for sleep in miliseonds.