diff --git a/src/gpio.rs b/src/gpio.rs index a1103b499..a65018767 100644 --- a/src/gpio.rs +++ b/src/gpio.rs @@ -300,7 +300,7 @@ impl Pin, P, N> { impl Pin, P, N> { /// Enables / disables the internal pull up - pub fn internal_pull_up(&mut self, on: bool) { + pub fn internal_pull_up(self, on: bool) -> Self { let offset = 2 * { N }; let value = if on { 0b01 } else { 0b00 }; unsafe { @@ -308,6 +308,8 @@ impl Pin, P, N> { .pupdr .modify(|r, w| w.bits((r.bits() & !(0b11 << offset)) | (value << offset))) }; + + self } /// Enables / disables the internal pull down