Struct avr_oxide::util::datatypes::VolatileBitField

source ·
#[repr(C)]
pub struct VolatileBitField(/* private fields */);
Expand description

Helper newtype for a Bitfield that representas a volatile underlying field (I/O register or similar).

Implementations§

source§

impl VolatileBitField

source

pub const fn all_clr() -> Self

source

pub const fn all_set() -> Self

source

pub fn snapshot(&self) -> BitField

Return a copy of the underlying volatile value as a non-volatile, copyable-and-clonable BitField.

Trait Implementations§

source§

impl BitFieldAccess for VolatileBitField

source§

fn read_byte(&self) -> u8

source§

fn write_byte(&mut self, val: u8)

source§

fn set_isolated<B: BitMaskable>(&mut self, _isotoken: Isolated, bits: B)

Set the bit(s) at the given index/range
source§

fn set<B: BitMaskable + Copy>(&mut self, bits: B)

Set the bit(s) at the given index/range
source§

fn clr_isolated<B: BitMaskable + Copy>(&mut self, _isotoken: Isolated, bits: B)

Clear the bit(s) at the given index/range
source§

fn clr<B: BitMaskable + Copy>(&mut self, bits: B)

Clear the bit at the given index
source§

fn set_or_clr<B: BitMaskable + Copy>(&mut self, bits: B, set: bool)

Set or clear the bit(s) at the given index/range depending on the set parameter (true = set the bit, false = clear it.)
source§

fn set_to<B: BitMaskable + Copy>(&mut self, bits: B, value: u8)

Set the bit(s) at the given index/range to the bitwise value given.
source§

fn set_to_isolated<B: BitMaskable + Copy>( &mut self, _isotoken: Isolated, bits: B, value: u8 )

Set the bit(s) at the given index/range to the bitwise value given.
source§

fn is_set(&self, bit: BitIndex) -> bool

True IFF the bit at the given index is set
source§

fn is_all_set<B: BitMaskable + Copy>(&self, bits: B) -> bool

True IFF all the bits at the given index/range are set
source§

fn is_any_set<B: BitMaskable + Copy>(&self, bits: B) -> bool

True IFF any of the bits at the given index/range are set
source§

fn is_all_clr<B: BitMaskable + Copy>(&self, bits: B) -> bool

True IFF none of the bits at the given index/range are set
source§

fn is_clr(&self, bit: BitIndex) -> bool

True IFF the bit at the given index is clear
source§

fn set_all(&mut self)

Set all bits of the bitmask to 1
source§

fn clr_all(&mut self)

Set all bits of the bitmask to 0
source§

fn exc_set<B: BitMaskable + Copy>(&mut self, bits: B)

Set the bit(s) at the given index/range and clear all others
source§

fn exc_clr<B: BitMaskable + Copy>(&mut self, bits: B)

Clear the bit at the given index and set all others
source§

fn get_val<B: BitMaskable + Copy>(&self, bits: B) -> u8

Return the bit(s) at the given index/range as a binary value.
source§

impl PartialEq for VolatileBitField

source§

fn eq(&self, other: &VolatileBitField) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for VolatileBitField

Auto Trait Implementations§

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.