| /Zephyr-4.3.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 67 source "drivers/timer/Kconfig.ambiq" 68 source "drivers/timer/Kconfig.arcv2" 69 source "drivers/timer/Kconfig.arm_arch" 70 source "drivers/timer/Kconfig.cavs" [all …]
|
| D | silabs_sleeptimer_timer.c | 15 #include <zephyr/drivers/timer/system_timer.h> 22 /* Maximum time interval between timer interrupts (in hw_cycles) */ 35 /* Global timer state */ 41 bool initialized; /* Set to true when timer is initialized */ 42 sl_sleeptimer_timer_handle_t handle; /* Timer handle for system timer */ 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 [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 55 bool "Local APIC timer using TSC time source" 65 timer frequency. [all …]
|
| 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" 49 # If all dependencies are enabled, and /chosen/cortex-m-idle-timer 50 # is enabled, default to using the Counter API-based LPM timer. 52 # automatically, and no LPM timer will be enabled. 55 It is common for SoCs equipped with SysTick to use it as system timer. 59 On such SoCs, a vendor-specific timer that remains active in low-power [all …]
|
| D | ite_it51xxx_timer.c | 9 #include <zephyr/drivers/timer/system_timer.h> 15 LOG_MODULE_REGISTER(timer, LOG_LEVEL_ERR); 18 "Hardware timer frequency is fixed at 32768Hz"); 20 /* it51xxx timer registers definition */ 21 static mm_reg_t timer_base = DT_REG_ADDR(DT_NODELABEL(timer)); 23 /* 0x10, 0x18, 0x20, 0x28, 0x30, 0x38: External Timer 3-8 Control Register (n=0 to 5) */ 28 /* 0x11, 0x19, 0x21, 0x29, 0x31, 0x39: External Timer 3-8 Prescaler Register (n=0 to 5) */ 30 /* 0x14, 0x1c, 0x24, 0x2c, 0x34, 0x3c: External Timer 3-8 Counter Register (n=0 to 5) */ 32 /* 0x48, 0x4c, 0x50, 0x54, 0x58, 0x5c: External Timer 3-8 Counter Observation Register (n=0 to 5) */ 36 * 24-bit timers: external timer 3, 5, and 7 [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 …]
|
| /Zephyr-4.3.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 cmsis_rtos_timer_cb, z_timer); in zephyr_timer_wrapper() 35 * @brief Create a Timer 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() [all …]
|
| /Zephyr-4.3.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-4.3.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-4.3.0/lib/posix/options/ |
| D | timer.c | 43 struct timer_obj *timer; in zephyr_timer_wrapper() local 45 timer = (struct timer_obj *)ztimer; in zephyr_timer_wrapper() 47 if (timer->reload == 0U) { in zephyr_timer_wrapper() 48 timer->status = NOT_ACTIVE; in zephyr_timer_wrapper() 49 LOG_DBG("timer %p not active", timer); in zephyr_timer_wrapper() 52 if (timer->evp.sigev_notify == SIGEV_NONE) { in zephyr_timer_wrapper() 57 if (timer->evp.sigev_notify_function == NULL) { in zephyr_timer_wrapper() 62 LOG_DBG("calling sigev_notify_function %p", timer->evp.sigev_notify_function); in zephyr_timer_wrapper() 63 (timer->evp.sigev_notify_function)(timer->evp.sigev_value); in zephyr_timer_wrapper() 69 struct timer_obj *timer = (struct timer_obj *)arg; in zephyr_thread_wrapper() local [all …]
|
| /Zephyr-4.3.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-4.3.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-4.3.0/samples/drivers/counter/alarm/src/ |
| D | main.c | 20 #define TIMER DT_NODELABEL(tc4) macro 22 #define TIMER DT_NODELABEL(tc0) macro 24 #define TIMER DT_NODELABEL(extrtc0) macro 26 #define TIMER DT_NODELABEL(rtc0) macro 28 #define TIMER DT_CHOSEN(counter) macro 30 #define TIMER DT_INST(0, st_stm32_counter) macro 32 #define TIMER DT_INST(0, st_stm32_rtc) macro 34 #define TIMER DT_NODELABEL(timer3) macro 36 #define TIMER DT_NODELABEL(counter0) macro 38 #define TIMER DT_INST(0, xlnx_xps_timer_1_00_a) macro [all …]
|
| /Zephyr-4.3.0/modules/nrf_wifi/os/ |
| D | timer.c | 8 * @brief File containing timer specific definitons for the 19 #include "timer.h" 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 [all …]
|
| /Zephyr-4.3.0/drivers/pwm/ |
| D | pwm_stm32.c | 79 /** Timer clock (Hz). */ 90 TIM_TypeDef *timer; member 103 /** Maximum number of timer channels : some stm32 soc have 6 else only 4 */ 136 /** Maximum number of complemented timer channels is ARRAY_SIZE(ch2ll_n)*/ 222 TIM_TypeDef *timer = cfg->timer; in pwm_stm32_set_cycles() local 237 if (!IS_TIM_32B_COUNTER_INSTANCE(timer) && in pwm_stm32_set_cycles() 239 LOG_ERR("Cannot set PWM output, value exceeds 16-bit timer limit."); in pwm_stm32_set_cycles() 244 if (LL_TIM_IsEnabledIT_CC1(timer) || LL_TIM_IsEnabledIT_CC2(timer) || in pwm_stm32_set_cycles() 245 LL_TIM_IsEnabledIT_CC3(timer) || LL_TIM_IsEnabledIT_CC4(timer)) { in pwm_stm32_set_cycles() 274 LL_TIM_CC_DisableChannel(timer, current_ll_channel); in pwm_stm32_set_cycles() [all …]
|
| /Zephyr-4.3.0/tests/subsys/portability/cmsis_rtos_v2/src/ |
| D | timer.c | 25 TC_PRINT("oneshot_callback (Timer %d) = %d\n", Tmr, num_oneshots_executed); in Timer1_Callback() 33 TC_PRINT("periodic_callback (Timer %d) = %d\n", Tmr, num_periods_executed); in Timer2_Callback() 46 /* Create one-shot timer */ in ZTEST() 49 zassert_true(id1 != NULL, "error creating one-shot timer"); in ZTEST() 52 zassert_str_equal(timer_attr.name, name, "Error getting Timer name"); in ZTEST() 54 /* Stop the timer before start */ in ZTEST() 56 zassert_true(status == osErrorResource, "error while stopping non-active timer"); in ZTEST() 60 zassert_true(status == osOK, "error starting one-shot timer"); in ZTEST() 62 zassert_equal(osTimerIsRunning(id1), 1, "Error: Timer not running"); in ZTEST() 64 /* Timer should fire only once if setup in one shot in ZTEST() [all …]
|
| /Zephyr-4.3.0/drivers/counter/ |
| D | counter_stm32_timer.c | 26 /** Maximum number of timer channels. */ 29 /** Number of channels for timer by index. */ 105 TIM_TypeDef *timer; member 120 TIM_TypeDef *timer = config->timer; in counter_stm32_start() local 123 LL_TIM_EnableCounter(timer); in counter_stm32_start() 131 TIM_TypeDef *timer = config->timer; in counter_stm32_stop() local 134 LL_TIM_DisableCounter(timer); in counter_stm32_stop() 143 return LL_TIM_GetAutoReload(config->timer); in counter_stm32_get_top_value() 150 return LL_TIM_GetCounter(config->timer); in counter_stm32_read() 163 LL_TIM_SetCounter(config->timer, 0); in counter_stm32_reset() [all …]
|
| D | counter_smartbond_timer.c | 28 #define COUNTER_DT_DEVICE(_idx) DEVICE_DT_GET_OR_NULL(DT_NODELABEL(timer##_idx)) 50 /* Register set for timer */ 51 TIMER2_Type *timer; member 53 /* Timer driven by DIVn if 1 or lp_clk if 0 */ 83 * a timer block will automatically be switched from DIVN to LP and vice versa. 98 switch ((uint32_t)config->timer) { in counter_smartbond_pdc_trigger_get() 99 case (uint32_t)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 [all …]
|
| D | counter_ite_it51xxx.c | 15 /* 0x30 (offset 0x00): External Timer 7 Control Register (used as alarm counter) */ 21 /* 0x31 (offset 0x01): External Timer 7 Prescaler Register */ 24 /* 0x34 (offset 0x04): External Timer 7 Counter Register */ 26 /* 0x38 (offset 0x08): External Timer 8 Control Register (used as top counter) */ 28 /* 0x39 (offset 0x09): External Timer 8 Prescaler Register */ 30 /* 0x3C (offset 0x0C): External Timer 8 Counter Register */ 32 /* 0x58 (offset 0x28): External Timer 7 Counter Observation Register */ 34 /* 0x5C (offset 0x2C): External Timer 8 Counter Observation Register */ 40 /* Alarm timer irq number */ 42 /* Alarm timer irq trigger mode */ [all …]
|
| /Zephyr-4.3.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-4.3.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-4.3.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-4.3.0/tests/kernel/timer/cycle64/ |
| D | testcase.yaml | 4 # complete these tests almost instantaneously because of qemu timer 10 # As other platforms are added with varying timer frequencies, increase 13 kernel.timer.cycle64: 16 - timer 21 kernel.timer.cycle64.fast: 24 - timer 27 kernel.timer.cycle64.grtc: 30 - timer
|
| /Zephyr-4.3.0/tests/kernel/timer/timer_monotonic/ |
| D | testcase.yaml | 2 kernel.timer.monotonic: 5 - timer 6 kernel.timer.monotonic.apic.tsc: 9 - timer 15 kernel.timer.monotonic.icount_off: 19 - timer
|