OnOffSequenceOutput

Struct OnOffSequenceOutput 

Source
pub struct OnOffSequenceOutput<T: OutputPin> {
    pub pin: T,
    /* private fields */
}
Expand description

Output of blinking patterns on an LED

Fields§

§pin: T

The wrapped output pin.

Implementations§

Source§

impl<T: OutputPin> OnOffSequenceOutput<T>

Source

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

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
Source

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

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
Source

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

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§

Source§

impl<T: OutputPin> OutputUpdate for OnOffSequenceOutput<T>

Source§

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

Updates the output logic and potentially switches the LED state

Source§

type Error = <T as OutputPin>::Error

Auto Trait Implementations§

§

impl<T> Freeze for OnOffSequenceOutput<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for OnOffSequenceOutput<T>
where T: RefUnwindSafe,

§

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,

§

impl<T> UnwindSafe for OnOffSequenceOutput<T>
where 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>,

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.