1.2.11.4.16 SYS_TIME_MSToCount Function
1.2.11.4.16 C
uint32_t SYS_TIME_MSToCount ( uint32_t ms )
1.2.11.4.16 Summary
Convert the given time interval in milliseconds to an equivalent counter value.
1.2.11.4.16 Description
This function converts a given time interval (measured in milliseconds) to an equivalent 32-bit counter value, based on the configured hardware timer frequency as reported by SYS_TIME_FrequencyGet.
1.2.11.4.16 Precondition
The SYS_TIME_Initialize function should have been called before calling this function.
1.2.11.4.16 Parameters
| Parameters | Description |
|---|---|
| ms | Time interval in milliseconds |
1.2.11.4.16 Returns
Number of hardware timer counts that will expire in the given time interval.
1.2.11.4.16 Example
uint32_t futureCounter = SYS_TIME_CounterGet() + SYS_TIME_MSToCount(10);
1.2.11.4.16 Remarks
In Tick-based mode, the returned count will be ceiled to the next timer tick. For example, if the timer tick is set to 700 µs and the requested time is 2 ms, a count of 3 will be reported (corresponding to 2.1 ms).
