pub struct RegisterFieldBool<const START_OFFSET: usize, const DIM: u8, const DIM_INCREMENT: u8, T, A>where
T: RegSpec,
A: Access,{ /* private fields */ }Expand description
Proxy struct for boolean bitfields
Implementations§
Source§impl<const START_OFFSET: usize, const DIM: u8, const DIM_INCREMENT: u8, T, A> RegisterFieldBool<START_OFFSET, DIM, DIM_INCREMENT, T, A>where
T: RegSpec,
A: Read,
impl<const START_OFFSET: usize, const DIM: u8, const DIM_INCREMENT: u8, T, A> RegisterFieldBool<START_OFFSET, DIM, DIM_INCREMENT, T, A>where
T: RegSpec,
A: Read,
Source§impl<const START_OFFSET: usize, const DIM: u8, const DIM_INCREMENT: u8, T, A> RegisterFieldBool<START_OFFSET, DIM, DIM_INCREMENT, T, A>where
T: RegSpec,
A: Write,
impl<const START_OFFSET: usize, const DIM: u8, const DIM_INCREMENT: u8, T, A> RegisterFieldBool<START_OFFSET, DIM, DIM_INCREMENT, T, A>where
T: RegSpec,
A: Write,
Sourcepub fn set(self, value: bool) -> RegValueT<T>
pub fn set(self, value: bool) -> RegValueT<T>
Prepare bitfield value to be written to register
§Example
ⓘ
// example with generic names
// get an instance by reading
let values = TIMER.bitfield_reg().read();
// or by starting with a known value
let value = timer::BitfieldReg::new(0);
// or by starting with the default
let value = timer::BitfieldReg::default();
// set bitfield
let value = value
.boolrw()
.set(true);
// up until now no hardware change has taken place, do that now by writing
TIMER.bitfield_reg().write(value);Source§impl<const START_OFFSET: usize, const DIM: u8, const DIM_INCREMENT: u8, T, A> RegisterFieldBool<START_OFFSET, DIM, DIM_INCREMENT, T, A>where
T: RegSpec,
A: Access,
impl<const START_OFFSET: usize, const DIM: u8, const DIM_INCREMENT: u8, T, A> RegisterFieldBool<START_OFFSET, DIM, DIM_INCREMENT, T, A>where
T: RegSpec,
A: Access,
Sourcepub fn mask(&self) -> T::DataType
pub fn mask(&self) -> T::DataType
Get mask for bitfield, the mask is unshifted and at offset 0
Prefer the use of RegisterField<START_OFFSET, MASK, DIM, DIM_INCREMENT, ValueType, T, A>::get() to
extract a bitfield value.
Sourcepub const fn offset(&self) -> usize
pub const fn offset(&self) -> usize
Get offset of bitfield in containing register
Prefer the use of RegisterField<START_OFFSET, MASK, DIM, DIM_INCREMENT, ValueType, T, A>::get() to
extract a bitfield value.
Auto Trait Implementations§
impl<const START_OFFSET: usize, const DIM: u8, const DIM_INCREMENT: u8, T, A> Freeze for RegisterFieldBool<START_OFFSET, DIM, DIM_INCREMENT, T, A>where
<T as RegSpec>::DataType: Freeze,
impl<const START_OFFSET: usize, const DIM: u8, const DIM_INCREMENT: u8, T, A> RefUnwindSafe for RegisterFieldBool<START_OFFSET, DIM, DIM_INCREMENT, T, A>where
<T as RegSpec>::DataType: RefUnwindSafe,
A: RefUnwindSafe,
impl<const START_OFFSET: usize, const DIM: u8, const DIM_INCREMENT: u8, T, A> Send for RegisterFieldBool<START_OFFSET, DIM, DIM_INCREMENT, T, A>
impl<const START_OFFSET: usize, const DIM: u8, const DIM_INCREMENT: u8, T, A> Sync for RegisterFieldBool<START_OFFSET, DIM, DIM_INCREMENT, T, A>
impl<const START_OFFSET: usize, const DIM: u8, const DIM_INCREMENT: u8, T, A> Unpin for RegisterFieldBool<START_OFFSET, DIM, DIM_INCREMENT, T, A>
impl<const START_OFFSET: usize, const DIM: u8, const DIM_INCREMENT: u8, T, A> UnwindSafe for RegisterFieldBool<START_OFFSET, DIM, DIM_INCREMENT, T, A>where
<T as RegSpec>::DataType: UnwindSafe,
A: UnwindSafe,
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