pub struct LedMatrix<P, const ROWS: usize, const COLS: usize>where
P: OutputPin + 'static,{ /* private fields */ }
Expand description
Led matrix driver supporting arbitrary sized led matrixes.
NOTE: Currently restricted by 8 bits width
Implementations§
Source§impl<P, const ROWS: usize, const COLS: usize> LedMatrix<P, ROWS, COLS>where
P: OutputPin,
impl<P, const ROWS: usize, const COLS: usize> LedMatrix<P, ROWS, COLS>where
P: OutputPin,
Sourcepub fn new(pin_rows: [P; ROWS], pin_cols: [P; COLS]) -> Self
pub fn new(pin_rows: [P; ROWS], pin_cols: [P; COLS]) -> Self
Create a new instance of an LED matrix using the provided pins
Sourcepub fn apply(&mut self, frame: Frame<COLS, ROWS>)
pub fn apply(&mut self, frame: Frame<COLS, ROWS>)
Apply the provided frame onto the frame buffer
Sourcepub fn set_brightness(&mut self, brightness: Brightness)
pub fn set_brightness(&mut self, brightness: Brightness)
Adjust the brightness level
Sourcepub fn increase_brightness(&mut self)
pub fn increase_brightness(&mut self)
Increase brightness relative to current setting
Sourcepub fn decrease_brightness(&mut self)
pub fn decrease_brightness(&mut self)
Decrease brightness relative to current setting
Sourcepub fn render(&mut self)
pub fn render(&mut self)
Perform a full refresh of the display based on the current frame buffer
Sourcepub async fn display(&mut self, frame: Frame<COLS, ROWS>, length: Duration)
pub async fn display(&mut self, frame: Frame<COLS, ROWS>, length: Duration)
Display the provided frame for the duration. Handles screen refresh in an async display loop.
Sourcepub async fn scroll(&mut self, text: &str)
pub async fn scroll(&mut self, text: &str)
Scroll the provided text across the LED display using default duration based on text length
Sourcepub async fn scroll_with_speed(&mut self, text: &str, speed: Duration)
pub async fn scroll_with_speed(&mut self, text: &str, speed: Duration)
Scroll the provided text across the screen within the provided duration
Sourcepub async fn animate(
&mut self,
data: &[u8],
effect: AnimationEffect,
duration: Duration,
)
pub async fn animate( &mut self, data: &[u8], effect: AnimationEffect, duration: Duration, )
Apply animation based on data with the given effect during the provided duration
Sourcepub async fn animate_frames(
&mut self,
data: &[Frame<COLS, ROWS>],
effect: AnimationEffect,
duration: Duration,
)
pub async fn animate_frames( &mut self, data: &[Frame<COLS, ROWS>], effect: AnimationEffect, duration: Duration, )
Animate a slice of frames using the provided effect during the provided duration