pub enum Error<SPI: Transfer<u8>, GPIO: OutputPin> {
Spi(SPI::Error),
Gpio(GPIO::Error),
UnexpectedStatus,
// some variants omitted
}
Expand description
The error type used by this library.
This can encapsulate an SPI or GPIO error, and adds its own protocol errors on top of that.
Variants§
Spi(SPI::Error)
An SPI transfer failed.
Gpio(GPIO::Error)
A GPIO could not be set.
UnexpectedStatus
Status register contained unexpected flags.
This can happen when the chip is faulty, incorrectly connected, or the driver wasn’t constructed or destructed properly (eg. while there is still a write in progress).
Trait Implementations§
Auto Trait Implementations§
impl<SPI, GPIO> Freeze for Error<SPI, GPIO>
impl<SPI, GPIO> RefUnwindSafe for Error<SPI, GPIO>
impl<SPI, GPIO> Send for Error<SPI, GPIO>
impl<SPI, GPIO> Sync for Error<SPI, GPIO>
impl<SPI, GPIO> Unpin for Error<SPI, GPIO>
impl<SPI, GPIO> UnwindSafe for Error<SPI, GPIO>
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