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>
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>
pub const fn new(screen: &'a S, buffer: &'static mut [u8]) -> Self
Sourcepub const fn get_size(&self) -> (usize, usize, usize)
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.
pub const fn get_char_width(&self, height: usize, c: char) -> usize
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>
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§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>
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>)
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>,
)
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 bufferSource§fn screen_is_ready(&self)
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more