[−][src]Struct register::Field
Specific section of a register.
Fields
shift: usize
Implementations
impl<T, R> Field<T, R> where
R: RegisterLongName,
T: IntLike,
[src]
R: RegisterLongName,
T: IntLike,
pub fn read(self, val: T) -> T
[src]
pub fn is_set(self, val: T) -> bool
[src]
Check if one or more bits in a field are set
pub fn read_as_enum<E>(self, val: T) -> Option<E> where
E: TryFromValue<T, EnumType = E>,
[src]
E: TryFromValue<T, EnumType = E>,
Read value of the field as an enum member
impl<R> Field<u8, R> where
R: RegisterLongName,
[src]
R: RegisterLongName,
pub const fn new(mask: u8, shift: usize) -> Field<u8, R>
[src]
pub fn val(&self, value: u8) -> FieldValue<u8, R>
[src]
impl<R> Field<u16, R> where
R: RegisterLongName,
[src]
R: RegisterLongName,
pub const fn new(mask: u16, shift: usize) -> Field<u16, R>
[src]
pub fn val(&self, value: u16) -> FieldValue<u16, R>
[src]
impl<R> Field<u32, R> where
R: RegisterLongName,
[src]
R: RegisterLongName,
pub const fn new(mask: u32, shift: usize) -> Field<u32, R>
[src]
pub fn val(&self, value: u32) -> FieldValue<u32, R>
[src]
impl<R> Field<u64, R> where
R: RegisterLongName,
[src]
R: RegisterLongName,
pub const fn new(mask: u64, shift: usize) -> Field<u64, R>
[src]
pub fn val(&self, value: u64) -> FieldValue<u64, R>
[src]
Trait Implementations
impl<T, R> Clone for Field<T, R> where
R: RegisterLongName + Clone,
T: IntLike + Clone,
[src]
R: RegisterLongName + Clone,
T: IntLike + Clone,
pub fn clone(&self) -> Field<T, R>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T, R> Copy for Field<T, R> where
R: RegisterLongName + Copy,
T: IntLike + Copy,
[src]
R: RegisterLongName + Copy,
T: IntLike + Copy,
Auto Trait Implementations
impl<T, R> Send for Field<T, R> where
R: Send,
T: Send,
R: Send,
T: Send,
impl<T, R> Sync for Field<T, R> where
R: Sync,
T: Sync,
R: Sync,
T: Sync,
impl<T, R> Unpin for Field<T, R> where
R: Unpin,
T: Unpin,
R: Unpin,
T: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,