Lines Matching full:timer
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
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
213 volatile uint32_t *timer_clear_irq_reg = ((TIMER_Type *)timer) == TIMER ? in counter_smartbond_set_alarm()
214 &((TIMER_Type *)timer)->TIMER_CLEAR_IRQ_REG : in counter_smartbond_set_alarm()
215 &timer->TIMER2_CLEAR_IRQ_REG; in counter_smartbond_set_alarm()
247 * immediate expiration of the timer. Detection is performed in counter_smartbond_set_alarm()
257 timer->TIMER2_RELOAD_REG = val; in counter_smartbond_set_alarm()
281 * on TIMER just make sure interrupt is pending. in counter_smartbond_set_alarm()
285 timer->TIMER2_CTRL_REG |= TIMER2_TIMER2_CTRL_REG_TIM_IRQ_EN_Msk; in counter_smartbond_set_alarm()
295 TIMER2_Type *timer = config->timer; in counter_smartbond_cancel_alarm() local
300 timer->TIMER2_CTRL_REG &= ~TIMER2_TIMER2_CTRL_REG_TIM_IRQ_EN_Msk; in counter_smartbond_cancel_alarm()
322 /* There is no register to check TIMER peripheral to check for interrupt in counter_smartbond_get_pending_int()
332 TIMER2_Type *timer = cfg->timer; in counter_smartbond_init_timer() local
333 TIMER_Type *timer0 = ((TIMER_Type *)cfg->timer) == TIMER ? TIMER : NULL; in counter_smartbond_init_timer()
339 /* Timer clock source is DIVn 32MHz */ in counter_smartbond_init_timer()
340 timer->TIMER2_CTRL_REG = TIMER2_TIMER2_CTRL_REG_TIM_SYS_CLK_EN_Msk; in counter_smartbond_init_timer()
345 timer->TIMER2_CTRL_REG = 0; in counter_smartbond_init_timer()
362 timer->TIMER2_PRESCALER_REG = cfg->prescaler; in counter_smartbond_init_timer()
363 timer->TIMER2_RELOAD_REG = counter_get_max_top_value(dev); in counter_smartbond_init_timer()
364 timer->TIMER2_GPIO1_CONF_REG = 0; in counter_smartbond_init_timer()
365 timer->TIMER2_GPIO2_CONF_REG = 0; in counter_smartbond_init_timer()
366 timer->TIMER2_SHOTWIDTH_REG = 0; in counter_smartbond_init_timer()
367 timer->TIMER2_CAPTURE_GPIO1_REG = 0; in counter_smartbond_init_timer()
368 timer->TIMER2_CAPTURE_GPIO2_REG = 0; in counter_smartbond_init_timer()
369 timer->TIMER2_PWM_FREQ_REG = 0; in counter_smartbond_init_timer()
370 timer->TIMER2_PWM_DC_REG = 0; in counter_smartbond_init_timer()
421 TIMER2_Type *timer = cfg->timer; in counter_smartbond_resume() local
429 timer->TIMER2_CTRL_REG = TIMER2_TIMER2_CTRL_REG_TIM_SYS_CLK_EN_Msk; in counter_smartbond_resume()
431 timer->TIMER2_CTRL_REG = 0; in counter_smartbond_resume()
433 timer->TIMER2_PRESCALER_REG = cfg->prescaler; in counter_smartbond_resume()
434 timer->TIMER2_RELOAD_REG = counter_get_max_top_value(dev); in counter_smartbond_resume()
475 TIMER2_Type *timer = cfg->timer; in counter_smartbond_irq_handler() local
477 __IOM uint32_t *timer_clear_irq_reg = ((TIMER_Type *)timer) == TIMER ? in counter_smartbond_irq_handler()
478 &((TIMER_Type *)timer)->TIMER_CLEAR_IRQ_REG : in counter_smartbond_irq_handler()
479 &timer->TIMER2_CLEAR_IRQ_REG; in counter_smartbond_irq_handler()
481 timer->TIMER2_CTRL_REG &= ~TIMER2_TIMER2_CTRL_REG_TIM_IRQ_EN_Msk; in counter_smartbond_irq_handler()
486 alarm_callback(dev, 0, timer->TIMER2_TIMER_VAL_REG, in counter_smartbond_irq_handler()
499 "TIMER prescaler out of range (1..32)"); \
519 .timer = TIM(idx), \