Struct embedded_simple_ui::led::PinLed

source ·
pub struct PinLed<P: StatefulOutputPin, C: Clock> { /* private fields */ }

Implementations§

source§

impl<P: StatefulOutputPin, C: Clock> PinLed<P, C>

source

pub fn new(pin: P) -> Self

Trait Implementations§

source§

impl<P: StatefulOutputPin, C: Clock> Led<C> for PinLed<P, C>

source§

fn is_on(&mut self) -> bool

source§

fn turn_on(&mut self)

Turns on the LED Read more
source§

fn turn_off(&mut self)

Turns off the LED Read more
source§

fn toggle(&mut self)

Toggles the led on/off
source§

fn set_effect(&mut self, effect: LedEffect<C>)

Sets the effect on this LED instance Read more
source§

fn set_effect_duration(&mut self, dur: Milliseconds<<C as Clock>::T>)

Sets the current effect duration on this LED instance Read more
source§

fn clear_effect(&mut self)

Clears current the effect Read more
source§

fn poll(&mut self, now: Instant<C>)

Polls the LED, updating it’s state tracking and hardware state Read more
source§

fn get_effect(&self) -> Option<&LedEffect<C>>

Returns the current LED effect Read more

Auto Trait Implementations§

§

impl<P, C> Freeze for PinLed<P, C>
where P: Freeze, <C as Clock>::T: Freeze,

§

impl<P, C> RefUnwindSafe for PinLed<P, C>
where P: RefUnwindSafe, <C as Clock>::T: RefUnwindSafe,

§

impl<P, C> Send for PinLed<P, C>
where P: Send, <C as Clock>::T: Send,

§

impl<P, C> Sync for PinLed<P, C>
where P: Sync, <C as Clock>::T: Sync,

§

impl<P, C> Unpin for PinLed<P, C>
where P: Unpin, <C as Clock>::T: Unpin,

§

impl<P, C> UnwindSafe for PinLed<P, C>
where P: UnwindSafe, <C as Clock>::T: 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>,

§

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>,

§

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.