Implement toggleable for the new erased pins

features/pwm
HarkonenBade 5 years ago
parent 116a511474
commit 5fd73b0fa9

@ -56,8 +56,7 @@ pub struct Output<MODE> {
/// Push pull output (type state)
pub struct PushPull;
use crate::stm32;
use embedded_hal::digital::{InputPin, OutputPin, StatefulOutputPin};
use embedded_hal::digital::{InputPin, OutputPin, StatefulOutputPin, toggleable};
/// Fully erased pin
pub struct Pin<MODE> {
@ -86,6 +85,8 @@ impl<MODE> OutputPin for Pin<Output<MODE>> {
}
}
impl<MODE> toggleable::Default for Pin<Output<MODE>> {}
impl InputPin for Pin<Output<OpenDrain>> {
fn is_high(&self) -> bool {
!self.is_low()

Loading…
Cancel
Save