/Zephyr-Core-3.6.0/drivers/timer/ |
D | Kconfig | 1 # Timer driver configuration options 10 menu "Timer drivers" 19 bool "Timer queries its hardware to find its frequency at runtime" 25 bool "Timer allowed to skew uptime clock during idle" 27 When true, the timer driver is not required to maintain a 46 Timer drivers should select this flag if they are capable of 66 source "drivers/timer/Kconfig.altera_avalon" 67 source "drivers/timer/Kconfig.ambiq" 68 source "drivers/timer/Kconfig.x86" 69 source "drivers/timer/Kconfig.arcv2" [all …]
|
D | Kconfig.x86 | 7 prompt "Default System Timer" 12 Select Default System Timer. 15 bool "HPET timer" 23 This option selects High Precision Event Timer (HPET) as a 24 system timer. 27 bool "Local APIC timer" 39 bool "Local APIC timer using TSC deadline mode" 44 Extremely simple timer driver based the local APIC TSC 59 int "Local APIC timer IRQ" 62 This option specifies the IRQ used by the local APIC timer. [all …]
|
D | ite_it8xxx2_timer.c | 9 #include <zephyr/drivers/timer/system_timer.h> 17 LOG_MODULE_REGISTER(timer, LOG_LEVEL_ERR); 22 "ITE RTOS timer HW frequency is fixed at 32768Hz"); 24 /* Event timer configurations */ 28 /* Event timer max count is 512 sec (base on clock source 32768Hz) */ 31 /* Busy wait low timer configurations */ 36 /* Busy wait high timer configurations */ 40 /* Busy wait high timer max count is 71.58min (base on clock source 1MHz) */ 44 const int32_t z_sys_timer_irq_for_test = DT_IRQ_BY_IDX(DT_NODELABEL(timer), 5, irq); 49 * One shot timer configurations [all …]
|
D | Kconfig.xtensa | 7 bool "Xtensa timer support" 12 Enables a system timer driver for Xtensa based on the CCOUNT 16 int "System timer CCOMPAREn register index" 21 used for the system timer. Xtensa CPUs have hard-configured 22 interrupt priorities associated with each timer, and some of 24 need synchronization, like the timer subsystem!). In 25 general timer zero is guaranteed to be present and usable.
|
D | Kconfig.cortex_m_systick | 6 DT_CHOSEN_IDLE_TIMER := zephyr,cortex-m-idle-timer 9 bool "Cortex-M SYSTICK timer" 21 SYSTICK timer and provides the standard "system clock driver" interfaces. 31 bool "Cortex-M SYSTICK timer with sys_clock_cycle_get_64() support" 47 bool "Use an additional timer while entering IDLE" 53 There are chips e.g. STMFX family that use SysTick as a system timer, 55 another timer that is not stopped, but it has lower frequency e.g. 56 RTC, thus it can't be used as a main system timer. 58 Use the IDLE timer for timeout (wakeup) when the system is entering 61 The chosen IDLE timer node has to support setting alarm from the
|
D | npcx_itim_timer.c | 18 * - A system timer based on an ITIM64 (Internal 64-bit timer) instance, clocked 26 * - A event timer based on an ITIM32 (Internal 32-bit timer) instance, clocked 31 * - Its prescaler is set to 1 and the formula between event timer's cycles and 39 #include <zephyr/drivers/timer/system_timer.h> 72 /* Announced cycles in system timer before executing sys_clock_announce() */ 77 /* Current target cycles of time-out signal in event timer */ 79 /* Total cycles of system timer stopped in "sleep/deep sleep" mode */ 81 /* Current cycles in event timer when ec entered "sleep/deep sleep" mode */ 99 /* Return current value of 64-bit counter value of system timer */ in npcx_itim_get_sys_cyc64() 112 /* Enable event timer and wait for it to take effect */ in npcx_itim_evt_enable() [all …]
|
/Zephyr-Core-3.6.0/subsys/portability/cmsis_rtos_v2/ |
D | timer.c | 14 static void zephyr_timer_wrapper(struct k_timer *timer); 26 static void zephyr_timer_wrapper(struct k_timer *timer) in zephyr_timer_wrapper() argument 30 cm_timer = CONTAINER_OF(timer, struct cv2_timer, z_timer); in zephyr_timer_wrapper() 35 * @brief Create a Timer 40 struct cv2_timer *timer; in osTimerNew() local 54 if (k_mem_slab_alloc(&cv2_timer_slab, (void **)&timer, K_MSEC(100)) == 0) { in osTimerNew() 55 (void)memset(timer, 0, sizeof(struct cv2_timer)); in osTimerNew() 60 timer->callback_function = func; in osTimerNew() 61 timer->arg = argument; in osTimerNew() 62 timer->type = type; in osTimerNew() [all …]
|
/Zephyr-Core-3.6.0/kernel/ |
D | timer.c | 23 * @brief Handle expiration of a kernel timer object. 25 * @param t Timeout used by the timer. 29 struct k_timer *timer = CONTAINER_OF(t, struct k_timer, timeout); in z_timer_expiration_handler() local 36 * this function. Usually, the timeout structure related to the timer in z_timer_expiration_handler() 39 * interrupts are locked again, a given timer gets restarted from an in z_timer_expiration_handler() 40 * interrupt context that has a priority higher than the system timer in z_timer_expiration_handler() 41 * interrupt. Then, the timeout structure for this timer will turn out in z_timer_expiration_handler() 42 * to be linked to the timeout list. And in such case, since the timer in z_timer_expiration_handler() 52 * if the timer is periodic, start it again; don't add _TICK_ALIGN in z_timer_expiration_handler() 55 if (!K_TIMEOUT_EQ(timer->period, K_NO_WAIT) && in z_timer_expiration_handler() [all …]
|
/Zephyr-Core-3.6.0/subsys/portability/cmsis_rtos_v1/ |
D | cmsis_timer.c | 14 static void zephyr_timer_wrapper(struct k_timer *timer); 27 static void zephyr_timer_wrapper(struct k_timer *timer) in zephyr_timer_wrapper() argument 31 cm_timer = CONTAINER_OF(timer, struct timer_obj, ztimer); in zephyr_timer_wrapper() 36 * @brief Create a Timer 41 struct timer_obj *timer; in osTimerCreate() local 51 if (k_mem_slab_alloc(&cmsis_timer_slab, (void **)&timer, K_MSEC(100)) == 0) { in osTimerCreate() 52 (void)memset(timer, 0, sizeof(struct timer_obj)); in osTimerCreate() 57 timer->callback_function = timer_def->ptimer; in osTimerCreate() 58 timer->arg = argument; in osTimerCreate() 59 timer->type = type; in osTimerCreate() [all …]
|
/Zephyr-Core-3.6.0/lib/posix/options/ |
D | timer.c | 37 struct timer_obj *timer; in zephyr_timer_wrapper() local 39 timer = (struct timer_obj *)ztimer; in zephyr_timer_wrapper() 41 if (timer->reload == 0U) { in zephyr_timer_wrapper() 42 timer->status = NOT_ACTIVE; in zephyr_timer_wrapper() 43 LOG_DBG("timer %p not active", timer); in zephyr_timer_wrapper() 47 if (timer->evp.sigev_notify == SIGEV_NONE) { in zephyr_timer_wrapper() 52 if (timer->evp.sigev_notify_function == NULL) { in zephyr_timer_wrapper() 57 LOG_DBG("calling sigev_notify_function %p", timer->evp.sigev_notify_function); in zephyr_timer_wrapper() 58 (timer->evp.sigev_notify_function)(timer->evp.sigev_value); in zephyr_timer_wrapper() 64 struct timer_obj *timer = (struct timer_obj *)arg; in zephyr_thread_wrapper() local [all …]
|
/Zephyr-Core-3.6.0/doc/kernel/services/timing/ |
D | timers.rst | 6 A :dfn:`timer` is a kernel object that measures the passage of time 7 using the kernel's system clock. When a timer's specified time limit 19 Any number of timers can be defined (limited only by available RAM). Each timer 22 A timer has the following key properties: 24 * A **duration** specifying the time interval before the timer 28 * A **period** specifying the time interval between all timer 31 ``K_FOREVER`` means that the timer is a one-shot timer that stops 32 after a single expiration. (For example then, if a timer is started 36 * An **expiry function** that is executed each time the timer expires. 40 * A **stop function** that is executed if the timer is stopped prematurely [all …]
|
/Zephyr-Core-3.6.0/subsys/usb/usb_c/ |
D | usbc_timer.h | 13 * @brief USB-C Timer Object 16 /** kernel timer */ 17 struct k_timer timer; member 20 /** flags to track timer status */ 25 * @brief Initialize a timer 27 * @param usbc_timer timer object 28 * @param timeout_ms timer timeout in ms 33 * @brief Start a timer 35 * @param usbc_timer timer object 40 * @brief Check if a timer has expired [all …]
|
D | usbc_timer.c | 9 /** Timer flag to track if timer was started */ 11 /** Timer flag to track if timer has expired */ 15 * @brief The timer function that's executed when the timer expires 17 static void usbc_timer_handler(struct k_timer *timer) in usbc_timer_handler() argument 19 struct usbc_timer_t *usbc_timer = k_timer_user_data_get(timer); in usbc_timer_handler() 26 k_timer_init(&usbc_timer->timer, usbc_timer_handler, NULL); in usbc_timer_init() 27 k_timer_user_data_set(&usbc_timer->timer, usbc_timer); in usbc_timer_init() 35 k_timer_start(&usbc_timer->timer, K_MSEC(usbc_timer->timeout_ms), K_NO_WAIT); in usbc_timer_start() 59 k_timer_stop(&usbc_timer->timer); in usbc_timer_stop()
|
/Zephyr-Core-3.6.0/tests/subsys/portability/cmsis_rtos_v2/src/ |
D | timer.c | 29 TC_PRINT("oneshot_callback (Timer %d) = %d\n", in Timer1_Callback() 38 TC_PRINT("periodic_callback (Timer %d) = %d\n", in Timer2_Callback() 52 /* Create one-shot timer */ in ZTEST() 55 zassert_true(id1 != NULL, "error creating one-shot timer"); in ZTEST() 59 "Error getting Timer name"); in ZTEST() 61 /* Stop the timer before start */ in ZTEST() 64 "error while stopping non-active timer"); in ZTEST() 68 zassert_true(status == osOK, "error starting one-shot timer"); in ZTEST() 70 zassert_equal(osTimerIsRunning(id1), 1, "Error: Timer not running"); in ZTEST() 72 /* Timer should fire only once if setup in one shot in ZTEST() [all …]
|
/Zephyr-Core-3.6.0/tests/kernel/timer/timer_api/src/ |
D | main.c | 43 * remaining time for a partially elapsed timer in ticks will be 52 static void duration_expire(struct k_timer *timer); 53 static void duration_stop(struct k_timer *timer); 55 /** TESTPOINT: init timer via K_TIMER_DEFINE */ 113 static void duration_expire(struct k_timer *timer) in duration_expire() argument 120 TIMER_ASSERT(interval_check(interval, DURATION), timer); in duration_expire() 122 TIMER_ASSERT(interval_check(interval, PERIOD), timer); in duration_expire() 126 k_timer_stop(timer); in duration_expire() 130 static void duration_stop(struct k_timer *timer) in duration_stop() argument 135 static void period0_expire(struct k_timer *timer) in period0_expire() argument [all …]
|
/Zephyr-Core-3.6.0/drivers/counter/ |
D | counter_smartbond_timer.c | 39 /* Register set for timer */ 40 TIMER2_Type *timer; member 42 /* Timer driven by DIVn if 1 or lp_clk if 0 */ 53 TIMER2_Type *timer = config->timer; in counter_smartbond_start() local 56 timer->TIMER2_CTRL_REG |= TIMER_TIMER_CTRL_REG_TIM_CLK_EN_Msk | in counter_smartbond_start() 67 TIMER2_Type *timer = config->timer; in counter_smartbond_stop() local 70 timer->TIMER2_CTRL_REG &= ~(TIMER2_TIMER2_CTRL_REG_TIM_EN_Msk | in counter_smartbond_stop() 87 TIMER2_Type *timer = config->timer; in counter_smartbond_read() local 89 return timer->TIMER2_TIMER_VAL_REG; in counter_smartbond_read() 104 TIMER2_Type *timer = config->timer; in counter_smartbond_set_alarm() local [all …]
|
D | counter_ll_stm32_timer.c | 26 /** Maximum number of timer channels. */ 29 /** Number of channels for timer by index. */ 111 TIM_TypeDef *timer; member 123 TIM_TypeDef *timer = config->timer; in counter_stm32_start() local 126 LL_TIM_EnableCounter(timer); in counter_stm32_start() 134 TIM_TypeDef *timer = config->timer; in counter_stm32_stop() local 137 LL_TIM_DisableCounter(timer); in counter_stm32_stop() 146 return LL_TIM_GetAutoReload(config->timer); in counter_stm32_get_top_value() 153 return LL_TIM_GetCounter(config->timer); in counter_stm32_read() 205 TIM_TypeDef *timer = config->timer; in counter_stm32_set_cc() local [all …]
|
D | dualtimer_cmsdk_apb.h | 16 /* Offset: 0x000 (R/W) Timer 1 Load */ 18 /* Offset: 0x004 (R/ ) Timer 1 Counter Current Value */ 20 /* Offset: 0x008 (R/W) Timer 1 Control */ 22 /* Offset: 0x00C ( /W) Timer 1 Interrupt Clear */ 24 /* Offset: 0x010 (R/ ) Timer 1 Raw Interrupt Status */ 26 /* Offset: 0x014 (R/ ) Timer 1 Masked Interrupt Status */ 32 /* Offset: 0x020 (R/W) Timer 2 Load */ 34 /* Offset: 0x024 (R/ ) Timer 2 Counter Current Value */ 36 /* Offset: 0x028 (R/W) Timer 2 Control */ 38 /* Offset: 0x02C ( /W) Timer 2 Interrupt Clear */ [all …]
|
/Zephyr-Core-3.6.0/tests/subsys/portability/cmsis_rtos_v1/src/ |
D | timer.c | 28 TC_PRINT("oneshot_callback (Timer %d) = %d\n", in Timer1_Callback() 37 TC_PRINT("periodic_callback (Timer %d) = %d\n", in Timer2_Callback() 50 /* Create one-shot timer */ in ZTEST() 53 zassert_true(id1 != NULL, "error creating one-shot timer"); in ZTEST() 55 /* Stop the timer before start */ in ZTEST() 57 zassert_true(status == osErrorResource, "error while stopping non-active timer"); in ZTEST() 61 zassert_true(status == osOK, "error starting one-shot timer"); in ZTEST() 63 /* Timer should fire only once if setup in one shot in ZTEST() 69 "error setting up one-shot timer"); in ZTEST() 72 zassert_true(status == osOK, "error stopping one-shot timer"); in ZTEST() [all …]
|
/Zephyr-Core-3.6.0/samples/drivers/counter/alarm/src/ |
D | main.c | 19 #define TIMER DT_NODELABEL(tc4) macro 21 #define TIMER DT_NODELABEL(tc0) macro 23 #define TIMER DT_NODELABEL(extrtc0) macro 25 #define TIMER DT_NODELABEL(rtc0) macro 27 #define TIMER DT_INST(0, st_stm32_counter) macro 29 #define TIMER DT_INST(0, st_stm32_rtc) macro 31 #define TIMER DT_NODELABEL(timer3) macro 33 #define TIMER DT_NODELABEL(counter0) macro 35 #define TIMER DT_INST(0, xlnx_xps_timer_1_00_a) macro 37 #define TIMER DT_NODELABEL(timer0) macro [all …]
|
/Zephyr-Core-3.6.0/drivers/pwm/ |
D | pwm_stm32.c | 79 /** Timer clock (Hz). */ 90 TIM_TypeDef *timer; member 101 /** Maximum number of timer channels : some stm32 soc have 6 else only 4 */ 131 /** Maximum number of complemented timer channels is ARRAY_SIZE(ch2ll_n)*/ 217 * Obtain timer clock speed. 219 * @param pclken Timer clock control subsystem. 220 * @param tim_clk Where computed timer clock will be stored. 271 * Up to a certain threshold value of APB{1,2} prescaler, timer clock in get_tim_clk() 273 * (2 if TIMPRE=0, 4 if TIMPRE=1). Above threshold, timer clock is set in get_tim_clk() 301 * If the APB prescaler equals 1, the timer clock frequencies in get_tim_clk() [all …]
|
D | pwm_gecko.c | 16 TIMER_TypeDef *timer; member 33 if (BUS_RegMaskedRead(&cfg->timer->CC[channel].CTRL, in pwm_gecko_set_cycles() 37 BUS_RegMaskedWrite(&cfg->timer->ROUTE, in pwm_gecko_set_cycles() 40 BUS_RegMaskedSet(&cfg->timer->ROUTE, 1 << channel); in pwm_gecko_set_cycles() 42 BUS_RegMaskedWrite(&cfg->timer->ROUTELOC0, in pwm_gecko_set_cycles() 46 BUS_RegMaskedSet(&cfg->timer->ROUTEPEN, 1 << channel); in pwm_gecko_set_cycles() 52 TIMER_InitCC(cfg->timer, channel, &compare_config); in pwm_gecko_set_cycles() 55 cfg->timer->CC[channel].CTRL |= (flags & PWM_POLARITY_INVERTED) ? in pwm_gecko_set_cycles() 58 TIMER_TopSet(cfg->timer, period_cycles); in pwm_gecko_set_cycles() 60 TIMER_CompareBufSet(cfg->timer, channel, pulse_cycles); in pwm_gecko_set_cycles() [all …]
|
/Zephyr-Core-3.6.0/dts/bindings/pwm/ |
D | espressif,esp32-mcpwm.yaml | 17 and asymmetric configuration. MCPWMxA and MCPWMxB will share the same timer, thus having the same 20 The driver currently always use the timer x for operator x. Timer 0 will use operator 0 for 22 Timer 1 will use operator 1 for PWM1A/B, and so on. 25 Channel 0 -> Timer 0, Operator 0, output PWM0A 26 Channel 1 -> Timer 0, Operator 0, output PWM0B 27 Channel 2 -> Timer 1, Operator 1, output PWM1A 28 Channel 3 -> Timer 1, Operator 1, output PWM1B 29 Channel 4 -> Timer 2, Operator 2, output PWM2A 30 Channel 5 -> Timer 2, Operator 2, output PWM2B 89 8 bit timer prescale for the global clock. [all …]
|
/Zephyr-Core-3.6.0/tests/kernel/timer/timer_api/ |
D | testcase.yaml | 2 kernel.timer: 5 - timer 7 kernel.timer.tickless: 19 - timer 22 kernel.timer.no_multitheading: 25 - timer
|
/Zephyr-Core-3.6.0/tests/kernel/timer/timer_monotonic/ |
D | testcase.yaml | 2 kernel.timer.monotonic: 5 - timer 9 kernel.timer.monotonic.apic.tsc: 12 - timer 18 kernel.timer.monotonic.icount_off: 22 - timer
|