Struct max7219_driver::MAX7219
source · [−]pub struct MAX7219<SPI, CS> { /* private fields */ }Expand description
The MAX7219 Driver that initializes and communicates with the MAX7219 IC or chain of ICs.
Implementations
sourceimpl<SPI, CS> MAX7219<SPI, CS> where
SPI: Write<u8>,
CS: OutputPin,
impl<SPI, CS> MAX7219<SPI, CS> where
SPI: Write<u8>,
CS: OutputPin,
sourcepub fn new(spi: SPI, cs: CS) -> Result<Self, DriverError>
pub fn new(spi: SPI, cs: CS) -> Result<Self, DriverError>
Constructor method. Creates a new instance of the MAX7219 driver.
sourcepub fn transmit_raw_data(&mut self, arr: &[u8]) -> Result<(), DriverError>
pub fn transmit_raw_data(&mut self, arr: &[u8]) -> Result<(), DriverError>
sourcepub fn config_power_mode(&mut self, mode: Shutdown)
pub fn config_power_mode(&mut self, mode: Shutdown)
Configures the power mode of the MAX7219 IC.
Arguments
mode- one of the options in theShutdownenum
sourcepub fn config_decode_mode(&mut self, mode: DecodeMode)
pub fn config_decode_mode(&mut self, mode: DecodeMode)
Configures the decode mode on the input sent to the MAX7219 IC.
Arguments
mode- one of the options in theDecodeModeenum
sourcepub fn config_intensity(&mut self, mode: Intensity)
pub fn config_intensity(&mut self, mode: Intensity)
Configures the intensity of the LEDs on the display connected to the MAX7219 IC.
Arguments
mode- one of the options in theIntensityenum
sourcepub fn config_scan_limit(&mut self, mode: ScanLimit)
pub fn config_scan_limit(&mut self, mode: ScanLimit)
Configures the scanlimit for the MAX7219 IC. Applicable mostly to seven segment displays if certain digits (ex. on the left) need not to be shown.
Arguments
mode- one of the options in theScanLimitenum
sourcepub fn display_test(&mut self, mode: DisplayTest)
pub fn display_test(&mut self, mode: DisplayTest)
Method to perform a visual test of the display. If performing a test, display needs to be put back in normal operation mode after done.
Arguments
mode- one of the options in theDisplayTestenum
sourcepub fn draw_row_or_digit(&mut self, digit_addr: DigitRowAddress, led_data: u8)
pub fn draw_row_or_digit(&mut self, digit_addr: DigitRowAddress, led_data: u8)
Method to draw a row if the MAX7219 is driving an 8x8 LED dot matrix display. Alternatively method will draw a digit in case the MAX7219 is driving a seven-segment display
Arguments
digit_addr- one of the options in theDigitRowAddressenumled_data- the led row or seven segment digit activation data
sourcepub fn clear_display(&mut self)
pub fn clear_display(&mut self)
Method to clear the display.
sourcepub fn init_display(&mut self, clr_display: bool)
pub fn init_display(&mut self, clr_display: bool)
Method to initialize the MAX7219 and the connected display. This method has to be called before doing any display operations otherwise the display will not operate properly. The method provides an option to leave the display uncleared after initalization.
Arguments
clr_display- Boolean that reflects whether the display should be cleared or not after init
Auto Trait Implementations
impl<SPI, CS> RefUnwindSafe for MAX7219<SPI, CS> where
CS: RefUnwindSafe,
SPI: RefUnwindSafe,
impl<SPI, CS> Send for MAX7219<SPI, CS> where
CS: Send,
SPI: Send,
impl<SPI, CS> Sync for MAX7219<SPI, CS> where
CS: Sync,
SPI: Sync,
impl<SPI, CS> Unpin for MAX7219<SPI, CS> where
CS: Unpin,
SPI: Unpin,
impl<SPI, CS> UnwindSafe for MAX7219<SPI, CS> where
CS: UnwindSafe,
SPI: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more