nrf/pwm: disconnect input.

This commit is contained in:
Dario Nieuwenhuis 2024-11-04 18:41:58 +01:00
parent fff304b3de
commit f51ee98aef

View File

@ -132,6 +132,7 @@ impl<'d, T: Instance> SequencePwm<'d, T> {
pin.set_low(); pin.set_low();
pin.conf().write(|w| { pin.conf().write(|w| {
w.set_dir(gpiovals::Dir::OUTPUT); w.set_dir(gpiovals::Dir::OUTPUT);
w.set_input(gpiovals::Input::DISCONNECT);
w.set_drive(convert_drive(config.ch0_drive)); w.set_drive(convert_drive(config.ch0_drive));
}); });
} }
@ -139,6 +140,7 @@ impl<'d, T: Instance> SequencePwm<'d, T> {
pin.set_low(); pin.set_low();
pin.conf().write(|w| { pin.conf().write(|w| {
w.set_dir(gpiovals::Dir::OUTPUT); w.set_dir(gpiovals::Dir::OUTPUT);
w.set_input(gpiovals::Input::DISCONNECT);
w.set_drive(convert_drive(config.ch1_drive)); w.set_drive(convert_drive(config.ch1_drive));
}); });
} }
@ -146,6 +148,7 @@ impl<'d, T: Instance> SequencePwm<'d, T> {
pin.set_low(); pin.set_low();
pin.conf().write(|w| { pin.conf().write(|w| {
w.set_dir(gpiovals::Dir::OUTPUT); w.set_dir(gpiovals::Dir::OUTPUT);
w.set_input(gpiovals::Input::DISCONNECT);
w.set_drive(convert_drive(config.ch2_drive)); w.set_drive(convert_drive(config.ch2_drive));
}); });
} }
@ -153,6 +156,7 @@ impl<'d, T: Instance> SequencePwm<'d, T> {
pin.set_low(); pin.set_low();
pin.conf().write(|w| { pin.conf().write(|w| {
w.set_dir(gpiovals::Dir::OUTPUT); w.set_dir(gpiovals::Dir::OUTPUT);
w.set_input(gpiovals::Input::DISCONNECT);
w.set_drive(convert_drive(config.ch3_drive)); w.set_drive(convert_drive(config.ch3_drive));
}); });
} }
@ -679,7 +683,12 @@ impl<'d, T: Instance> SimplePwm<'d, T> {
for (i, ch) in [&ch0, &ch1, &ch2, &ch3].into_iter().enumerate() { for (i, ch) in [&ch0, &ch1, &ch2, &ch3].into_iter().enumerate() {
if let Some(pin) = ch { if let Some(pin) = ch {
pin.set_low(); pin.set_low();
pin.conf().write(|w| w.set_dir(gpiovals::Dir::OUTPUT));
pin.conf().write(|w| {
w.set_dir(gpiovals::Dir::OUTPUT);
w.set_input(gpiovals::Input::DISCONNECT);
w.set_drive(gpiovals::Drive::S0S1);
});
} }
r.psel().out(i).write_value(ch.psel_bits()); r.psel().out(i).write_value(ch.psel_bits());
} }