Struct SegmentDisplay

Source
pub struct SegmentDisplay<SPI, PIN> { /* private fields */ }

Implementations§

Source§

impl<SPI, PIN> SegmentDisplay<SPI, PIN>
where SPI: Write<u8>, PIN: OutputPin,

Source

pub fn new(spi: SPI, latch_pin: PIN) -> Self

Create a new SegmentDisplay

Source

pub fn release(self) -> (SPI, PIN)

Release the SegmentDisplay and the resources

Source

pub fn refresh(&mut self) -> Result<(), SPI::Error>

Refresh the display. Needs to be called periodically with a sufficientlty hight frequenzy otherwise the display will flicker.

Source

pub fn refresh_with_delay<DELAY>( &mut self, delay: &mut DELAY, ) -> Result<(), SPI::Error>
where DELAY: DelayUs<u16>,

Source

pub fn write_chars(&mut self, buf: [char; 4])

Write characters to the display

Source

pub fn write_str(&mut self, s: &str)

Write a string to the display

Source

pub fn write_number(&mut self, num: usize)

Write a number to the display

Auto Trait Implementations§

§

impl<SPI, PIN> Freeze for SegmentDisplay<SPI, PIN>
where SPI: Freeze, PIN: Freeze,

§

impl<SPI, PIN> RefUnwindSafe for SegmentDisplay<SPI, PIN>
where SPI: RefUnwindSafe, PIN: RefUnwindSafe,

§

impl<SPI, PIN> Send for SegmentDisplay<SPI, PIN>
where SPI: Send, PIN: Send,

§

impl<SPI, PIN> Sync for SegmentDisplay<SPI, PIN>
where SPI: Sync, PIN: Sync,

§

impl<SPI, PIN> Unpin for SegmentDisplay<SPI, PIN>
where SPI: Unpin, PIN: Unpin,

§

impl<SPI, PIN> UnwindSafe for SegmentDisplay<SPI, PIN>
where SPI: UnwindSafe, PIN: 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.