Lines Matching refs:p_instance
111 static void pins_deconfigure(nrfx_pwm_t const * p_instance) in pins_deconfigure() argument
115 uint32_t pin = nrfy_pwm_pin_get(p_instance->p_reg, ch_idx); in pins_deconfigure()
139 static void pwm_configure(nrfx_pwm_t const * p_instance, nrfx_pwm_config_t const * p_config) in pwm_configure() argument
160 nrfy_pwm_periph_configure(p_instance->p_reg, &nrfy_config); in pwm_configure()
163 nrfy_pwm_int_init(p_instance->p_reg, to_clear, p_config->irq_priority, false); in pwm_configure()
168 nrfy_pwm_channel_idle_set(p_instance->p_reg, channel, in pwm_configure()
180 static bool pwm_stopped_check(nrfx_pwm_t const * p_instance) in pwm_stopped_check() argument
182 pwm_control_block_t * p_cb = &m_cb[p_instance->instance_id]; in pwm_stopped_check()
186 if (nrfy_pwm_events_process(p_instance->p_reg, in pwm_stopped_check()
196 nrfx_err_t nrfx_pwm_init(nrfx_pwm_t const * p_instance, in nrfx_pwm_init() argument
203 pwm_control_block_t * p_cb = &m_cb[p_instance->instance_id]; in nrfx_pwm_init()
224 pwm_configure(p_instance, p_config); in nrfx_pwm_init()
234 nrfx_err_t nrfx_pwm_reconfigure(nrfx_pwm_t const * p_instance, nrfx_pwm_config_t const * p_config) in nrfx_pwm_reconfigure() argument
236 pwm_control_block_t * p_cb = &m_cb[p_instance->instance_id]; in nrfx_pwm_reconfigure()
249 pwm_configure(p_instance, p_config); in nrfx_pwm_reconfigure()
254 void nrfx_pwm_uninit(nrfx_pwm_t const * p_instance) in nrfx_pwm_uninit() argument
256 pwm_control_block_t * p_cb = &m_cb[p_instance->instance_id]; in nrfx_pwm_uninit()
260 nrfy_pwm_int_uninit(p_instance->p_reg); in nrfx_pwm_uninit()
265 nrfy_pwm_disable(p_instance->p_reg); in nrfx_pwm_uninit()
269 pins_deconfigure(p_instance); in nrfx_pwm_uninit()
276 bool nrfx_pwm_init_check(nrfx_pwm_t const * p_instance) in nrfx_pwm_init_check() argument
278 pwm_control_block_t * p_cb = &m_cb[p_instance->instance_id]; in nrfx_pwm_init_check()
283 static uint32_t start_playback(nrfx_pwm_t const * p_instance, in start_playback() argument
291 nrfy_pwm_enable(p_instance->p_reg); in start_playback()
324 nrfy_pwm_int_set(p_instance->p_reg, int_mask); in start_playback()
329 nrfy_pwm_int_set(p_instance->p_reg, in start_playback()
336 nrfy_pwm_task_address_get(p_instance->p_reg, nrfy_pwm_seqstart_task_get(seq_id)); in start_playback()
343 nrf_egu_int_enable(DMA_ISSUE_EGU, nrf_egu_channel_int_get(p_instance->instance_id)); in start_playback()
345 nrf_egu_trigger_task_get(p_instance->instance_id)); in start_playback()
351 nrfy_pwm_start(p_instance->p_reg, seq_id, false); in start_playback()
355 uint32_t nrfx_pwm_simple_playback(nrfx_pwm_t const * p_instance, in nrfx_pwm_simple_playback() argument
360 pwm_control_block_t * p_cb = &m_cb[p_instance->instance_id]; in nrfx_pwm_simple_playback()
368 nrfy_pwm_sequence_set(p_instance->p_reg, 0, p_sequence); in nrfx_pwm_simple_playback()
369 nrfy_pwm_sequence_set(p_instance->p_reg, 1, p_sequence); in nrfx_pwm_simple_playback()
371 nrfy_pwm_loop_set(p_instance->p_reg, in nrfx_pwm_simple_playback()
388 nrfy_pwm_shorts_set(p_instance->p_reg, shorts_mask); in nrfx_pwm_simple_playback()
396 return start_playback(p_instance, p_cb, flags, odd ? 1 : 0); in nrfx_pwm_simple_playback()
399 uint32_t nrfx_pwm_complex_playback(nrfx_pwm_t const * p_instance, in nrfx_pwm_complex_playback() argument
405 pwm_control_block_t * p_cb = &m_cb[p_instance->instance_id]; in nrfx_pwm_complex_playback()
412 nrfy_pwm_sequence_set(p_instance->p_reg, 0, p_sequence_0); in nrfx_pwm_complex_playback()
413 nrfy_pwm_sequence_set(p_instance->p_reg, 1, p_sequence_1); in nrfx_pwm_complex_playback()
414 nrfy_pwm_loop_set(p_instance->p_reg, playback_count); in nrfx_pwm_complex_playback()
429 nrfy_pwm_shorts_set(p_instance->p_reg, shorts_mask); in nrfx_pwm_complex_playback()
443 return start_playback(p_instance, p_cb, flags, 0); in nrfx_pwm_complex_playback()
446 bool nrfx_pwm_stop(nrfx_pwm_t const * p_instance, bool wait_until_stopped) in nrfx_pwm_stop() argument
448 pwm_control_block_t * p_cb = &m_cb[p_instance->instance_id]; in nrfx_pwm_stop()
457 nrfy_pwm_shorts_set(p_instance->p_reg, 0); in nrfx_pwm_stop()
462 nrfy_pwm_abort(p_instance->p_reg, false); in nrfx_pwm_stop()
466 while (!pwm_stopped_check(p_instance)) in nrfx_pwm_stop()
468 nrfy_pwm_disable(p_instance->p_reg); in nrfx_pwm_stop()
472 ret_val = pwm_stopped_check(p_instance); in nrfx_pwm_stop()
478 bool nrfx_pwm_stopped_check(nrfx_pwm_t const * p_instance) in nrfx_pwm_stopped_check() argument
480 NRFX_ASSERT(m_cb[p_instance->instance_id].state != NRFX_DRV_STATE_UNINITIALIZED); in nrfx_pwm_stopped_check()
482 bool ret_val = pwm_stopped_check(p_instance); in nrfx_pwm_stopped_check()