diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-01-06 11:48:46 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-01-06 11:48:46 +0000 |
| commit | b33949e5ab105598131f278416160103bf062aed (patch) | |
| tree | 7108a1ba037066ad678de6cb78a2db36e363ee7e | |
| parent | 953288f5c831e7048d38479db8f43cd8126807dd (diff) | |
| parent | 3c87bb588b38ebba6395a0d7b1c37727a7919fe2 (diff) | |
Merge pull request #3730 from Georges760/rp-gpio-ood-pu
`embassy-rp`: add `set_pullup()` for `OutputOpenDrain`
| -rw-r--r-- | embassy-rp/src/gpio.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/embassy-rp/src/gpio.rs b/embassy-rp/src/gpio.rs index 203192827..b3a53d1b9 100644 --- a/embassy-rp/src/gpio.rs +++ b/embassy-rp/src/gpio.rs | |||
| @@ -450,6 +450,16 @@ impl<'d> OutputOpenDrain<'d> { | |||
| 450 | Self { pin } | 450 | Self { pin } |
| 451 | } | 451 | } |
| 452 | 452 | ||
| 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 | |||
| 453 | /// Set the pin's drive strength. | 463 | /// Set the pin's drive strength. |
| 454 | #[inline] | 464 | #[inline] |
| 455 | pub fn set_drive_strength(&mut self, strength: Drive) { | 465 | pub fn set_drive_strength(&mut self, strength: Drive) { |
