Skip to content

Commit

Permalink
Merge pull request #3730 from Georges760/rp-gpio-ood-pu
Browse files Browse the repository at this point in the history
`embassy-rp`: add `set_pullup()` for `OutputOpenDrain`
  • Loading branch information
Dirbaio authored Jan 6, 2025
2 parents 953288f + 3c87bb5 commit b33949e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions embassy-rp/src/gpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,16 @@ impl<'d> OutputOpenDrain<'d> {
Self { pin }
}

/// Set the pin's pull-up.
#[inline]
pub fn set_pullup(&mut self, enable: bool) {
if enable {
self.pin.set_pull(Pull::Up);
} else {
self.pin.set_pull(Pull::None);
}
}

/// Set the pin's drive strength.
#[inline]
pub fn set_drive_strength(&mut self, strength: Drive) {
Expand Down

0 comments on commit b33949e

Please sign in to comment.