Skip to main content

LedIndexed

Trait LedIndexed 

Source
pub trait LedIndexed {
    // Required methods
    fn init(&self, index: usize);
    fn on(&self, index: usize);
    fn off(&self, index: usize);
    fn toggle(&self, index: usize);
    fn read(&self, index: usize) -> bool;
}
Expand description

Mirror of the [kernel::hil::led::Led] trait but that supports LED indices.

This is implemented by ScreenOnLed. The trait allows us to avoid having to replicate the const types on ScreenOnLed.

Required Methods§

Source

fn init(&self, index: usize)

Source

fn on(&self, index: usize)

Source

fn off(&self, index: usize)

Source

fn toggle(&self, index: usize)

Source

fn read(&self, index: usize) -> bool

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a, S: Screen<'a>, const NUM_LEDS: usize, const SCREEN_WIDTH: usize, const SCREEN_HEIGHT: usize> LedIndexed for ScreenOnLed<'a, S, NUM_LEDS, SCREEN_WIDTH, SCREEN_HEIGHT>