Struct led::mono::LED

source ·
pub struct LED<C, P> { /* private fields */ }
Expand description

An RGB LED

The RGB LED is represented by three owned instances of embedded_hal::digital::v2::OutputPin and a polarity (common anode or common cathode). Because the outputs are binary, only eight colors can be presented: primary colors, secondary colors, white, and black.

Implementations§

source§

impl<C, P> LED<C, P>where C: Common, P: OutputPin,

source

pub fn new(pin: P) -> LED<C, P>

Creates a new RGB LED given three GPIOs.

source

pub fn set(&mut self, state: State)

Sets the RGB LED to the specified color.

Trait Implementations§

source§

impl<C, P> LED for LED<C, P>where C: Common, P: OutputPin,

source§

fn set(&mut self, state: State)

Sets the RGB LED to the specified color.

§

type Input = State

Auto Trait Implementations§

§

impl<C, P> RefUnwindSafe for LED<C, P>where C: RefUnwindSafe, P: RefUnwindSafe,

§

impl<C, P> Send for LED<C, P>where C: Send, P: Send,

§

impl<C, P> Sync for LED<C, P>where C: Sync, P: Sync,

§

impl<C, P> Unpin for LED<C, P>where C: Unpin, P: Unpin,

§

impl<C, P> UnwindSafe for LED<C, P>where C: UnwindSafe, P: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.
source§

impl<L> Monocolor for Lwhere L: LED<Input = State>,