![]() |
CANopen FD Master Library
Making your systems precise, reliable and high-quality - 5.10.01
|
Functions | |
uint32_t | ComTmrCalcTicks (uint32_t ulReqTimingV) |
uint32_t | ComTmrCalcTime (uint32_t ulTicksV) |
void | ComTmrSetPeriod (uint32_t ulPeriodV) |
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.
uint32_t ComTmrCalcTicks | ( | uint32_t | ulReqTimingV | ) |
Calculate number of timer ticks.
ulReqTimingV | - requested time in microseconds |
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()).
uint32_t ComTmrCalcTime | ( | uint32_t | ulTicksV | ) |
Calculate time based on timer ticks.
ulTicksV | - number of timer ticks |
The function calculates the time (in microseconds) based on the given number of timer ticks and the internal timer period (see ComTmrSetPeriod()).
void ComTmrSetPeriod | ( | uint32_t | ulPeriodV | ) |
Configure timer period.
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.