stm32/gpio: expose all functionality as inherent methods.

This commit is contained in:
Dario Nieuwenhuis
2022-01-14 22:02:00 +01:00
parent 52e156b429
commit 58fc64722c
34 changed files with 266 additions and 210 deletions

View File

@ -94,17 +94,25 @@ impl<'d, T: GpioPin> ExtiInput<'d, T> {
pub fn new(pin: Input<'d, T>, _ch: impl Unborrow<Target = T::ExtiChannel> + 'd) -> Self {
Self { pin }
}
pub fn is_high(&self) -> bool {
self.pin.is_high()
}
pub fn is_low(&self) -> bool {
self.pin.is_low()
}
}
impl<'d, T: GpioPin> InputPin for ExtiInput<'d, T> {
type Error = Infallible;
fn is_high(&self) -> Result<bool, Self::Error> {
self.pin.is_high()
Ok(self.is_high())
}
fn is_low(&self) -> Result<bool, Self::Error> {
self.pin.is_low()
Ok(self.is_low())
}
}