Skip to content

Commit

Permalink
RP235x: Set IE and OD when setting a PIO pin
Browse files Browse the repository at this point in the history
  • Loading branch information
pferreir committed Sep 23, 2024
1 parent 3a66d9c commit f18fda3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions embassy-rp/src/pio/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,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<P = impl PioPin + 'd> + '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| {
Expand Down

0 comments on commit f18fda3

Please sign in to comment.