Skip to content

Commit 3c87bb5

Browse files
committed
embassy-rp: add set_pullup() for OutputOpenDrain
1 parent 953288f commit 3c87bb5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

embassy-rp/src/gpio.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,16 @@ impl<'d> OutputOpenDrain<'d> {
450450
Self { pin }
451451
}
452452

453+
/// Set the pin's pull-up.
454+
#[inline]
455+
pub fn set_pullup(&mut self, enable: bool) {
456+
if enable {
457+
self.pin.set_pull(Pull::Up);
458+
} else {
459+
self.pin.set_pull(Pull::None);
460+
}
461+
}
462+
453463
/// Set the pin's drive strength.
454464
#[inline]
455465
pub fn set_drive_strength(&mut self, strength: Drive) {

0 commit comments

Comments
 (0)