pub struct SevSegSpim<SPIM, CS> { /* private fields */ }Implementations§
Source§impl<SPIM, CS> SevSegSpim<SPIM, CS>
impl<SPIM, CS> SevSegSpim<SPIM, CS>
Sourcepub fn new(spim: SPIM, csn: CS) -> Self
pub fn new(spim: SPIM, csn: CS) -> Self
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.
Sourcepub fn release(self) -> (SPIM, CS)
pub fn release(self) -> (SPIM, CS)
Release the components
Trait Implementations§
Source§impl<SPIM, CS> SevenSegInterface for SevSegSpim<SPIM, CS>
impl<SPIM, CS> SevenSegInterface for SevSegSpim<SPIM, CS>
Source§type InterfaceError = SpimError<<SPIM as Write<u8>>::Error, <CS as OutputPin>::Error>
type InterfaceError = SpimError<<SPIM as Write<u8>>::Error, <CS as OutputPin>::Error>
A single error type used by the interface
Source§fn send(&mut self, data: &[u8]) -> Result<(), Error<Self::InterfaceError>>
fn send(&mut self, data: &[u8]) -> Result<(), Error<Self::InterfaceError>>
Sending commands to the interface
Source§fn set_cursor(&mut self, col: u8) -> Result<(), Error<Self::InterfaceError>>
fn set_cursor(&mut self, col: u8) -> Result<(), Error<Self::InterfaceError>>
Set the digit cursor to a particular location
col may be 0..=3, from left to right.Source§fn set_brightness(
&mut self,
bright: u8,
) -> Result<(), Error<Self::InterfaceError>>
fn set_brightness( &mut self, bright: u8, ) -> Result<(), Error<Self::InterfaceError>>
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.
Source§fn write_digit(&mut self, digit: u8) -> Result<(), Error<Self::InterfaceError>>
fn write_digit(&mut self, digit: u8) -> Result<(), Error<Self::InterfaceError>>
Write a digit to the curent cursor position. This also
increments the cursor position
Source§fn write_punctuation(
&mut self,
punct_flags: PunctuationFlags,
) -> Result<(), Error<Self::InterfaceError>>
fn write_punctuation( &mut self, punct_flags: PunctuationFlags, ) -> Result<(), Error<Self::InterfaceError>>
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.Source§fn write_digits(
&mut self,
digits: &[u8],
) -> Result<(), Error<Self::InterfaceError>>
fn write_digits( &mut self, digits: &[u8], ) -> Result<(), Error<Self::InterfaceError>>
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
Auto Trait Implementations§
impl<SPIM, CS> Freeze for SevSegSpim<SPIM, CS>
impl<SPIM, CS> RefUnwindSafe for SevSegSpim<SPIM, CS>where
SPIM: RefUnwindSafe,
CS: RefUnwindSafe,
impl<SPIM, CS> Send for SevSegSpim<SPIM, CS>
impl<SPIM, CS> Sync for SevSegSpim<SPIM, CS>
impl<SPIM, CS> Unpin for SevSegSpim<SPIM, CS>
impl<SPIM, CS> UnwindSafe for SevSegSpim<SPIM, CS>where
SPIM: UnwindSafe,
CS: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more