Trait drone::reg::RegValue [] [src]

pub trait RegValue where
    Self: Sized + Default
{ type Raw: RegRaw; fn new(value: Self::Raw) -> Self;
fn raw(&self) -> Self::Raw;
fn raw_mut(&mut self) -> &mut Self::Raw; fn bit(&self, offset: Self::Raw) -> bool { ... }
fn set_bit(&mut self, offset: Self::Raw, value: bool) -> &mut Self { ... }
fn bits(&self, offset: Self::Raw, width: Self::Raw) -> Self::Raw { ... }
fn set_bits(
        &mut self,
        offset: Self::Raw,
        width: Self::Raw,
        value: Self::Raw
    ) -> &mut Self { ... } }

Wrapper for a corresponding register's value.

Associated Types

Raw integer type.

Required Methods

Constructs a wrapper from the raw register value.

Returns the raw integer value.

Returns a mutable reference to the raw integer value.

Provided Methods

Checks the set state of the bit of the register's value by offset.

Panics

If offset is greater than or equals to the platform's word size in bits.

Sets or clears the bit of the register's value by offset.

Panics

If offset is greater than or equals to the platform's word size in bits.

Reads the width number of low order bits at the offset position from the raw interger value.

Panics

  • If offset is greater than or equals to the platform's word size in bits.
  • If width + offset is greater than the platform's word size in bits.

Copies the width number of low order bits from the value into the same number of adjacent bits at the offset position at the raw integer value.

Panics

  • If offset is greater than or equals to the platform's word size in bits.
  • If width + offset is greater than the platform's word size in bits.
  • If value contains bits outside the width range.

Implementors