[][src]Struct spark_ser7seg::SevSegSpim

pub struct SevSegSpim<SPIM, CS> { /* fields omitted */ }

Methods

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

pub fn new(spim: SPIM, csn: CS) -> Self[src]

Create a new SparkFun Serial Seven Segment display using a SPI (Master) port. The SPI port has a maximum frequency of 250kHz, and must be in Mode 0.

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

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

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

Completely clear the display

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

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

pub fn write_punctuation(
    &mut self,
    punct_flags: PunctuationFlags
) -> Result<(), Error<SPIM::Error>>
[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.

pub fn write_digits(&mut self, digits: &[u8]) -> Result<(), Error<SPIM::Error>>[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

pub fn set_num(&mut self, num: u16) -> Result<(), Error<SPIM::Error>>[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.

Auto Trait Implementations

impl<SPIM, CS> Send for SevSegSpim<SPIM, CS> where
    CS: Send,
    SPIM: Send

impl<SPIM, CS> Sync for SevSegSpim<SPIM, CS> where
    CS: Sync,
    SPIM: Sync

Blanket Implementations

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

The type returned in the event of a conversion error.

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

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

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