pub enum Mpr121Error {
ChannelExceed,
ReadError(Register),
DataConversionError(Register),
WriteError(Register),
ResetFailed {
was_read: bool,
reg: Register,
},
OverCurrent,
WrongDevice {
mismatched_register: Register,
expected: u8,
actual: u8,
},
}Expand description
The MPR121 Device has an Enumeration of potential driver errors, which are held in the enum below
Variants§
ChannelExceed
If an operation exceeds the channel count (typically 12).
ReadError(Register)
If a read operation failed, contains the address that failed.
DataConversionError(Register)
If a data conversion failed, contains the address that failed to convert from
WriteError(Register)
If a write operation failed, contains the address that failed.
ResetFailed
If sending the reset signal failed, contains the register that failed.
OverCurrent
During Startup if there is an overcurrent detection, the driver will fail to initialise indicating a hardware fault
WrongDevice
Wrong Device Connected, this can also happen if the device state is invalid possible due to a short circuit/overcurrent event
Trait Implementations§
Source§impl Clone for Mpr121Error
impl Clone for Mpr121Error
Source§fn clone(&self) -> Mpr121Error
fn clone(&self) -> Mpr121Error
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Mpr121Error
impl Debug for Mpr121Error
Source§impl Ord for Mpr121Error
impl Ord for Mpr121Error
Source§fn cmp(&self, other: &Mpr121Error) -> Ordering
fn cmp(&self, other: &Mpr121Error) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for Mpr121Error
impl PartialEq for Mpr121Error
Source§impl PartialOrd for Mpr121Error
impl PartialOrd for Mpr121Error
impl Copy for Mpr121Error
impl Eq for Mpr121Error
impl StructuralPartialEq for Mpr121Error
Auto Trait Implementations§
impl Freeze for Mpr121Error
impl RefUnwindSafe for Mpr121Error
impl Send for Mpr121Error
impl Sync for Mpr121Error
impl Unpin for Mpr121Error
impl UnwindSafe for Mpr121Error
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