Lines Matching full:pair
27 #define PAIR_1ST_CH(pair) (pair * 2U) argument
28 #define PAIR_2ND_CH(pair) (PAIR_1ST_CH(pair) + 1) argument
72 uint32_t pair = channel / 2U; in mcux_ftm_set_cycles() local
93 if (irqs & BIT(PAIR_2ND_CH(pair))) { in mcux_ftm_set_cycles()
94 LOG_ERR("Cannot set PWM, capture in progress on pair %d", pair); in mcux_ftm_set_cycles()
155 uint32_t pair = channel / 2U; in mcux_ftm_configure_capture() local
162 if (pair >= ARRAY_SIZE(data->capture)) { in mcux_ftm_configure_capture()
163 LOG_ERR("Invalid channel pair %d", pair); in mcux_ftm_configure_capture()
167 if (FTM_GetEnabledInterrupts(config->base) & BIT(PAIR_2ND_CH(pair))) { in mcux_ftm_configure_capture()
168 LOG_ERR("Capture already active on channel pair %d", pair); in mcux_ftm_configure_capture()
182 data->capture[pair].callback = cb; in mcux_ftm_configure_capture()
183 data->capture[pair].user_data = user_data; in mcux_ftm_configure_capture()
184 param = &data->capture[pair].param; in mcux_ftm_configure_capture()
193 data->capture[pair].pulse_capture = false; in mcux_ftm_configure_capture()
203 data->capture[pair].pulse_capture = true; in mcux_ftm_configure_capture()
221 uint32_t pair = channel / 2U; in mcux_ftm_enable_capture() local
228 if (pair >= ARRAY_SIZE(data->capture)) { in mcux_ftm_enable_capture()
229 LOG_ERR("Invalid channel pair %d", pair); in mcux_ftm_enable_capture()
233 if (!data->capture[pair].callback) { in mcux_ftm_enable_capture()
238 if (FTM_GetEnabledInterrupts(config->base) & BIT(PAIR_2ND_CH(pair))) { in mcux_ftm_enable_capture()
239 LOG_ERR("Capture already active on channel pair %d", pair); in mcux_ftm_enable_capture()
243 FTM_ClearStatusFlags(config->base, BIT(PAIR_1ST_CH(pair)) | in mcux_ftm_enable_capture()
244 BIT(PAIR_2ND_CH(pair))); in mcux_ftm_enable_capture()
246 FTM_SetupDualEdgeCapture(config->base, pair, &data->capture[pair].param, in mcux_ftm_enable_capture()
249 FTM_EnableInterrupts(config->base, BIT(PAIR_1ST_CH(pair)) | in mcux_ftm_enable_capture()
250 BIT(PAIR_2ND_CH(pair))); in mcux_ftm_enable_capture()
259 uint32_t pair = channel / 2U; in mcux_ftm_disable_capture() local
266 if (pair >= ARRAY_SIZE(data->capture)) { in mcux_ftm_disable_capture()
267 LOG_ERR("Invalid channel pair %d", pair); in mcux_ftm_disable_capture()
271 FTM_DisableInterrupts(config->base, BIT(PAIR_1ST_CH(pair)) | in mcux_ftm_disable_capture()
272 BIT(PAIR_2ND_CH(pair))); in mcux_ftm_disable_capture()
276 (FTM_COMBINE_COMBINE1_SHIFT * pair))); in mcux_ftm_disable_capture()
287 uint32_t pair = channel / 2U; in mcux_ftm_capture_first_edge() local
289 __ASSERT_NO_MSG(pair < ARRAY_SIZE(data->capture)); in mcux_ftm_capture_first_edge()
290 capture = &data->capture[pair]; in mcux_ftm_capture_first_edge()
292 FTM_DisableInterrupts(config->base, BIT(PAIR_1ST_CH(pair))); in mcux_ftm_capture_first_edge()
298 LOG_DBG("pair = %d, 1st cnt = %u, 1st ovf = %d", pair, cnt, overflow); in mcux_ftm_capture_first_edge()
309 uint32_t pair = channel / 2U; in mcux_ftm_capture_second_edge() local
316 __ASSERT_NO_MSG(pair < ARRAY_SIZE(data->capture)); in mcux_ftm_capture_second_edge()
317 capture = &data->capture[pair]; in mcux_ftm_capture_second_edge()
319 first_cnv = config->base->CONTROLS[PAIR_1ST_CH(pair)].CnV; in mcux_ftm_capture_second_edge()
320 second_cnv = config->base->CONTROLS[PAIR_2ND_CH(pair)].CnV; in mcux_ftm_capture_second_edge()
324 FTM_ClearStatusFlags(config->base, BIT(PAIR_1ST_CH(pair)) | BIT(PAIR_2ND_CH(pair))); in mcux_ftm_capture_second_edge()
327 FTM_ClearStatusFlags(config->base, BIT(PAIR_2ND_CH(pair))); in mcux_ftm_capture_second_edge()
359 LOG_DBG("pair = %d, 1st ovfs = %u, 2nd ovfs = %u, ovfs = %u, 1st cnv = %u, " in mcux_ftm_capture_second_edge()
361 pair, capture->first_edge_overflows, second_edge_overflows, overflows, first_cnv, in mcux_ftm_capture_second_edge()
365 capture->callback(dev, pair, 0, cycles, status, in mcux_ftm_capture_second_edge()
368 capture->callback(dev, pair, cycles, 0, status, in mcux_ftm_capture_second_edge()
374 FTM_DisableInterrupts(config->base, BIT(PAIR_2ND_CH(pair))); in mcux_ftm_capture_second_edge()
377 FTM_EnableInterrupts(config->base, BIT(PAIR_1ST_CH(pair))); in mcux_ftm_capture_second_edge()