Merge pull request #3730 from Georges760/rp-gpio-ood-pu

`embassy-rp`: add `set_pullup()` for `OutputOpenDrain`
This commit is contained in:
Dario Nieuwenhuis 2025-01-06 11:48:46 +00:00 committed by GitHub
commit b33949e5ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -450,6 +450,16 @@ impl<'d> OutputOpenDrain<'d> {
Self { pin } 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. /// Set the pin's drive strength.
#[inline] #[inline]
pub fn set_drive_strength(&mut self, strength: Drive) { pub fn set_drive_strength(&mut self, strength: Drive) {