Added implementation of the default toggleable trait.

features/pwm
HarkonenBade 4 years ago
parent 162083af74
commit 58caea6fa5

@ -57,7 +57,7 @@ macro_rules! gpio {
pub mod $gpiox {
use core::marker::PhantomData;
use embedded_hal::digital::{InputPin, OutputPin, StatefulOutputPin};
use embedded_hal::digital::{InputPin, OutputPin, StatefulOutputPin, toggleable};
use crate::stm32::$GPIOX;
use crate::stm32::RCC;
@ -119,6 +119,8 @@ macro_rules! gpio {
}
}
impl<MODE> toggleable::Default for $PXx<Output<MODE>> {}
impl<MODE> InputPin for $PXx<Input<MODE>> {
fn is_high(&self) -> bool {
!self.is_low()
@ -411,6 +413,8 @@ macro_rules! gpio {
}
}
impl<MODE> toggleable::Default for $PXi<Output<MODE>> {}
impl<MODE> $PXi<Input<MODE>> {
/// Erases the pin number from the type
///

Loading…
Cancel
Save