pub enum SpiError {
Io(Error),
BitsPerWordNotSupported(u8),
BitOrderNotSupported(BitOrder),
ClockSpeedNotSupported(u32),
ModeNotSupported(Mode),
PolarityNotSupported(Polarity),
}
Expand description
Errors that can occur when accessing the SPI peripheral.
Variants§
Io(Error)
I/O error.
BitsPerWordNotSupported(u8)
The specified number of bits per word is not supported.
The Raspberry Pi currently only supports 8 bit words. Any other value will trigger this error.
BitOrderNotSupported(BitOrder)
The specified bit order is not supported.
The Raspberry Pi currently only supports the MsbFirst
bit order. If you
need the LsbFirst
bit order, you can use the reverse_bits
function
instead to reverse the bit order in software by converting your write
buffer before sending it to the slave device, and your read buffer after
reading any incoming data.
ClockSpeedNotSupported(u32)
The specified clock speed is not supported.
ModeNotSupported(Mode)
The specified mode is not supported.
PolarityNotSupported(Polarity)
The specified Slave Select polarity is not supported.
Trait Implementations§
source§impl Error for Error
impl Error for Error
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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