diff --git a/vorago-shared-hal/src/gpio/mod.rs b/vorago-shared-hal/src/gpio/mod.rs index 498ea92..286b22b 100644 --- a/vorago-shared-hal/src/gpio/mod.rs +++ b/vorago-shared-hal/src/gpio/mod.rs @@ -36,6 +36,14 @@ impl Output { self.0.set_high(); } + #[inline] + pub fn set_state(&mut self, state: PinState) { + match state { + PinState::Low => self.set_low(), + PinState::High => self.set_high(), + } + } + #[inline] pub fn set_low(&mut self) { self.0.set_low(); @@ -268,6 +276,14 @@ impl Flex { } self.ll.set_high(); } + + #[inline] + pub fn set_state(&mut self, state: PinState) { + match state { + PinState::Low => self.set_low(), + PinState::High => self.set_high(), + } + } } impl embedded_hal::digital::ErrorType for Flex {