Trait kernel::hil::led::Led

source ·
pub trait Led {
    // Required methods
    fn init(&self);
    fn on(&self);
    fn off(&self);
    fn toggle(&self);
    fn read(&self) -> bool;
}
Expand description

Simple on/off interface for LED pins.

Since GPIO pins are synchronous in Tock the LED interface is synchronous as well.

Required Methods§

source

fn init(&self)

Initialize the LED. Must be called before the LED is used.

source

fn on(&self)

Turn the LED on.

source

fn off(&self)

Turn the LED off.

source

fn toggle(&self)

Toggle the LED.

source

fn read(&self) -> bool

Return the on/off state of the LED. true if the LED is on, false if it is off.

Implementors§

source§

impl<P: Pin> Led for LedHigh<'_, P>

source§

impl<P: Pin> Led for LedLow<'_, P>