pub trait Led {
// Required methods
fn on(&mut self);
fn off(&mut self);
// Provided method
fn set(&mut self, on: bool) { ... }
}Expand description
LED control trait.
Three methods: turn on, turn off, set explicitly. The third one has a
default impl in terms of the first two so backends only need to
implement Self::on and Self::off. Everything fancier (blink,
pulse, fade) is composed on top by reading the LED pattern out of the
crate::state_machine::TokenState and calling Self::set at the
right cadence.