pub enum Error<SPI: Transfer<u8>, GPIO: OutputPin> {
Spi(SPI::Error),
Gpio(GPIO::Error),
UnexpectedStatus,
AddressOutOfBounds(u128),
// 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).
AddressOutOfBounds(u128)
Address Out of Bounds
Tried to address memory beyond the limit of the peripheral
Trait Implementations
Auto Trait Implementations
impl<SPI, GPIO> RefUnwindSafe for Error<SPI, GPIO>where
<GPIO as OutputPin>::Error: RefUnwindSafe,
<SPI as Transfer<u8>>::Error: RefUnwindSafe,
impl<SPI, GPIO> Send for Error<SPI, GPIO>where
<GPIO as OutputPin>::Error: Send,
<SPI as Transfer<u8>>::Error: Send,
impl<SPI, GPIO> Sync for Error<SPI, GPIO>where
<GPIO as OutputPin>::Error: Sync,
<SPI as Transfer<u8>>::Error: Sync,
impl<SPI, GPIO> Unpin for Error<SPI, GPIO>where
<GPIO as OutputPin>::Error: Unpin,
<SPI as Transfer<u8>>::Error: Unpin,
impl<SPI, GPIO> UnwindSafe for Error<SPI, GPIO>where
<GPIO as OutputPin>::Error: UnwindSafe,
<SPI as Transfer<u8>>::Error: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more