[−][src]Struct sevensegment::SevenSeg
A structure representing the 7 segments of a 7-segment display
Implementations
impl<A, B, C, D, E, F, G> SevenSeg<A, B, C, D, E, F, G> where
A: OutputPin,
B: OutputPin,
C: OutputPin,
D: OutputPin,
E: OutputPin,
F: OutputPin,
G: OutputPin,
[src]
A: OutputPin,
B: OutputPin,
C: OutputPin,
D: OutputPin,
E: OutputPin,
F: OutputPin,
G: OutputPin,
pub fn new(
seg_a: A,
seg_b: B,
seg_c: C,
seg_d: D,
seg_e: E,
seg_f: F,
seg_g: G
) -> Self
[src]
seg_a: A,
seg_b: B,
seg_c: C,
seg_d: D,
seg_e: E,
seg_f: F,
seg_g: G
) -> Self
Create a new 7-segment display structure by passing in 7 GPIOs implementing the
OutputPin
trait for the segments a
, b
, c
, d
, e
and f
respectively
pub fn release(self) -> (A, B, C, D, E, F, G)
[src]
Release the 7 GPIOs previously occupied by the 7-segment display
pub fn clear(&mut self) -> Result<(), ()>
[src]
Disable the 7-segment display by pulling all GPIOs low
pub fn seg_a(&mut self, state: bool) -> Result<(), ()>
[src]
Enable or disable segment a
according to the state
pub fn seg_b(&mut self, state: bool) -> Result<(), ()>
[src]
Enable or disable segment b
according to the state
pub fn seg_c(&mut self, state: bool) -> Result<(), ()>
[src]
Enable or disable segment c
according to the state
pub fn seg_d(&mut self, state: bool) -> Result<(), ()>
[src]
Enable or disable segment d
according to the state
pub fn seg_e(&mut self, state: bool) -> Result<(), ()>
[src]
Enable or disable segment e
according to the state
pub fn seg_f(&mut self, state: bool) -> Result<(), ()>
[src]
Enable or disable segment f
according to the state
pub fn seg_g(&mut self, state: bool) -> Result<(), ()>
[src]
Enable or disable segment g
according to the state
pub fn display(&mut self, num: u8) -> Result<(), ()>
[src]
Display the digit specified in num
. Supported are all values in the hexadecimal system,
that is 0
through 9
and A
through F
. Any other value will turn off the display.
Auto Trait Implementations
impl<A, B, C, D, E, F, G> Send for SevenSeg<A, B, C, D, E, F, G> where
A: Send,
B: Send,
C: Send,
D: Send,
E: Send,
F: Send,
G: Send,
A: Send,
B: Send,
C: Send,
D: Send,
E: Send,
F: Send,
G: Send,
impl<A, B, C, D, E, F, G> Sync for SevenSeg<A, B, C, D, E, F, G> where
A: Sync,
B: Sync,
C: Sync,
D: Sync,
E: Sync,
F: Sync,
G: Sync,
A: Sync,
B: Sync,
C: Sync,
D: Sync,
E: Sync,
F: Sync,
G: Sync,
impl<A, B, C, D, E, F, G> Unpin for SevenSeg<A, B, C, D, E, F, G> where
A: Unpin,
B: Unpin,
C: Unpin,
D: Unpin,
E: Unpin,
F: Unpin,
G: Unpin,
A: Unpin,
B: Unpin,
C: Unpin,
D: Unpin,
E: Unpin,
F: Unpin,
G: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,