MicrOS
timer.c File Reference
#include "timer.h"

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...
 

Variables

uint32_t system_clock = 0
 
uint32_t system_clock_fractions = 0
 
uint16_t reload_time = 0
 
uint32_t expected_clock_fraction = 0
 

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.

Variable Documentation

◆ expected_clock_fraction

uint32_t expected_clock_fraction = 0

◆ reload_time

uint16_t reload_time = 0

◆ system_clock

uint32_t system_clock = 0

◆ system_clock_fractions

uint32_t system_clock_fractions = 0