RegisterFieldValue

Struct RegisterFieldValue 

Source
pub struct RegisterFieldValue<T: RegisterType> { /* private fields */ }
Expand description

Definition of a specific fieldvalue of a regiser. This structure allows to combine field values with bit operators like | and & to build the final value that should be written to a register

Implementations§

Source§

impl RegisterFieldValue<u8>

Source

pub const fn new(field: RegisterField<u8>, value: u8) -> Self

Create a new fieldvalue based on the field definition and the value given

Source

pub const fn from_raw(field: RegisterField<u8>, raw_value: u8) -> Self

Create a new fieldvalue based on the field definition and the raw value given

Source

pub fn value(&self) -> u8

Retrieve the register field value

Source

pub fn raw_value(&self) -> u8

Retrieve the register field raw value, means the value is returned in it’s position as it appears in the register when read with the field mask applied but not shifted

Source

pub fn mask(&self) -> u8

Retrieve the field mask used with this register field. The mask is shifted to it’s corresponding field position

Source§

impl RegisterFieldValue<u16>

Source

pub const fn new(field: RegisterField<u16>, value: u16) -> Self

Create a new fieldvalue based on the field definition and the value given

Source

pub const fn from_raw(field: RegisterField<u16>, raw_value: u16) -> Self

Create a new fieldvalue based on the field definition and the raw value given

Source

pub fn value(&self) -> u16

Retrieve the register field value

Source

pub fn raw_value(&self) -> u16

Retrieve the register field raw value, means the value is returned in it’s position as it appears in the register when read with the field mask applied but not shifted

Source

pub fn mask(&self) -> u16

Retrieve the field mask used with this register field. The mask is shifted to it’s corresponding field position

Source§

impl RegisterFieldValue<u32>

Source

pub const fn new(field: RegisterField<u32>, value: u32) -> Self

Create a new fieldvalue based on the field definition and the value given

Source

pub const fn from_raw(field: RegisterField<u32>, raw_value: u32) -> Self

Create a new fieldvalue based on the field definition and the raw value given

Source

pub fn value(&self) -> u32

Retrieve the register field value

Source

pub fn raw_value(&self) -> u32

Retrieve the register field raw value, means the value is returned in it’s position as it appears in the register when read with the field mask applied but not shifted

Source

pub fn mask(&self) -> u32

Retrieve the field mask used with this register field. The mask is shifted to it’s corresponding field position

Source§

impl RegisterFieldValue<u64>

Source

pub const fn new(field: RegisterField<u64>, value: u64) -> Self

Create a new fieldvalue based on the field definition and the value given

Source

pub const fn from_raw(field: RegisterField<u64>, raw_value: u64) -> Self

Create a new fieldvalue based on the field definition and the raw value given

Source

pub fn value(&self) -> u64

Retrieve the register field value

Source

pub fn raw_value(&self) -> u64

Retrieve the register field raw value, means the value is returned in it’s position as it appears in the register when read with the field mask applied but not shifted

Source

pub fn mask(&self) -> u64

Retrieve the field mask used with this register field. The mask is shifted to it’s corresponding field position

Trait Implementations§

Source§

impl BitAnd for RegisterFieldValue<u16>

Source§

type Output = RegisterFieldValue<u16>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: RegisterFieldValue<u16>) -> Self

Performs the & operation. Read more
Source§

impl BitAnd for RegisterFieldValue<u32>

Source§

type Output = RegisterFieldValue<u32>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: RegisterFieldValue<u32>) -> Self

Performs the & operation. Read more
Source§

impl BitAnd for RegisterFieldValue<u64>

Source§

type Output = RegisterFieldValue<u64>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: RegisterFieldValue<u64>) -> Self

Performs the & operation. Read more
Source§

impl BitAnd for RegisterFieldValue<u8>

Source§

type Output = RegisterFieldValue<u8>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: RegisterFieldValue<u8>) -> Self

Performs the & operation. Read more
Source§

impl BitOr for RegisterFieldValue<u16>

Source§

type Output = RegisterFieldValue<u16>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: RegisterFieldValue<u16>) -> Self

Performs the | operation. Read more
Source§

impl BitOr for RegisterFieldValue<u32>

Source§

type Output = RegisterFieldValue<u32>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: RegisterFieldValue<u32>) -> Self

Performs the | operation. Read more
Source§

impl BitOr for RegisterFieldValue<u64>

Source§

type Output = RegisterFieldValue<u64>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: RegisterFieldValue<u64>) -> Self

Performs the | operation. Read more
Source§

impl BitOr for RegisterFieldValue<u8>

Source§

type Output = RegisterFieldValue<u8>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: RegisterFieldValue<u8>) -> Self

Performs the | operation. Read more
Source§

impl<T: Clone + RegisterType> Clone for RegisterFieldValue<T>

Source§

fn clone(&self) -> RegisterFieldValue<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RegisterFieldValue<u16>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Debug for RegisterFieldValue<u32>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Debug for RegisterFieldValue<u64>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Debug for RegisterFieldValue<u8>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for RegisterFieldValue<u16>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for RegisterFieldValue<u32>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for RegisterFieldValue<u64>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for RegisterFieldValue<u8>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Copy + RegisterType> Copy for RegisterFieldValue<T>

Auto Trait Implementations§

§

impl<T> Freeze for RegisterFieldValue<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for RegisterFieldValue<T>
where T: RefUnwindSafe,

§

impl<T> Send for RegisterFieldValue<T>
where T: Send,

§

impl<T> Sync for RegisterFieldValue<T>
where T: Sync,

§

impl<T> Unpin for RegisterFieldValue<T>
where T: Unpin,

§

impl<T> UnwindSafe for RegisterFieldValue<T>
where T: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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>,

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.