Lines Matching refs:chan
165 static void stm32_timer_capture_setup_chan(stm32_timer_capture_t *tc, int chan) { in stm32_timer_capture_setup_chan() argument
167 volatile uint32_t *ccmr = chan & 0x2 ? ®s->CCMR2 : ®s->CCMR1; in stm32_timer_capture_setup_chan()
168 int shift = 8 * (chan & 1); in stm32_timer_capture_setup_chan()
176 uint32_t flags = tc->chan[chan].flags; in stm32_timer_capture_setup_chan()
184 shift = 4 * (chan & 3); in stm32_timer_capture_setup_chan()
191 static uint32_t stm32_timer_get_ccr(stm32_timer_capture_t *tc, int chan) { in stm32_timer_get_ccr() argument
192 assert(0 <= chan && chan <= 3); in stm32_timer_get_ccr()
193 switch (chan) { in stm32_timer_get_ccr()
236 static bool stm32_timer_capture_chan_irq(stm32_timer_capture_t *tc, uint32_t sr, int chan) { in stm32_timer_capture_chan_irq() argument
237 if (tc->chan[chan].cb == NULL) { in stm32_timer_capture_chan_irq()
240 if (sr & (TIM_SR_CC1IF << chan)) { in stm32_timer_capture_chan_irq()
241 uint32_t val = stm32_timer_get_ccr(tc, chan); in stm32_timer_capture_chan_irq()
242 return tc->chan[chan].cb(stm32_timer_calc_value(tc, sr, val)); in stm32_timer_capture_chan_irq()
342 if (tc->chan[i].flags & STM32_TIMER_CAPTURE_CHAN_FLAG_ENABLE) { in stm32_timer_capture_setup()