[−][src]Struct pi_ir_remote::IRPulseReader
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
impl RefUnwindSafe for IRPulseReader
impl Send for IRPulseReader
impl Sync for IRPulseReader
impl Unpin for IRPulseReader
impl UnwindSafe for IRPulseReader
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,