Lines Matching +full:temp +full:- +full:conversion +full:- +full:time +full:- +full:us

3  * SPDX-License-Identifier: Apache-2.0
49 * To reduce truncation errors from accumulating due to conversion
50 * to/from time, ticks, and HW cycles set ticks per second equal to
58 /* Mask off bits[31:28] of 32-bit count */
101 * This synchronization can take from nearly 0 time up to 1 32KHz clock as it
103 * was on. We detect the timer is in the load state by checking the read-only
121 static uint32_t last_announcement; /* last time we called sys_clock_announce() */
130 * RTMR counter register is read-only and is loaded from the preload
131 * register by a 0->1 transition of the control register start bit.
139 uint32_t ccr, temp; in sys_clock_set_timeout() local
147 * global objects safe from pre-emption? in sys_clock_set_timeout()
157 full_ticks = MAX_TICKS - 1; in sys_clock_set_timeout()
159 full_ticks = n - 1; in sys_clock_set_timeout()
173 temp = total_cycles; in sys_clock_set_timeout()
174 temp += (cached_icr - ccr); in sys_clock_set_timeout()
175 temp &= RTIMER_COUNT_MASK; in sys_clock_set_timeout()
176 total_cycles = temp; in sys_clock_set_timeout()
178 partial_cycles = CYCLES_PER_TICK - (total_cycles % CYCLES_PER_TICK); in sys_clock_set_timeout()
180 /* adjust for up to one 32KHz cycle startup time */ in sys_clock_set_timeout()
181 temp = cached_icr; in sys_clock_set_timeout()
182 if (temp > RTIMER_ADJUST_LIMIT) { in sys_clock_set_timeout()
183 temp -= RTIMER_ADJUST_CYCLES; in sys_clock_set_timeout()
186 mec_hal_rtimer_stop_and_load(rtimer, temp, RTIMER_START_VAL); in sys_clock_set_timeout()
207 elapsed = (int32_t)total_cycles - (int32_t)last_announcement; in sys_clock_elapsed()
209 elapsed = -1 * elapsed; in sys_clock_elapsed()
212 ticks += cached_icr - ccr; in sys_clock_elapsed()
241 /* handle wrap by using (power of 2) - 1 mask */ in mec5_ktimer_isr()
242 ticks = total_cycles - last_announcement; in mec5_ktimer_isr()
253 /* Non-tickless kernel build. */
265 uint32_t temp = total_cycles + CYCLES_PER_TICK; in mec5_ktimer_isr() local
267 total_cycles = temp & RTIMER_COUNT_MASK; in mec5_ktimer_isr()
280 * Warning RTOS timer resolution is 30.5 us.
282 * 1. Kernel call to k_cycle_get_32() -> arch_k_cycle_get_32() -> here.
297 ret = (total_cycles + (cached_icr - ccr)) & RTIMER_COUNT_MASK; in sys_clock_cycle_get_32()
319 * 32-bit basic timer divided down to 1 MHz. Basic timer configured
320 * for count up, auto-reload, and no interrupt mode.
333 if ((curr - start) >= usec_to_wait) { in arch_busy_wait()
340 * Configure basic timer for 1 MHz (1 us tick) operation.