Home
last modified time | relevance | path

Searched refs:timer (Results 1 – 25 of 737) sorted by relevance

12345678910>>...30

/Zephyr-latest/kernel/
Dtimer.c29 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/
Dtimer.c14 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()
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()
63 timer->status = NOT_ACTIVE; in osTimerNew()
[all …]
/Zephyr-latest/lib/posix/options/
Dtimer.c39 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/
Dcmsis_timer.c14 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/
Dsilabs_sleeptimer_timer.c50 struct sleeptimer_timer_data *timer = data; in sleeptimer_cb() local
53 uint32_t prev = atomic_get(&timer->last_count); in sleeptimer_cb()
57 uint32_t unannounced = pending / timer->cyc_per_tick; in sleeptimer_cb()
59 atomic_set(&timer->last_count, prev + unannounced * timer->cyc_per_tick); in sleeptimer_cb()
64 static void sleeptimer_clock_set_timeout(int32_t ticks, struct sleeptimer_timer_data *timer) in sleeptimer_clock_set_timeout() argument
70 ticks = (ticks == K_TICKS_FOREVER) ? timer->max_timeout_ticks : ticks; in sleeptimer_clock_set_timeout()
71 ticks = CLAMP(ticks, 0, timer->max_timeout_ticks); in sleeptimer_clock_set_timeout()
73 k_spinlock_key_t key = k_spin_lock(&timer->lock); in sleeptimer_clock_set_timeout()
76 uint32_t prev = atomic_get(&timer->last_count); in sleeptimer_clock_set_timeout()
78 uint32_t next = ticks * timer->cyc_per_tick; in sleeptimer_clock_set_timeout()
[all …]
DKconfig27 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.wch_ch32v00x"
74 source "drivers/timer/Kconfig.cortex_m_systick"
[all …]
DKconfig.xtensa7 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.
/Zephyr-latest/modules/nrf_wifi/os/
Dtimer.c23 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()
/Zephyr-latest/drivers/pwm/
Dpwm_stm32.c90 TIM_TypeDef *timer; member
331 if (!IS_TIM_32B_COUNTER_INSTANCE(cfg->timer) && in pwm_stm32_set_cycles()
338 if (LL_TIM_IsEnabledIT_CC1(cfg->timer) || LL_TIM_IsEnabledIT_CC2(cfg->timer) || in pwm_stm32_set_cycles()
339 LL_TIM_IsEnabledIT_CC3(cfg->timer) || LL_TIM_IsEnabledIT_CC4(cfg->timer)) { in pwm_stm32_set_cycles()
368 LL_TIM_CC_DisableChannel(cfg->timer, current_ll_channel); in pwm_stm32_set_cycles()
387 if (!LL_TIM_CC_IsEnabledChannel(cfg->timer, current_ll_channel)) { in pwm_stm32_set_cycles()
401 oc_init.OCState = LL_TIM_CC_IsEnabledChannel(cfg->timer, ll_channel) in pwm_stm32_set_cycles()
404 oc_init.OCPolarity = LL_TIM_OC_GetPolarity(cfg->timer, ll_channel); in pwm_stm32_set_cycles()
412 LL_TIM_CC_IsEnabledChannel(cfg->timer, negative_ll_channel) in pwm_stm32_set_cycles()
416 LL_TIM_OC_GetPolarity(cfg->timer, negative_ll_channel); in pwm_stm32_set_cycles()
[all …]
Dpwm_gecko.c16 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 …]
Dpwm_nrf_sw.c63 NRF_TIMER_Type *timer; member
91 return config->timer; in pwm_config_timer()
125 NRF_TIMER_Type *timer = pwm_config_timer(config); in pwm_nrf_sw_set_cycles() local
208 nrf_timer_task_trigger(timer, NRF_TIMER_TASK_STOP); in pwm_nrf_sw_set_cycles()
230 nrf_timer_event_clear(timer, in pwm_nrf_sw_set_cycles()
232 nrf_timer_event_clear(timer, in pwm_nrf_sw_set_cycles()
235 nrf_timer_cc_set(timer, 1 + channel, pulse_cycles); in pwm_nrf_sw_set_cycles()
236 nrf_timer_cc_set(timer, 0, period_cycles); in pwm_nrf_sw_set_cycles()
237 nrf_timer_task_trigger(timer, NRF_TIMER_TASK_CLEAR); in pwm_nrf_sw_set_cycles()
287 nrf_timer_event_address_get(timer, in pwm_nrf_sw_set_cycles()
[all …]
/Zephyr-latest/drivers/counter/
Dcounter_smartbond_timer.c28 #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 …]
Dcounter_ll_stm32_timer.c105 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 …]
Dtimer_tmr_cmsdk_apb.c23 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 …]
Dcounter_nrfx_timer.c50 NRF_TIMER_Type *timer; member
64 nrf_timer_task_trigger(config->timer, NRF_TIMER_TASK_START); in start()
73 nrf_timer_task_trigger(config->timer, NRF_TIMER_TASK_STOP); in stop()
82 return nrf_timer_cc_get(config->timer, TOP_CH); in get_top_value()
88 NRF_TIMER_Type *timer = config->timer; in read() local
90 nrf_timer_task_trigger(timer, in read()
94 return nrf_timer_cc_get(timer, COUNTER_READ_CC); in read()
132 NRFX_IRQ_PENDING_SET(NRFX_IRQ_NUMBER_GET(config->timer)); in set_cc_int_pending()
144 NRF_TIMER_Type *reg = config->timer; in set_cc()
238 nrf_timer_int_disable(config->timer, int_mask); in cancel_alarm()
[all …]
/Zephyr-latest/doc/kernel/services/timing/
Dtimers.rst6 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/
Dmain.cpp115 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/
Dtest_driver.c16 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/
Dgd32e507xe.dtsi12 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/
Dlocaltime_r_utc.c11 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/
Dmain.c33 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/
Dusbc_timer.c17 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/
Dsample_driver_foo.c27 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/
Dmain.c26 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/
Dtransition.c160 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 …]

12345678910>>...30