Skip to content

Commit 6c532a1

Browse files
[nrf fromlist] drivers: pwm: nrfx: Add idle output to PWM driver.
Fast PWM120 prevents GPIO from driving pin with low/high state when PWM duty is 0% or 100%. Idleout feature needs to be used. It can be configured when PWM is disabled and works while it is enabled. Upstream PR #: 83652 Signed-off-by: Michał Stasiak <[email protected]>
1 parent 1d687c4 commit 6c532a1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/pwm/pwm_nrfx.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,13 @@ static int pwm_nrfx_set_cycles(const struct device *dev, uint32_t channel,
233233
out_level ^= 1;
234234
}
235235

236+
#if NRF_PWM_HAS_IDLEOUT
237+
nrfx_pwm_stop(&config->pwm, true);
238+
nrfy_pwm_channel_idle_set(config->pwm.p_reg, channel, out_level);
239+
nrfy_pwm_enable(config->pwm.p_reg);
240+
#else
236241
nrf_gpio_pin_write(psel, out_level);
242+
#endif
237243
}
238244

239245
data->pwm_needed &= ~BIT(channel);

0 commit comments

Comments
 (0)