Lines Matching refs:capture
60 struct mcux_ftm_capture_data capture[MAX_CAPTURE_PAIRS]; member
162 if (pair >= ARRAY_SIZE(data->capture)) { 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()
228 if (pair >= ARRAY_SIZE(data->capture)) { in mcux_ftm_enable_capture()
233 if (!data->capture[pair].callback) { in mcux_ftm_enable_capture()
246 FTM_SetupDualEdgeCapture(config->base, pair, &data->capture[pair].param, in mcux_ftm_enable_capture()
266 if (pair >= ARRAY_SIZE(data->capture)) { in mcux_ftm_disable_capture()
286 struct mcux_ftm_capture_data *capture; 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()
294 capture->first_edge_cnt = cnt; in mcux_ftm_capture_first_edge()
295 capture->first_edge_overflows = data->overflows; in mcux_ftm_capture_first_edge()
296 capture->first_edge_overflow = overflow; in mcux_ftm_capture_first_edge()
308 struct mcux_ftm_capture_data *capture; 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()
322 if (capture->pulse_capture) { in mcux_ftm_capture_second_edge()
330 if (unlikely(capture->first_edge_overflow && first_cnv > capture->first_edge_cnt)) { in mcux_ftm_capture_second_edge()
332 capture->first_edge_overflows--; in mcux_ftm_capture_second_edge()
340 overflows = second_edge_overflows - capture->first_edge_overflows; in mcux_ftm_capture_second_edge()
361 pair, capture->first_edge_overflows, second_edge_overflows, overflows, first_cnv, in mcux_ftm_capture_second_edge()
364 if (capture->pulse_capture) { in mcux_ftm_capture_second_edge()
365 capture->callback(dev, pair, 0, cycles, status, in mcux_ftm_capture_second_edge()
366 capture->user_data); in mcux_ftm_capture_second_edge()
368 capture->callback(dev, pair, cycles, 0, status, in mcux_ftm_capture_second_edge()
369 capture->user_data); in mcux_ftm_capture_second_edge()
372 if (capture->param.mode == kFTM_OneShot) { in mcux_ftm_capture_second_edge()
375 } else if (capture->pulse_capture) { in mcux_ftm_capture_second_edge()
380 capture->first_edge_cnt = cnt; in mcux_ftm_capture_second_edge()
381 capture->first_edge_overflows = second_edge_overflows; in mcux_ftm_capture_second_edge()
382 capture->first_edge_overflow = false; in mcux_ftm_capture_second_edge()