Trait spark_ser7seg::SevenSegInterface[][src]

pub trait SevenSegInterface {
    type InterfaceError;
    fn send(&mut self, data: &[u8]) -> Result<(), Error<Self::InterfaceError>>;

    fn set_cursor(&mut self, col: u8) -> Result<(), Error<Self::InterfaceError>> { ... }
fn set_brightness(
        &mut self,
        bright: u8
    ) -> Result<(), Error<Self::InterfaceError>> { ... }
fn clear(&mut self) -> Result<(), Error<Self::InterfaceError>> { ... }
fn write_digit(
        &mut self,
        digit: u8
    ) -> Result<(), Error<Self::InterfaceError>> { ... }
fn write_punctuation(
        &mut self,
        punct_flags: PunctuationFlags
    ) -> Result<(), Error<Self::InterfaceError>> { ... }
fn write_digits(
        &mut self,
        digits: &[u8]
    ) -> Result<(), Error<Self::InterfaceError>> { ... }
fn set_num(&mut self, num: u16) -> Result<(), Error<Self::InterfaceError>> { ... } }

Associated Types

type InterfaceError[src]

A single error type used by the interface

Loading content...

Required methods

fn send(&mut self, data: &[u8]) -> Result<(), Error<Self::InterfaceError>>[src]

Sending commands to the interface

Loading content...

Provided methods

fn set_cursor(&mut self, col: u8) -> Result<(), Error<Self::InterfaceError>>[src]

Set the digit cursor to a particular location col may be 0..=3, from left to right.

fn set_brightness(
    &mut self,
    bright: u8
) -> Result<(), Error<Self::InterfaceError>>
[src]

Set the brightness for the display. The datasheet says that 100 is the brightest, however my device gets brighter with values above 100 (up to 255). Your mileage may vary.

fn clear(&mut self) -> Result<(), Error<Self::InterfaceError>>[src]

Completely clear the display

fn write_digit(&mut self, digit: u8) -> Result<(), Error<Self::InterfaceError>>[src]

Write a digit to the curent cursor position. This also increments the cursor position

fn write_punctuation(
    &mut self,
    punct_flags: PunctuationFlags
) -> Result<(), Error<Self::InterfaceError>>
[src]

Write the requested punctuation to the display. This does not take the current state into account, so any unset flags in punct_flags will turn the corresponding LEDs off.

fn write_digits(
    &mut self,
    digits: &[u8]
) -> Result<(), Error<Self::InterfaceError>>
[src]

Write the requested digits to the display, starting at the current cursor position. Each digit must be in the range 0x0..=0xF, and up to 4 digits may be updated at once. The cursor is incremented after each digit

fn set_num(&mut self, num: u16) -> Result<(), Error<Self::InterfaceError>>[src]

Write the number to the display. The number will be left-filled with zeroes if necessary. After this function, the cursor will be at position 0.

Loading content...

Implementors

impl<I2C> SevenSegInterface for SevSegI2c<I2C> where
    I2C: Write
[src]

type InterfaceError = I2cError<I2C::Error>

impl<SPIM, CS> SevenSegInterface for SevSegSpim<SPIM, CS> where
    SPIM: Write<u8>,
    CS: OutputPin
[src]

type InterfaceError = SpimError<SPIM::Error, CS::Error>

Loading content...