1.2.11.4.13 SYS_TIME_CountToUS Function
1.2.11.4.13 C
uint32_t SYS_TIME_CountToUS ( uint32_t count )
1.2.11.4.13 Summary
Converts a counter value to time interval in microseconds.
1.2.11.4.13 Description
This function converts a counter value to time interval in microseconds, based on the hardware timer frequency as configured and as reported by SYS_TIME_FrequencyGet.
1.2.11.4.13 Precondition
The SYS_TIME_Initialize function should have been called before calling this function.
1.2.11.4.13 Parameters
| Parameters | Description |
|---|---|
| count | Counter value to be converted to an equivalent value in microseconds |
1.2.11.4.13 Returns
Number of microseconds represented by the given counter value.
1.2.11.4.13 Example
Given a previously captured 32-bit counter value called "timestamp" captured using the SYS_TIME_CounterGet function, the following example will calculate the number of microseconds elapsed since timestamp was captured.
uint32_t count = SYS_TIME_CounterGet() - timestamp; uint32_t us = SYS_TIME_CountToUS(count);
1.2.11.4.13 Remarks
None.
