Enum rppal::spi::Error[][src]

pub enum Error {
    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.

Tuple Fields of Io

0: 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.

Tuple Fields of BitsPerWordNotSupported

0: u8
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.

Tuple Fields of BitOrderNotSupported

0: BitOrder
ClockSpeedNotSupported(u32)

The specified clock speed is not supported.

Tuple Fields of ClockSpeedNotSupported

0: u32
ModeNotSupported(Mode)

The specified mode is not supported.

Tuple Fields of ModeNotSupported

0: Mode
PolarityNotSupported(Polarity)

The specified Slave Select polarity is not supported.

Tuple Fields of PolarityNotSupported

0: Polarity

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.