Lines Matching refs:capture
61 struct pwm_numaker_capture_data capture[NUMAKER_PWM_CHANNEL_COUNT]; member
146 data->capture[pair].callback = cb; in pwm_numaker_configure_capture()
147 data->capture[pair].user_data = user_data; in pwm_numaker_configure_capture()
149 if (data->capture[pair].is_busy) { in pwm_numaker_configure_capture()
159 data->capture[pair].single_mode = false; in pwm_numaker_configure_capture()
161 data->capture[pair].single_mode = true; in pwm_numaker_configure_capture()
165 data->capture[pair].pulse_capture = false; in pwm_numaker_configure_capture()
168 data->capture[pair].curr_edge_mode = EPWM_CAPTURE_INT_FALLING_LATCH; in pwm_numaker_configure_capture()
169 data->capture[pair].next_edge_mode = EPWM_CAPTURE_INT_FALLING_LATCH; in pwm_numaker_configure_capture()
171 data->capture[pair].curr_edge_mode = EPWM_CAPTURE_INT_RISING_LATCH; in pwm_numaker_configure_capture()
172 data->capture[pair].next_edge_mode = EPWM_CAPTURE_INT_RISING_LATCH; in pwm_numaker_configure_capture()
175 data->capture[pair].pulse_capture = true; in pwm_numaker_configure_capture()
178 data->capture[pair].curr_edge_mode = EPWM_CAPTURE_INT_FALLING_LATCH; in pwm_numaker_configure_capture()
179 data->capture[pair].next_edge_mode = EPWM_CAPTURE_INT_RISING_LATCH; in pwm_numaker_configure_capture()
181 data->capture[pair].curr_edge_mode = EPWM_CAPTURE_INT_RISING_LATCH; in pwm_numaker_configure_capture()
182 data->capture[pair].next_edge_mode = EPWM_CAPTURE_INT_FALLING_LATCH; in pwm_numaker_configure_capture()
200 if (!data->capture[pair].callback) { in pwm_numaker_enable_capture()
205 if (data->capture[pair].is_busy) { in pwm_numaker_enable_capture()
210 data->capture[pair].is_busy = true; in pwm_numaker_enable_capture()
225 EPWM_EnableCaptureInt(epwm, channel, data->capture[pair].curr_edge_mode); in pwm_numaker_enable_capture()
242 data->capture[channel].is_busy = false; in pwm_numaker_disable_capture()
317 struct pwm_numaker_capture_data *capture; in pwm_numaker_channel_cap() local
324 capture = &data->capture[channel]; in pwm_numaker_channel_cap()
328 epwm, channel, data->capture[channel].curr_edge_mode, in pwm_numaker_channel_cap()
329 data->capture[channel].next_edge_mode, &cycles); in pwm_numaker_channel_cap()
330 if (capture->pulse_capture) { in pwm_numaker_channel_cap()
332 capture->callback(dev, channel, 0, cycles, status, capture->user_data); in pwm_numaker_channel_cap()
335 capture->callback(dev, channel, cycles, 0, status, capture->user_data); in pwm_numaker_channel_cap()
338 if (capture->single_mode) { in pwm_numaker_channel_cap()
341 data->capture[channel].is_busy = false; in pwm_numaker_channel_cap()
345 EPWM_EnableCaptureInt(epwm, channel, data->capture[channel].curr_edge_mode); in pwm_numaker_channel_cap()
355 struct pwm_numaker_capture_data *capture; in pwm_numaker_isr() local
386 capture = &data->capture[i]; in pwm_numaker_isr()
387 if (capture == NULL) { in pwm_numaker_isr()