improve GPIO module #7
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user