[][src]Struct pi_ir_remote::IRPulseReader

pub struct IRPulseReader { /* fields omitted */ }

A struct that allows to detect IR pulses and signals by polling the state of an IR sensor periodically, calculating pulse lengths and decoding pulse sequences into signals.

Implementations

impl IRPulseReader[src]

pub fn new(gpio_pin: u32) -> Result<IRPulseReader, Box<dyn Error>>[src]

pub fn read_pulse(&mut self) -> Result<Option<Signal>, Box<dyn Error>>[src]

This function needs to be called periodically to detect pulses and signals. An error is returned if the GPIO pin cannot be read. The function returns the decoded signal if the current transmission state resulted in a complete signal. If no signal was recognized or transmission is in progress, None is returned.

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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.

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.