Struct MaxMatrix

Source
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>

Source

pub fn reload(&mut self)

Reload the data from the buffer to the LED Matrix

Source

pub fn new(data: DataPin, load: LoadPin, clock: ClockPin, num: u8) -> Self

Creates a new instance of the MaxMatrix struct
data - The data pin
load - The load pin
clock - The clock pin
num - The amount of LED Matrices connected

Source

pub fn init(&mut self)

Initializes the LED Matrix with default values

Source

pub fn clear(&mut self)

Clears the Buffer and the LED Matrix

Source

pub fn set_intensity(&mut self, intensity: u8)

Sets the brightness of the LED Matrix

Source

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

Source

pub fn set_column_all(&mut self, col: u8, value: u8)

Sets a colum of all connected LED Matrices

Source

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

Source

pub fn set_dot(&mut self, col: u8, row: u8, value: bool)

Sets a pixel at a specified position and refreshes the displays

Source

pub fn shift_left(&mut self, rotate: bool, fill_zero: bool)

Shifts the entire buffer to the left
rotate - If true, the last column will be moved to the first position
fill_zero - If true, the last column will be set to 0

Source

pub fn shift_right(&mut self, rotate: bool, fill_zero: bool)

Shifts the entire buffer to the right
rotate - If true, the last column will be moved to the first position
fill_zero - If true, the last column will be set to 0

Source

pub fn shift_up(&mut self, rotate: bool)

Shifts the entire buffer up
rotate - If true, the last row will be moved to the first position

Source

pub fn shift_down(&mut self, rotate: bool)

Shifts the entire buffer down
rotate - If true, the last row will be moved to the first position

Auto Trait Implementations§

§

impl<DataPin, LoadPin, ClockPin> Freeze for MaxMatrix<DataPin, LoadPin, ClockPin>
where DataPin: Freeze, LoadPin: Freeze, ClockPin: Freeze,

§

impl<DataPin, LoadPin, ClockPin> RefUnwindSafe for MaxMatrix<DataPin, LoadPin, ClockPin>
where DataPin: RefUnwindSafe, LoadPin: RefUnwindSafe, ClockPin: RefUnwindSafe,

§

impl<DataPin, LoadPin, ClockPin> Send for MaxMatrix<DataPin, LoadPin, ClockPin>
where DataPin: Send, LoadPin: Send, ClockPin: Send,

§

impl<DataPin, LoadPin, ClockPin> Sync for MaxMatrix<DataPin, LoadPin, ClockPin>
where DataPin: Sync, LoadPin: Sync, ClockPin: Sync,

§

impl<DataPin, LoadPin, ClockPin> Unpin for MaxMatrix<DataPin, LoadPin, ClockPin>
where DataPin: Unpin, LoadPin: Unpin, ClockPin: Unpin,

§

impl<DataPin, LoadPin, ClockPin> UnwindSafe for MaxMatrix<DataPin, LoadPin, ClockPin>
where DataPin: UnwindSafe, LoadPin: UnwindSafe, ClockPin: UnwindSafe,

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.