Struct ScreenOnLed

Source
pub struct ScreenOnLed<'a, S: Screen<'a>, const NUM_LEDS: usize, const SCREEN_WIDTH: usize, const SCREEN_HEIGHT: usize> { /* private fields */ }

Implementations§

Source§

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

Source

pub const fn new(screen: &'a S, buffer: &'static mut [u8]) -> Self

Source

pub const fn get_size(&self) -> (usize, usize, usize)

Find a size of the graphic that works with the screen by shrinking the LEDs until everything fits.

Source

pub const fn get_char_width(&self, height: usize, c: char) -> usize

Source

pub const fn get_led_width(&self, height: usize) -> usize

Trait Implementations§

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>

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

Source§

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

Source§

fn command_complete(&self, _r: Result<(), ErrorCode>)

The screen will call this function to notify that a command (except write) has finished.
Source§

fn write_complete( &self, data: SubSliceMut<'static, u8>, _r: Result<(), ErrorCode>, )

The screen will call this function to notify that the write command has finished. This is different from command_complete as it has to pass back the write buffer
Source§

fn screen_is_ready(&self)

Some screens need some time to start, this function is called when the screen is ready.

Auto Trait Implementations§

§

impl<'a, S, const NUM_LEDS: usize, const SCREEN_WIDTH: usize, const SCREEN_HEIGHT: usize> !Freeze for ScreenOnLed<'a, S, NUM_LEDS, SCREEN_WIDTH, SCREEN_HEIGHT>

§

impl<'a, S, const NUM_LEDS: usize, const SCREEN_WIDTH: usize, const SCREEN_HEIGHT: usize> !RefUnwindSafe for ScreenOnLed<'a, S, NUM_LEDS, SCREEN_WIDTH, SCREEN_HEIGHT>

§

impl<'a, S, const NUM_LEDS: usize, const SCREEN_WIDTH: usize, const SCREEN_HEIGHT: usize> Send for ScreenOnLed<'a, S, NUM_LEDS, SCREEN_WIDTH, SCREEN_HEIGHT>
where S: Sync,

§

impl<'a, S, const NUM_LEDS: usize, const SCREEN_WIDTH: usize, const SCREEN_HEIGHT: usize> !Sync for ScreenOnLed<'a, S, NUM_LEDS, SCREEN_WIDTH, SCREEN_HEIGHT>

§

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

§

impl<'a, S, const NUM_LEDS: usize, const SCREEN_WIDTH: usize, const SCREEN_HEIGHT: usize> !UnwindSafe for ScreenOnLed<'a, S, NUM_LEDS, SCREEN_WIDTH, SCREEN_HEIGHT>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.