pub struct Status { /* private fields */ }
Expand description
Status flags for I2C transactions
The available status flags are BUSERR
, ARBLOST
, RXNACK
,
BUSSTATE
, LOWTOUT
and CLKHOLD
, MEXTTOUT
, SEXTTOUT
and
LENERR
. The binary format of the underlying bits exactly matches
the STATUS bits.
Implementations
sourceimpl Status
impl Status
sourcepub const fn into_bytes(self) -> [u8; 2]
pub const fn into_bytes(self) -> [u8; 2]
sourcepub const fn from_bytes(bytes: [u8; 2]) -> Self
pub const fn from_bytes(bytes: [u8; 2]) -> Self
Converts the given bytes directly into the bitfield struct.
sourceimpl Status
impl Status
sourcepub fn buserr_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
pub fn buserr_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of buserr.
#Errors
If the returned value contains an invalid bit pattern for buserr.
sourcepub fn with_buserr(self, new_val: <bool as Specifier>::InOut) -> Self
pub fn with_buserr(self, new_val: <bool as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of buserr set to the given value.
#Panics
If the given value is out of bounds for buserr.
sourcepub fn with_buserr_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
pub fn with_buserr_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of buserr set to the given value.
#Errors
If the given value is out of bounds for buserr.
sourcepub fn set_buserr(&mut self, new_val: <bool as Specifier>::InOut)
pub fn set_buserr(&mut self, new_val: <bool as Specifier>::InOut)
Sets the value of buserr to the given value.
#Panics
If the given value is out of bounds for buserr.
sourcepub fn set_buserr_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
pub fn set_buserr_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
Sets the value of buserr to the given value.
#Errors
If the given value is out of bounds for buserr.
sourcepub fn arblost_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
pub fn arblost_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of arblost.
#Errors
If the returned value contains an invalid bit pattern for arblost.
sourcepub fn with_arblost(self, new_val: <bool as Specifier>::InOut) -> Self
pub fn with_arblost(self, new_val: <bool as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of arblost set to the given value.
#Panics
If the given value is out of bounds for arblost.
sourcepub fn with_arblost_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
pub fn with_arblost_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of arblost set to the given value.
#Errors
If the given value is out of bounds for arblost.
sourcepub fn set_arblost(&mut self, new_val: <bool as Specifier>::InOut)
pub fn set_arblost(&mut self, new_val: <bool as Specifier>::InOut)
Sets the value of arblost to the given value.
#Panics
If the given value is out of bounds for arblost.
sourcepub fn set_arblost_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
pub fn set_arblost_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
Sets the value of arblost to the given value.
#Errors
If the given value is out of bounds for arblost.
sourcepub fn rxnack_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
pub fn rxnack_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of rxnack.
#Errors
If the returned value contains an invalid bit pattern for rxnack.
sourcepub fn busstate_or_err(
&self
) -> Result<<BusState as Specifier>::InOut, InvalidBitPattern<<BusState as Specifier>::Bytes>>
pub fn busstate_or_err(
&self
) -> Result<<BusState as Specifier>::InOut, InvalidBitPattern<<BusState as Specifier>::Bytes>>
Returns the value of busstate.
#Errors
If the returned value contains an invalid bit pattern for busstate.
sourcepub fn with_busstate(self, new_val: <BusState as Specifier>::InOut) -> Self
pub fn with_busstate(self, new_val: <BusState as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of busstate set to the given value.
#Panics
If the given value is out of bounds for busstate.
sourcepub fn with_busstate_checked(
self,
new_val: <BusState as Specifier>::InOut
) -> Result<Self, OutOfBounds>
pub fn with_busstate_checked(
self,
new_val: <BusState as Specifier>::InOut
) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of busstate set to the given value.
#Errors
If the given value is out of bounds for busstate.
sourcepub fn set_busstate(&mut self, new_val: <BusState as Specifier>::InOut)
pub fn set_busstate(&mut self, new_val: <BusState as Specifier>::InOut)
Sets the value of busstate to the given value.
#Panics
If the given value is out of bounds for busstate.
sourcepub fn set_busstate_checked(
&mut self,
new_val: <BusState as Specifier>::InOut
) -> Result<(), OutOfBounds>
pub fn set_busstate_checked(
&mut self,
new_val: <BusState as Specifier>::InOut
) -> Result<(), OutOfBounds>
Sets the value of busstate to the given value.
#Errors
If the given value is out of bounds for busstate.
sourcepub fn lowtout_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
pub fn lowtout_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of lowtout.
#Errors
If the returned value contains an invalid bit pattern for lowtout.
sourcepub fn with_lowtout(self, new_val: <bool as Specifier>::InOut) -> Self
pub fn with_lowtout(self, new_val: <bool as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of lowtout set to the given value.
#Panics
If the given value is out of bounds for lowtout.
sourcepub fn with_lowtout_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
pub fn with_lowtout_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of lowtout set to the given value.
#Errors
If the given value is out of bounds for lowtout.
sourcepub fn set_lowtout(&mut self, new_val: <bool as Specifier>::InOut)
pub fn set_lowtout(&mut self, new_val: <bool as Specifier>::InOut)
Sets the value of lowtout to the given value.
#Panics
If the given value is out of bounds for lowtout.
sourcepub fn set_lowtout_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
pub fn set_lowtout_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
Sets the value of lowtout to the given value.
#Errors
If the given value is out of bounds for lowtout.
sourcepub fn clkhold_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
pub fn clkhold_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of clkhold.
#Errors
If the returned value contains an invalid bit pattern for clkhold.
sourcepub fn mexttout_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
pub fn mexttout_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of mexttout.
#Errors
If the returned value contains an invalid bit pattern for mexttout.
sourcepub fn with_mexttout(self, new_val: <bool as Specifier>::InOut) -> Self
pub fn with_mexttout(self, new_val: <bool as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of mexttout set to the given value.
#Panics
If the given value is out of bounds for mexttout.
sourcepub fn with_mexttout_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
pub fn with_mexttout_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of mexttout set to the given value.
#Errors
If the given value is out of bounds for mexttout.
sourcepub fn set_mexttout(&mut self, new_val: <bool as Specifier>::InOut)
pub fn set_mexttout(&mut self, new_val: <bool as Specifier>::InOut)
Sets the value of mexttout to the given value.
#Panics
If the given value is out of bounds for mexttout.
sourcepub fn set_mexttout_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
pub fn set_mexttout_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
Sets the value of mexttout to the given value.
#Errors
If the given value is out of bounds for mexttout.
sourcepub fn sexttout_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
pub fn sexttout_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of sexttout.
#Errors
If the returned value contains an invalid bit pattern for sexttout.
sourcepub fn with_sexttout(self, new_val: <bool as Specifier>::InOut) -> Self
pub fn with_sexttout(self, new_val: <bool as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of sexttout set to the given value.
#Panics
If the given value is out of bounds for sexttout.
sourcepub fn with_sexttout_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
pub fn with_sexttout_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of sexttout set to the given value.
#Errors
If the given value is out of bounds for sexttout.
sourcepub fn set_sexttout(&mut self, new_val: <bool as Specifier>::InOut)
pub fn set_sexttout(&mut self, new_val: <bool as Specifier>::InOut)
Sets the value of sexttout to the given value.
#Panics
If the given value is out of bounds for sexttout.
sourcepub fn set_sexttout_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
pub fn set_sexttout_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
Sets the value of sexttout to the given value.
#Errors
If the given value is out of bounds for sexttout.
sourcepub fn lenerr_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
pub fn lenerr_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of lenerr.
#Errors
If the returned value contains an invalid bit pattern for lenerr.
sourcepub fn with_lenerr(self, new_val: <bool as Specifier>::InOut) -> Self
pub fn with_lenerr(self, new_val: <bool as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of lenerr set to the given value.
#Panics
If the given value is out of bounds for lenerr.
sourcepub fn with_lenerr_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
pub fn with_lenerr_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of lenerr set to the given value.
#Errors
If the given value is out of bounds for lenerr.
sourcepub fn set_lenerr(&mut self, new_val: <bool as Specifier>::InOut)
pub fn set_lenerr(&mut self, new_val: <bool as Specifier>::InOut)
Sets the value of lenerr to the given value.
#Panics
If the given value is out of bounds for lenerr.
sourcepub fn set_lenerr_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
pub fn set_lenerr_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
Sets the value of lenerr to the given value.
#Errors
If the given value is out of bounds for lenerr.