diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-10-31 21:26:40 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2024-10-31 21:26:40 +0100 |
| commit | 3225848bd2e1ffd7fdc7df08d8262f5e6164409f (patch) | |
| tree | a8593b483964de1cf3695cc42892f1472b6c81c2 /embassy-rp/src/pio/mod.rs | |
| parent | 93dd21042ceadea114b01c40a250d33402672569 (diff) | |
rp/pio: ensure PADS IE=1 which is not the default in rp235x.
Fixes #3476
Diffstat (limited to 'embassy-rp/src/pio/mod.rs')
| -rw-r--r-- | embassy-rp/src/pio/mod.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/embassy-rp/src/pio/mod.rs b/embassy-rp/src/pio/mod.rs index 72aa8f104..98f4f8943 100644 --- a/embassy-rp/src/pio/mod.rs +++ b/embassy-rp/src/pio/mod.rs | |||
| @@ -1054,9 +1054,17 @@ impl<'d, PIO: Instance> Common<'d, PIO> { | |||
| 1054 | pub fn make_pio_pin(&mut self, pin: impl Peripheral<P = impl PioPin + 'd> + 'd) -> Pin<'d, PIO> { | 1054 | pub fn make_pio_pin(&mut self, pin: impl Peripheral<P = impl PioPin + 'd> + 'd) -> Pin<'d, PIO> { |
| 1055 | into_ref!(pin); | 1055 | into_ref!(pin); |
| 1056 | pin.gpio().ctrl().write(|w| w.set_funcsel(PIO::FUNCSEL as _)); | 1056 | pin.gpio().ctrl().write(|w| w.set_funcsel(PIO::FUNCSEL as _)); |
| 1057 | #[cfg(feature = "_rp235x")] | 1057 | pin.pad_ctrl().write(|w| { |
| 1058 | pin.pad_ctrl().modify(|w| { | 1058 | #[cfg(feature = "_rp235x")] |
| 1059 | w.set_iso(false); | 1059 | w.set_iso(false); |
| 1060 | w.set_schmitt(true); | ||
| 1061 | w.set_slewfast(false); | ||
| 1062 | // TODO rp235x errata E9 recommends to not enable IE if we're not | ||
| 1063 | // going to use input. Maybe add an API for the user to enable/disable this? | ||
| 1064 | w.set_ie(true); | ||
| 1065 | w.set_od(false); | ||
| 1066 | w.set_pue(false); | ||
| 1067 | w.set_pde(false); | ||
| 1060 | }); | 1068 | }); |
| 1061 | // we can be relaxed about this because we're &mut here and nothing is cached | 1069 | // we can be relaxed about this because we're &mut here and nothing is cached |
| 1062 | PIO::state().used_pins.fetch_or(1 << pin.pin_bank(), Ordering::Relaxed); | 1070 | PIO::state().used_pins.fetch_or(1 << pin.pin_bank(), Ordering::Relaxed); |
