From bda9715f51fa6d696deaadf86cc829d7933fa44f Mon Sep 17 00:00:00 2001 From: Pedro Ferreira Date: Mon, 23 Sep 2024 23:15:07 +0200 Subject: [PATCH] RP235x: Set IE and OD when setting a PIO pin --- embassy-rp/src/pio/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/embassy-rp/src/pio/mod.rs b/embassy-rp/src/pio/mod.rs index 591889438c..cdac87a215 100644 --- a/embassy-rp/src/pio/mod.rs +++ b/embassy-rp/src/pio/mod.rs @@ -1090,6 +1090,12 @@ impl<'d, PIO: Instance> Common<'d, PIO> { /// of [`Pio`] do not keep pin registrations alive.** pub fn make_pio_pin(&mut self, pin: impl Peripheral

+ 'd) -> Pin<'d, PIO> { into_ref!(pin); + + // enable the outputs + pin.pad_ctrl().write(|w| w.set_od(false)); + // especially important on the 235x, where IE defaults to 0 + pin.pad_ctrl().write(|w| w.set_ie(true)); + pin.gpio().ctrl().write(|w| w.set_funcsel(PIO::FUNCSEL as _)); #[cfg(feature = "_rp235x")] pin.pad_ctrl().modify(|w| {