[][src]Struct max6955::Max6955

pub struct Max6955<I2C> { /* fields omitted */ }

MAX6955 driver

Methods

impl<I2C, E> Max6955<I2C> where
    I2C: WriteRead<Error = E> + Write<Error = E>, 
[src]

pub fn new(i2c: I2C) -> Result<Self, E>[src]

Construct a new MAX6955 driver instance with I2C peripheral and default address of 0x60.

Arguments

  • i2c - I2C interface

Errors

  • E - returned in case there was an error reading/writing to the device

pub fn with_address(i2c: I2C, addr: u8) -> Result<Self, E>[src]

Construct a new MAX6955 driver instance with I2C peripheral and address.

Arguments

  • i2c - I2C interface
  • addr - device address. This can be 0x60 ~ 0x6F. See table 5 in the datasheet.

Errors

  • E - returned in case there was an error reading/writing to the device

pub fn set_address(&mut self, addr: u8)[src]

Set device address

Arguments

  • addr - device address. This can be 0x60 ~ 0x6F. See table 5 in the datasheet.

pub fn set_global_intensity(&mut self, intensity: u8) -> Result<(), E>[src]

Set Global Intensity

Arguments

  • intensity - intensity level 0: lowest ~ 15: highest

Control Blinking

Arguments

  • mode - BlinkMode::Enable: blink, BlinkMode::Disable: not blink
  • rate - BlinkRate::Fast: 0.5s cycle, BlinkRate::Slow: 1.0s cycle

pub fn powerup(&mut self) -> Result<(), E>[src]

Power up Display

pub fn shutdown(&mut self) -> Result<(), E>[src]

Shutdown Display

pub fn set_digit_type(&mut self, digit_type: DigitType) -> Result<(), E>[src]

Configure Digit Type

Arguments

  • digit_type - one of four DigitTypes

pub fn set_pin_mode(&mut self, port: usize, pin_mode: PinMode) -> Result<(), E>[src]

Configure Pin Mode

Arguments

  • port - 0 ~ 4
  • pin_mode

pub fn set_decode_mode(&mut self, mode: DecodeMode) -> Result<(), E>[src]

Configure Decode Mode

Arguments

  • mode - DecodeMode

pub fn test(&mut self, enable: bool) -> Result<(), E>[src]

Display Test function

Arguments

  • enable - true: enable test

pub fn clear_display(&mut self) -> Result<(), E>[src]

Clear Display

pub fn write_str(&mut self, text: &str) -> Result<(), E>[src]

Write Text

Arguments

  • text - text to write

Auto Trait Implementations

impl<I2C> Send for Max6955<I2C> where
    I2C: Send

impl<I2C> Sync for Max6955<I2C> where
    I2C: Sync

impl<I2C> Unpin for Max6955<I2C> where
    I2C: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.