/Zephyr-latest/kernel/ |
D | timer.c | 29 struct k_timer *timer = CONTAINER_OF(t, struct k_timer, timeout); in z_timer_expiration_handler() local 55 if (!K_TIMEOUT_EQ(timer->period, K_NO_WAIT) && in z_timer_expiration_handler() 56 !K_TIMEOUT_EQ(timer->period, K_FOREVER)) { in z_timer_expiration_handler() 57 k_timeout_t next = timer->period; in z_timer_expiration_handler() 76 z_add_timeout(&timer->timeout, z_timer_expiration_handler, in z_timer_expiration_handler() 81 timer->status += 1U; in z_timer_expiration_handler() 84 if (timer->expiry_fn != NULL) { in z_timer_expiration_handler() 87 timer->expiry_fn(timer); in z_timer_expiration_handler() 96 thread = z_waitq_head(&timer->wait_q); in z_timer_expiration_handler() 113 void k_timer_init(struct k_timer *timer, in k_timer_init() argument [all …]
|
/Zephyr-latest/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 cmsis_rtos_timer_cb, z_timer); in zephyr_timer_wrapper() 40 struct cmsis_rtos_timer_cb *timer; in osTimerNew() local 56 timer = (struct cmsis_rtos_timer_cb *)attr->cb_mem; in osTimerNew() 57 } else if (k_mem_slab_alloc(&cmsis_rtos_timer_cb_slab, (void **)&timer, K_MSEC(100)) != 0) { in osTimerNew() 60 (void)memset(timer, 0, sizeof(struct cmsis_rtos_timer_cb)); in osTimerNew() 61 timer->is_cb_dynamic_allocation = attr->cb_mem == NULL; in osTimerNew() 63 timer->callback_function = func; in osTimerNew() 64 timer->arg = argument; in osTimerNew() [all …]
|
/Zephyr-latest/lib/posix/options/ |
D | timer.c | 39 struct timer_obj *timer; in zephyr_timer_wrapper() local 41 timer = (struct timer_obj *)ztimer; in zephyr_timer_wrapper() 43 if (timer->reload == 0U) { in zephyr_timer_wrapper() 44 timer->status = NOT_ACTIVE; in zephyr_timer_wrapper() 45 LOG_DBG("timer %p not active", timer); in zephyr_timer_wrapper() 48 if (timer->evp.sigev_notify == SIGEV_NONE) { in zephyr_timer_wrapper() 53 if (timer->evp.sigev_notify_function == NULL) { in zephyr_timer_wrapper() 58 LOG_DBG("calling sigev_notify_function %p", timer->evp.sigev_notify_function); in zephyr_timer_wrapper() 59 (timer->evp.sigev_notify_function)(timer->evp.sigev_value); in zephyr_timer_wrapper() 65 struct timer_obj *timer = (struct timer_obj *)arg; in zephyr_thread_wrapper() local [all …]
|
/Zephyr-latest/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() 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() 60 timer->status = NOT_ACTIVE; in osTimerCreate() [all …]
|
/Zephyr-latest/drivers/timer/ |
D | silabs_sleeptimer_timer.c | 49 struct sleeptimer_timer_data *timer = data; in sleeptimer_cb() local 52 uint32_t prev = atomic_get(&timer->last_count); in sleeptimer_cb() 56 uint32_t unannounced = pending / timer->cyc_per_tick; in sleeptimer_cb() 58 atomic_set(&timer->last_count, prev + unannounced * timer->cyc_per_tick); in sleeptimer_cb() 63 static void sleeptimer_clock_set_timeout(int32_t ticks, struct sleeptimer_timer_data *timer) in sleeptimer_clock_set_timeout() argument 69 ticks = (ticks == K_TICKS_FOREVER) ? timer->max_timeout_ticks : ticks; in sleeptimer_clock_set_timeout() 70 ticks = CLAMP(ticks, 0, timer->max_timeout_ticks); in sleeptimer_clock_set_timeout() 72 k_spinlock_key_t key = k_spin_lock(&timer->lock); in sleeptimer_clock_set_timeout() 75 uint32_t pending = curr % timer->cyc_per_tick; in sleeptimer_clock_set_timeout() 76 uint32_t next = ticks * timer->cyc_per_tick; in sleeptimer_clock_set_timeout() [all …]
|
D | Kconfig | 27 When true, the timer driver is not required to maintain a 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" 70 source "drivers/timer/Kconfig.arm_arch" 71 source "drivers/timer/Kconfig.cavs" 72 source "drivers/timer/Kconfig.cc13xx_cc26xx_rtc" 73 source "drivers/timer/Kconfig.cc23x0_systim" 74 source "drivers/timer/Kconfig.wch_ch32v00x" [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 prompt "SysTick companion low-power mode timer" 48 # If all dependencies are enabled, and /chosen/cortex-m-idle-timer 49 # is enabled, default to using the Counter API-based LPM timer. 51 # automatically, and no LPM timer will be enabled. 54 It is common for SoCs equipped with SysTick to use it as system timer. 58 On such SoCs, a vendor-specific timer that remains active in low-power [all …]
|
/Zephyr-latest/modules/nrf_wifi/os/ |
D | timer.c | 23 struct timer_list *timer; in timer_expiry_function() local 25 timer = (struct timer_list *)CONTAINER_OF(work, struct timer_list, work.work); in timer_expiry_function() 27 timer->function(timer->data); in timer_expiry_function() 30 void init_timer(struct timer_list *timer) in init_timer() argument 32 k_work_init_delayable(&timer->work, timer_expiry_function); in init_timer() 35 void mod_timer(struct timer_list *timer, int msec) in mod_timer() argument 37 k_work_schedule(&timer->work, K_MSEC(msec)); in mod_timer() 40 void del_timer_sync(struct timer_list *timer) in del_timer_sync() argument 42 k_work_cancel_delayable(&timer->work); in del_timer_sync()
|
D | timer.h | 20 void init_timer(struct timer_list *timer); 22 void mod_timer(struct timer_list *timer, int msec); 24 void del_timer_sync(struct timer_list *timer);
|
/Zephyr-latest/drivers/pwm/ |
D | pwm_stm32.c | 90 TIM_TypeDef *timer; member 337 if (!IS_TIM_32B_COUNTER_INSTANCE(cfg->timer) && in pwm_stm32_set_cycles() 344 if (LL_TIM_IsEnabledIT_CC1(cfg->timer) || LL_TIM_IsEnabledIT_CC2(cfg->timer) || in pwm_stm32_set_cycles() 345 LL_TIM_IsEnabledIT_CC3(cfg->timer) || LL_TIM_IsEnabledIT_CC4(cfg->timer)) { in pwm_stm32_set_cycles() 374 LL_TIM_CC_DisableChannel(cfg->timer, current_ll_channel); in pwm_stm32_set_cycles() 393 if (!LL_TIM_CC_IsEnabledChannel(cfg->timer, current_ll_channel)) { in pwm_stm32_set_cycles() 407 oc_init.OCState = LL_TIM_CC_IsEnabledChannel(cfg->timer, ll_channel) in pwm_stm32_set_cycles() 410 oc_init.OCPolarity = LL_TIM_OC_GetPolarity(cfg->timer, ll_channel); in pwm_stm32_set_cycles() 418 LL_TIM_CC_IsEnabledChannel(cfg->timer, negative_ll_channel) in pwm_stm32_set_cycles() 422 LL_TIM_OC_GetPolarity(cfg->timer, negative_ll_channel); in pwm_stm32_set_cycles() [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-latest/drivers/counter/ |
D | counter_smartbond_timer.c | 28 #define COUNTER_DT_DEVICE(_idx) DEVICE_DT_GET_OR_NULL(DT_NODELABEL(timer##_idx)) 51 TIMER2_Type *timer; member 98 switch ((uint32_t)config->timer) { in counter_smartbond_pdc_trigger_get() 140 TIMER2_Type *timer = config->timer; in counter_smartbond_start() local 155 timer->TIMER2_CTRL_REG |= (TIMER2_TIMER2_CTRL_REG_TIM_CLK_EN_Msk | in counter_smartbond_start() 166 TIMER2_Type *timer = config->timer; in counter_smartbond_stop() local 169 timer->TIMER2_CTRL_REG &= ~(TIMER2_TIMER2_CTRL_REG_TIM_EN_Msk | in counter_smartbond_stop() 195 TIMER2_Type *timer = config->timer; in counter_smartbond_read() local 197 return timer->TIMER2_TIMER_VAL_REG; in counter_smartbond_read() 212 TIMER2_Type *timer = config->timer; in counter_smartbond_set_alarm() local [all …]
|
D | counter_ll_stm32_timer.c | 105 TIM_TypeDef *timer; member 119 TIM_TypeDef *timer = config->timer; in counter_stm32_start() local 122 LL_TIM_EnableCounter(timer); in counter_stm32_start() 130 TIM_TypeDef *timer = config->timer; in counter_stm32_stop() local 133 LL_TIM_DisableCounter(timer); in counter_stm32_stop() 142 return LL_TIM_GetAutoReload(config->timer); in counter_stm32_get_top_value() 149 return LL_TIM_GetCounter(config->timer); in counter_stm32_read() 201 TIM_TypeDef *timer = config->timer; in counter_stm32_set_cc() local 209 __ASSERT(!check_it_enabled[id](timer), in counter_stm32_set_cc() 217 prev_val = get_timer_compare[id](timer); in counter_stm32_set_cc() [all …]
|
D | timer_tmr_cmsdk_apb.c | 23 volatile struct timer_cmsdk_apb *timer; member 47 cfg->timer->reload = data->load; in tmr_cmsdk_apb_start() 49 cfg->timer->ctrl = TIMER_CTRL_EN; in tmr_cmsdk_apb_start() 59 cfg->timer->ctrl = 0x0; in tmr_cmsdk_apb_stop() 71 *ticks = data->load - cfg->timer->value; in tmr_cmsdk_apb_get_value() 94 cfg->timer->value = top_cfg->ticks; in tmr_cmsdk_apb_set_top_value() 97 cfg->timer->reload = top_cfg->ticks; in tmr_cmsdk_apb_set_top_value() 100 cfg->timer->ctrl |= TIMER_CTRL_IRQ_EN; in tmr_cmsdk_apb_set_top_value() 119 return cfg->timer->intstatus; in tmr_cmsdk_apb_get_pending_int() 138 cfg->timer->intclear = TIMER_CTRL_INT_CLEAR; in tmr_cmsdk_apb_isr() [all …]
|
/Zephyr-latest/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-latest/samples/cpp/cpp_synchronization/src/ |
D | main.cpp | 115 struct k_timer timer; in coop_thread_entry() local 117 k_timer_init(&timer, NULL, NULL); in coop_thread_entry() 127 k_timer_start(&timer, K_MSEC(SLEEPTIME), K_NO_WAIT); in coop_thread_entry() 128 k_timer_status_sync(&timer); in coop_thread_entry() 135 struct k_timer timer; in main() local 140 k_timer_init(&timer, NULL, NULL); in main() 147 k_timer_start(&timer, K_MSEC(SLEEPTIME), K_NO_WAIT); in main() 148 k_timer_status_sync(&timer); in main()
|
/Zephyr-latest/tests/subsys/pm/power_states_api/src/ |
D | test_driver.c | 16 struct k_timer timer; member 29 static void timer_expire_cb(struct k_timer *timer) in timer_expire_cb() argument 31 struct test_driver_data *data = k_timer_user_data_get(timer); in timer_expire_cb() 34 k_timer_stop(timer); in timer_expire_cb() 49 k_timer_start(&data->timer, K_MSEC(500), K_NO_WAIT); in test_driver_async_operation() 58 k_timer_init(&data->timer, timer_expire_cb, NULL); in test_driver_init() 59 k_timer_user_data_set(&data->timer, data); in test_driver_init()
|
/Zephyr-latest/dts/arm/gd/gd32e50x/ |
D | gd32e507xe.dtsi | 12 timer7: timer@40013400 { 13 compatible = "gd,gd32-timer"; 30 timer8: timer@40014c00 { 31 compatible = "gd,gd32-timer"; 47 timer9: timer@40015000 { 48 compatible = "gd,gd32-timer"; 64 timer10: timer@40015400 { 65 compatible = "gd,gd32-timer"; 81 timer11: timer@40001800 { 82 compatible = "gd,gd32-timer"; [all …]
|
/Zephyr-latest/lib/libc/common/source/time/ |
D | localtime_r_utc.c | 11 struct tm *localtime_r(const time_t *timer, struct tm *result) in localtime_r() argument 13 return gmtime_r(timer, result); in localtime_r() 16 struct tm *localtime(const time_t *timer) in localtime() argument 18 return gmtime(timer); in localtime()
|
/Zephyr-latest/tests/kernel/threads/no-multithreading/src/ |
D | main.c | 33 static void timeout_handler(struct k_timer *timer) in timeout_handler() argument 35 bool *flag = k_timer_user_data_get(timer); in timeout_handler() 40 K_TIMER_DEFINE(timer, timeout_handler, NULL); 46 k_timer_user_data_set(&timer, (void *)&timeout_run); in ZTEST() 47 k_timer_start(&timer, K_MSEC(10), K_NO_WAIT); in ZTEST() 64 k_timer_user_data_set(&timer, (void *)&timeout_run); in ZTEST() 69 k_timer_start(&timer, K_MSEC(10), K_NO_WAIT); in ZTEST()
|
/Zephyr-latest/subsys/usb/usb_c/ |
D | usbc_timer.c | 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-latest/samples/userspace/prod_consumer/src/ |
D | sample_driver_foo.c | 27 struct k_timer timer; /* to fake 'interrupts' */ member 58 data->timer.user_data = data; in sample_driver_foo_state_set() 60 k_timer_start(&data->timer, K_MSEC(100), K_MSEC(100)); in sample_driver_foo_state_set() 62 k_timer_stop(&data->timer); in sample_driver_foo_state_set() 91 static void sample_driver_timer_cb(struct k_timer *timer) in sample_driver_timer_cb() argument 93 sample_driver_foo_isr(timer->user_data); in sample_driver_timer_cb() 100 k_timer_init(&data->timer, sample_driver_timer_cb, NULL); in sample_driver_foo_init()
|
/Zephyr-latest/samples/boards/nordic/nrf53_sync_rtc/src/ |
D | main.c | 26 static void timeout_handler(struct k_timer *timer) in timeout_handler() argument 38 k_timer_stop(timer); in timeout_handler() 42 K_TIMER_DEFINE(timer, timeout_handler, NULL); 47 k_timer_start(&timer, K_MSEC(50), K_MSEC(50)); in main()
|
/Zephyr-latest/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/src/mesh/ |
D | transition.c | 160 k_timer_stop(&ctl->transition->timer); in onoff_work_handler() 175 k_timer_stop(&ctl->transition->timer); in onoff_work_handler() 206 k_timer_stop(&ctl->transition->timer); in level_move_lightness_work_handler() 217 k_timer_stop(&ctl->transition->timer); in level_lightness_work_handler() 237 k_timer_stop(&ctl->transition->timer); in level_lightness_work_handler() 268 k_timer_stop(&ctl->transition->timer); in level_move_temp_work_handler() 279 k_timer_stop(&ctl->transition->timer); in level_temp_work_handler() 299 k_timer_stop(&ctl->transition->timer); in level_temp_work_handler() 310 k_timer_stop(&ctl->transition->timer); in light_lightness_actual_work_handler() 325 k_timer_stop(&ctl->transition->timer); in light_lightness_actual_work_handler() [all …]
|