Struct on_off_sequence_output::OnOffSequenceOutput[][src]

pub struct OnOffSequenceOutput<T: OutputPin> {
    pub pin: T,
    // some fields omitted
}
Expand description

Output of blinking patterns on an LED

Fields

pin: T

The wrapped output pin.

Implementations

impl<T: OutputPin> OnOffSequenceOutput<T>[src]

pub fn new(pin: T, update_scale: u16) -> Self[src]

Initializes a new led output

Arguments

  • pin - An as output initialized GPIO pin
  • update_scale - Scale factor: state change frequency = update frequency * update_scale

Notes

  • Default is symmetrically blinking forever

pub fn set(
    &mut self,
    output_states: u128,
    number_of_output_states: u16,
    repeat: Repeat
)
[src]

Set a new output

Arguments

  • output_states - bits of a unsigned number: 1 equals on; 0 equals off The bits are processes from lsb to msb.
  • number_of_output_states - how many bits of the fixed number are considered to for the output state sequence counted from lsb
  • repeat - How often is the pattern repeated

pub fn set_morse(
    &mut self,
    morse_text: &str,
    repeat: Repeat
) -> Result<(), MorseError>
[src]

Set a new morse code as output

Arguments

  • morse_text - Short text to be output as morse code sequence
  • repeat - How often the morse text is repeated

Returns

A result structure

  • with empty value if Ok()
  • or Err(MorseError)

Trait Implementations

impl<T: OutputPin> OutputUpdate for OnOffSequenceOutput<T>[src]

fn update(&mut self) -> Result<bool, Self::Error>[src]

Updates the output logic and potentially switches the LED state

type Error = T::Error

Auto Trait Implementations

impl<T> Send for OnOffSequenceOutput<T> where
    T: Send

impl<T> Sync for OnOffSequenceOutput<T> where
    T: Sync

impl<T> Unpin for OnOffSequenceOutput<T> where
    T: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.