atsamd_hal::sercom::i2c

Struct Status

Source
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§

Source§

impl Status

Source

pub const fn new() -> Self

Returns an instance with zero initialized data.

Source§

impl Status

Source

pub const fn into_bytes(self) -> [u8; 2]

Returns the underlying bits.

§Layout

The returned byte array is layed out in the same way as described here.

Source

pub const fn from_bytes(bytes: [u8; 2]) -> Self

Converts the given bytes directly into the bitfield struct.

Source§

impl Status

Source

pub fn buserr(&self) -> <bool as Specifier>::InOut

Returns the value of buserr.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn arblost(&self) -> <bool as Specifier>::InOut

Returns the value of arblost.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn rxnack(&self) -> <bool as Specifier>::InOut

Returns the value of rxnack.

Source

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.

Source

pub fn busstate(&self) -> <BusState as Specifier>::InOut

Returns the value of busstate.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn lowtout(&self) -> <bool as Specifier>::InOut

Returns the value of lowtout.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn clkhold(&self) -> <bool as Specifier>::InOut

Returns the value of clkhold.

Source

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.

Source

pub fn mexttout(&self) -> <bool as Specifier>::InOut

Returns the value of mexttout.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn sexttout(&self) -> <bool as Specifier>::InOut

Returns the value of sexttout.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn lenerr(&self) -> <bool as Specifier>::InOut

Returns the value of lenerr.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source§

impl Status

Source

pub fn check_bus_error(self) -> Result<(), Error>

Check whether Self originates from an error.

§Errors

Returns an error if STATUS contains:

  • BUSERR - Bus Error
  • ARBLOST - Arbitration lost
  • LENERR - Length error
  • RXNACK - Receive not acknowledged
Source

pub fn is_idle(self) -> bool

Trait Implementations§

Source§

impl CheckTotalSizeMultipleOf8 for Status

Source§

type Size = TotalSize<[(); 0]>

Source§

impl Default for Status

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<Status> for u16
where [(); 16]: IsU16Compatible,

Source§

fn from(__bf_bitfield: Status) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for Status
where [(); 16]: IsU16Compatible,

Source§

fn from(__bf_prim: u16) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Status

§

impl RefUnwindSafe for Status

§

impl Send for Status

§

impl Sync for Status

§

impl Unpin for Status

§

impl UnwindSafe for Status

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.