tm1637_embedded_hal

Struct TM1637Builder

Source
pub struct TM1637Builder<CLK, DIO, DELAY> { /* private fields */ }
Expand description

TM1637 7-segment display builder.

Implementations§

Source§

impl<CLK, DIO, DELAY> TM1637Builder<CLK, DIO, DELAY>

Source

pub const fn new(clk: CLK, dio: DIO, delay: DELAY) -> Self

Create a new TM1637Builder instance with default values.

Source

pub fn brightness(self, brightness: Brightness) -> Self

Set the brightness level.

Source

pub fn delay_us(self, delay_us: u32) -> Self

Set the delay in microseconds.

Source

pub fn build<const N: usize, T: Mode>(self) -> TM1637<N, T, CLK, DIO, DELAY>

Build a TM1637 instance with the specified mode.

§Async
use tm1637_embedded_hal::{mock::Noop, tokens::Async, TM1637Builder};

let clk = Noop;
let dio = Noop;
let delay = Noop;

let tm = TM1637Builder::new(clk, dio, delay).build::<4, Async>();
§Blocking
use tm1637_embedded_hal::{mock::Noop, tokens::Blocking, TM1637Builder};

let clk = Noop;
let dio = Noop;
let delay = Noop;

let tm = TM1637Builder::new(clk, dio, delay).build::<4, Blocking>();
Source

pub fn build_async<const N: usize>(self) -> TM1637<N, Async, CLK, DIO, DELAY>

Build an async TM1637 instance.

Source

pub fn build_blocking<const N: usize>( self, ) -> TM1637<N, Blocking, CLK, DIO, DELAY>

Build a blocking TM1637 instance.

Trait Implementations§

Source§

impl<CLK: Clone, DIO: Clone, DELAY: Clone> Clone for TM1637Builder<CLK, DIO, DELAY>

Source§

fn clone(&self) -> TM1637Builder<CLK, DIO, DELAY>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<CLK: Debug, DIO: Debug, DELAY: Debug> Debug for TM1637Builder<CLK, DIO, DELAY>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<CLK, DIO, DELAY> Format for TM1637Builder<CLK, DIO, DELAY>
where CLK: Format, DIO: Format, DELAY: Format, Brightness: Format,

Source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.

Auto Trait Implementations§

§

impl<CLK, DIO, DELAY> Freeze for TM1637Builder<CLK, DIO, DELAY>
where CLK: Freeze, DIO: Freeze, DELAY: Freeze,

§

impl<CLK, DIO, DELAY> RefUnwindSafe for TM1637Builder<CLK, DIO, DELAY>
where CLK: RefUnwindSafe, DIO: RefUnwindSafe, DELAY: RefUnwindSafe,

§

impl<CLK, DIO, DELAY> Send for TM1637Builder<CLK, DIO, DELAY>
where CLK: Send, DIO: Send, DELAY: Send,

§

impl<CLK, DIO, DELAY> Sync for TM1637Builder<CLK, DIO, DELAY>
where CLK: Sync, DIO: Sync, DELAY: Sync,

§

impl<CLK, DIO, DELAY> Unpin for TM1637Builder<CLK, DIO, DELAY>
where CLK: Unpin, DIO: Unpin, DELAY: Unpin,

§

impl<CLK, DIO, DELAY> UnwindSafe for TM1637Builder<CLK, DIO, DELAY>
where CLK: UnwindSafe, DIO: UnwindSafe, DELAY: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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.