CANopen FD Master Library
Making your systems precise, reliable and high-quality - 5.10.01
Functions
CANopen timer

Functions

uint32_t ComTmrCalcTicks (uint32_t ulReqTimingV)
 
uint32_t ComTmrCalcTime (uint32_t ulTicksV)
 
void ComTmrSetPeriod (uint32_t ulPeriodV)
 

Detailed Description

The are a number of CANopen services which require an internal timer (e.g. Heartbeat, timer-driven PDO). The timer values for these services are set in a multiple of 1 microsecond or 1 millisecond (depends on the service).

The requested time values are converted into timer ticks and vice versa with the functions ComTmrCalcTicks() and ComTmrCalcTime() respectively.

Function Documentation

◆ ComTmrCalcTicks()

uint32_t ComTmrCalcTicks ( uint32_t  ulReqTimingV)

Calculate number of timer ticks.

Parameters
ulReqTimingV- requested time in microseconds
Returns
number of required timer ticks
See also
ComTmrCalcTime()

The function calculates the number of required timer ticks (i.e. timer interrupts) based on the required time ulReqTimingV (in microseconds) and the internal timer period (see ComTmrSetPeriod()).

◆ ComTmrCalcTime()

uint32_t ComTmrCalcTime ( uint32_t  ulTicksV)

Calculate time based on timer ticks.

Parameters
ulTicksV- number of timer ticks
Returns
time in microseconds
See also
ComTmrCalcTicks()

The function calculates the time (in microseconds) based on the given number of timer ticks and the internal timer period (see ComTmrSetPeriod()).

◆ ComTmrSetPeriod()

void ComTmrSetPeriod ( uint32_t  ulPeriodV)

Configure timer period.

Parameters
ulPeriodV- number of timer ticks

The function sets the timer period which is used to call the function ComMgrTimerEvent(). The parameter ulPeriodV is a multiple of 1 microsecond. This function can be used to overwrite the default value during run-time.