pub struct MaxMatrix<DataPin, LoadPin, ClockPin> { /* private fields */ }
Expand description
The Struct to communicate with the MAX7219 LED Matrix
Implementations§
Source§impl<DataPin: OutputPin, LoadPin: OutputPin, ClockPin: OutputPin> MaxMatrix<DataPin, LoadPin, ClockPin>
impl<DataPin: OutputPin, LoadPin: OutputPin, ClockPin: OutputPin> MaxMatrix<DataPin, LoadPin, ClockPin>
Sourcepub fn new(data: DataPin, load: LoadPin, clock: ClockPin, num: u8) -> Self
pub fn new(data: DataPin, load: LoadPin, clock: ClockPin, num: u8) -> Self
Creates a new instance of the MaxMatrix struct
Sourcepub fn set_intensity(&mut self, intensity: u8)
pub fn set_intensity(&mut self, intensity: u8)
Sets the brightness of the LED Matrix
Sourcepub fn set_column(&mut self, col: u8, value: u8)
pub fn set_column(&mut self, col: u8, value: u8)
Sets an entire column of the LED Matrix
The value is a byte where each bit represents a pixel
Sourcepub fn set_column_all(&mut self, col: u8, value: u8)
pub fn set_column_all(&mut self, col: u8, value: u8)
Sets a colum of all connected LED Matrices
Sourcepub fn update_buffer_at(&mut self, col: u8, row: u8, value: bool)
pub fn update_buffer_at(&mut self, col: u8, row: u8, value: bool)
Updates the buffer at a specified position
This does not automatically refresh the displays
Sourcepub fn set_dot(&mut self, col: u8, row: u8, value: bool)
pub fn set_dot(&mut self, col: u8, row: u8, value: bool)
Sets a pixel at a specified position and refreshes the displays
Sourcepub fn shift_left(&mut self, rotate: bool, fill_zero: bool)
pub fn shift_left(&mut self, rotate: bool, fill_zero: bool)
Shifts the entire buffer to the left
Sourcepub fn shift_right(&mut self, rotate: bool, fill_zero: bool)
pub fn shift_right(&mut self, rotate: bool, fill_zero: bool)
Shifts the entire buffer to the right
Sourcepub fn shift_up(&mut self, rotate: bool)
pub fn shift_up(&mut self, rotate: bool)
Shifts the entire buffer up
Sourcepub fn shift_down(&mut self, rotate: bool)
pub fn shift_down(&mut self, rotate: bool)
Shifts the entire buffer down