Trait drone_core::reg::prelude::RegVal [] [src]

pub trait RegVal: Sized + Clone + Copy {
    type Raw: RegRaw;

    const DEFAULT: Self::Raw;

    unsafe fn from_raw(raw: Self::Raw) -> Self;
fn raw(&self) -> Self::Raw;
fn raw_mut(&mut self) -> &mut Self::Raw; unsafe fn default() -> Self { ... }
unsafe fn read_bit(&self, offset: Self::Raw) -> bool { ... }
unsafe fn set_bit(&mut self, offset: Self::Raw) { ... }
unsafe fn clear_bit(&mut self, offset: Self::Raw) { ... }
unsafe fn toggle_bit(&mut self, offset: Self::Raw) { ... }
unsafe fn read_bits(&self, offset: Self::Raw, width: Self::Raw) -> Self::Raw { ... }
unsafe fn write_bits(
        &mut self,
        offset: Self::Raw,
        width: Self::Raw,
        bits: Self::Raw
    ) { ... } }

Wrapper for a register value.

Associated Types

Raw integer type.

Associated Constants

A reset value for the register.

Required Methods

Creates a new RegVal from the raw value.

Returns the inner integer.

Returns a mutable reference to the inner integer.

Provided Methods

Creates a new RegVal from the reset value.

Reads the state of the bit at offset.

Safety

offset must be less than the size of Raw in bits.

Sets the bit at offset.

Safety

offset must be less than the size of Raw in bits.

Clears the bit at offset.

Safety

offset must be less than the size of Raw in bits.

Toggles the bit at offset.

Safety

offset must be less than the size of Raw in bits.

Reads width number of low order bits at the offset position.

Safety

  • offset must be less than the size of Raw in bits.
  • width + offset must be less than or equal to the size of Raw in bits.

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

Safety

  • offset must be less than the size of Raw in bits.
  • width + offset must be less than or equal to the size of Raw in bits.

Implementors