Lines Matching +full:timer +full:- +full:triggered
2 * Copyright (c) 2014-2015 Wind River Systems, Inc.
5 * SPDX-License-Identifier: Apache-2.0
8 #include <zephyr/drivers/timer/system_timer.h>
18 * use secure Timer 0
43 /* arc timer has 32 bit, here use 31 bit to avoid the possible
51 #define MAX_TICKS ((COUNTER_MAX / CYC_PER_TICK) - 1)
73 * This local variable holds the amount of timer cycles elapsed
78 * HW timer is calculated as:
93 * timer wraps ('overflows') and is used in the calculation
165 * timer wraps (overflows).
168 * - reprogramming of LIMIT must be clearing the COUNT
169 * - ISR must be clearing the 'overflow_cycles' counter.
170 * - no more than one counter-wrap has occurred between
171 * - the timer reset or the last time the function was called
172 * - and until the current call of the function is completed.
173 * - the function is invoked with interrupts disabled.
189 /* use sw triggered irq to remember the timer irq request in elapsed()
227 dticks = (curr_time - last_time) / CYC_PER_TICK; in timer_int_handler()
235 /* timer_int_handler may be triggered by timer irq or in timer_int_handler()
252 dticks = (cycle_count - announced_cycles) / CYC_PER_TICK; in timer_int_handler()
266 /* as 64-bits GFRC is used as wall clock, it's ok to ignore idle in sys_clock_set_timeout()
268 * However for single core using 32-bits arc timer, idle cannot in sys_clock_set_timeout()
269 * be ignored, as 32-bits timer will overflow in a not-long time. in sys_clock_set_timeout()
285 * use MIN_DEALY here can trigger the timer in sys_clock_set_timeout()
293 timer0_limit_register_set(delay - 1); in sys_clock_set_timeout()
313 ticks = MIN(MAX_TICKS, (uint32_t)(MAX((int32_t)(ticks - 1), 0))); in sys_clock_set_timeout()
328 unannounced = cycle_count - announced_cycles; in sys_clock_set_timeout()
331 /* We haven't announced for more than half the 32-bit in sys_clock_set_timeout()
346 delay -= unannounced; in sys_clock_set_timeout()
352 timer0_limit_register_set(last_load - 1); in sys_clock_set_timeout()
370 cyc = (z_arc_connect_gfrc_read() - last_time); in sys_clock_elapsed()
372 cyc = elapsed() + cycle_count - announced_cycles; in sys_clock_elapsed()
383 return z_arc_connect_gfrc_read() - start_time; in sys_clock_cycle_get_32()
411 * This routine is used to program the ARCv2 timer to deliver interrupts at the
419 /* ensure that the timer will not generate interrupts */ in sys_clock_driver_init()
426 timer0_limit_register_set(CYC_PER_TICK - 1); in sys_clock_driver_init()
437 timer0_limit_register_set(last_load - 1); in sys_clock_driver_init()