#[non_exhaustive]pub enum Error {
EventTimeout,
MasterArbitrationLoss,
MasterStartStopError,
MonitorOverflow,
SclTimeout,
UnexpectedState {
expected: State,
actual: Result<State, u8>,
},
AddressOutOfRange,
UnknownSlaveState(u8),
}Expand description
I2C error
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
EventTimeout
Event Timeout
Corresponds to the EVENTTIMEOUT flag in the STAT register.
MasterArbitrationLoss
Master Arbitration Loss
Corresponds to the MSTARBLOSS flag in the STAT register.
MasterStartStopError
Master Start/Stop Error
Corresponds to the MSTSTSTPERR flag in the STAT register.
MonitorOverflow
Monitor Overflow
Corresponds to the MONOV flag in the STAT register.
SclTimeout
SCL Timeout
Corresponds to the SCLTIMEOUT flag in the STAT register.
UnexpectedState
The I2C code encountered an unexpected hardware state
Fields
AddressOutOfRange
An unencodable address was specified.
Currently, only seven-bit addressing is implemented.
UnknownSlaveState(u8)
While in slave mode, an unknown state was detected
Trait Implementations§
impl Eq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
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