Miosix  2.01
miosix::TimeConversion Class Reference

#include <timeconversion.h>

Static Public Member Functions

static void setTimerFrequency (unsigned int hz)
 
static long long tick2ns (long long tick)
 
static long long ns2tick (long long ns)
 
static TimeConversionFactor getTick2nsConversion ()
 
static TimeConversionFactor getNs2tickConversion ()
 

Detailed Description

This class allows to convert the time from the system timer ticks to nanoseconds and back. Notice that although this class only contains static member functions, it allows inlining of the conversion member functions while still encapsulating the conversion factors.

Member Function Documentation

static TimeConversionFactor miosix::TimeConversion::getNs2tickConversion ( )
inlinestatic
Returns
the conversion factor from ns to tick
static TimeConversionFactor miosix::TimeConversion::getTick2nsConversion ( )
inlinestatic
Returns
the conversion factor from ticks to ns
static long long miosix::TimeConversion::ns2tick ( long long  ns)
inlinestatic
Parameters
nstime point in nanoseconds
Returns
the equivalent time point in the timer tick timescale

Do not call this functions before setTimerFrequency() !

void miosix::TimeConversion::setTimerFrequency ( unsigned int  hz)
static

Set the conversion factors based on the timer frequency.

Parameters
hztimer clock frequency in Hz
static long long miosix::TimeConversion::tick2ns ( long long  tick)
inlinestatic
Parameters
ticktime point in timer ticks
Returns
the equivalent time point in the nanosecond timescale

Do not call this functions before setTimerFrequency() !


The documentation for this class was generated from the following files: