pub enum OutputStateError<I, E> {
InputPinError(I),
EnablePinError(E),
NotEnabled,
}Expand description
Error returned by the L293x and HalfH implementations.
This enumeration combines the possible errors returned by the input pin and the enable pin.
Depending on the source of the error, either an InputPinError or a EnablePinError will be returned by the functions implemented in the OutputPin traits.
§Examples
use embedded_hal::digital::OutputPin;
use l293x::{HalfH, OutputStateError};
let mut bridge = HalfH::new(input, enable);
bridge.set_high().unwrap_or(|error| {
match error {
OutputStateError::InputPinError(e) => println!("Error setting the input pin high: {e}"),
OutputStateError::EnablePinError(e) => println!("Error in enable pin: {e}"),
}
});Variants§
InputPinError(I)
An error occurred while setting the state of the input pin. The contained error
EnablePinError(E)
An error occurred while setting the state of the enable pin. The contained error may contain additional information.
NotEnabled
Error returned by the is_set_[high|low] methods of the
StatefulOutputPin trait, if the output checked
is not enabled.
Trait Implementations§
Source§impl<I, E> Error for OutputStateError<I, E>
impl<I, E> Error for OutputStateError<I, E>
Source§impl<I, E> Error for OutputStateError<I, E>
impl<I, E> Error for OutputStateError<I, E>
Source§impl<I, E> PartialEq for OutputStateError<I, E>
impl<I, E> PartialEq for OutputStateError<I, E>
impl<I, E> Eq for OutputStateError<I, E>
Auto Trait Implementations§
impl<I, E> Freeze for OutputStateError<I, E>
impl<I, E> RefUnwindSafe for OutputStateError<I, E>where
I: RefUnwindSafe,
E: RefUnwindSafe,
impl<I, E> Send for OutputStateError<I, E>
impl<I, E> Sync for OutputStateError<I, E>
impl<I, E> Unpin for OutputStateError<I, E>
impl<I, E> UnwindSafe for OutputStateError<I, E>where
I: UnwindSafe,
E: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more