[][src]Trait switch_hal::ToggleableOutputSwitch

pub trait ToggleableOutputSwitch {
    type Error;
    fn toggle(&mut self) -> Result<(), Self::Error>;
}

Toggles the switch from it's current state to it's opposite state.

Notes

This is only available if the underlying hal has implemented ToggleableOutputPin

Associated Types

type Error

Loading content...

Required methods

fn toggle(&mut self) -> Result<(), Self::Error>

Toggles the current state of the OutputSwitch

Examples

use switch_hal::{ActiveHigh, OutputSwitch, ToggleableOutputSwitch, Switch};
let mut led = Switch::<_, ActiveHigh>::new(pin);
led.toggle().ok();
Loading content...

Implementors

impl<T: OutputPin + ToggleableOutputPin, ActiveLevel> ToggleableOutputSwitch for Switch<T, ActiveLevel>[src]

type Error = <T as ToggleableOutputPin>::Error

Loading content...