1.5.4.4.4 SRV_TIME_MANAGEMENT_CountToUS Function

C

uint32_t SRV_TIME_MANAGEMENT_CountToUS(uint64_t counter);

Summary

Converts a given time in cycles and returns the equivalent value in microseconds.

Description

This routine makes use of SYS_TIME service to convert a value in cycles and return a value in microseconds.

Precondition

SYS_TIME_Initialize routine must have been called before.

Parameters

Param Description
counter

Cycles of the counter

Returns

Converted time in microseconds.

Example

uint64_t timeReceptionCounter;
uint32_t timeUs;

timeUs = SRV_TIME_MANAGEMENT_CountToUS(timeReceptionCounter);

printf("Transmission Reception time:%u", timeUs);

Remarks

Cycles to convert should be as close as possible to the current value to avoid an overflow.