Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions embassy-rp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

<!-- next-header -->
## Unreleased - ReleaseDate
- Add output enable inversion API (gpio, pio)

## 0.9.0 - 2025-11-27

Expand Down
12 changes: 12 additions & 0 deletions embassy-rp/src/gpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,18 @@ impl<'d> Flex<'d> {
});
}

/// Configure the output enable inversion of this pin
#[inline]
pub fn set_output_enable_inversion(&mut self, invert: bool) {
self.pin.gpio().ctrl().modify(|w| {
w.set_oeover(if invert {
pac::io::vals::Oeover::INVERT
} else {
pac::io::vals::Oeover::NORMAL
})
})
}

/// Configure the output logic inversion of this pin.
#[inline]
pub fn set_output_inversion(&mut self, invert: bool) {
Expand Down
12 changes: 12 additions & 0 deletions embassy-rp/src/pio/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,18 @@ impl<'l, PIO: Instance> Pin<'l, PIO> {
});
}

/// Configure the output enable inversion of this pin
#[inline]
pub fn set_output_enable_inversion(&mut self, invert: bool) {
self.pin.gpio().ctrl().modify(|w| {
w.set_oeover(if invert {
pac::io::vals::Oeover::INVERT
} else {
pac::io::vals::Oeover::NORMAL
})
})
}

/// Set the pin's input sync bypass.
pub fn set_input_sync_bypass(&mut self, bypass: bool) {
let mask = 1 << self.pin();
Expand Down