Skip to main content

Registers

Struct Registers 

Source
pub struct Registers { /* private fields */ }
Expand description

The register window the kernel granted this driver. Copy it freely: it is a view of the one window, and every copy reaches the same registers.

Implementations§

Source§

impl Registers

Source

pub fn len(&self) -> usize

The window’s length in bytes: the last register is below it.

Source

pub fn read8(&self, off: usize) -> u8

Read the 8-bit register at off bytes into the window.

Source

pub fn read16(&self, off: usize) -> u16

Read the 16-bit register at off, which must be 2-byte aligned.

Source

pub fn read32(&self, off: usize) -> u32

Read the 32-bit register at off, which must be 4-byte aligned.

Source

pub fn read64(&self, off: usize) -> u64

Read the 64-bit register at off, which must be 8-byte aligned.

Source

pub fn write8(&self, off: usize, val: u8)

Write the 8-bit register at off.

Source

pub fn write16(&self, off: usize, val: u16)

Write the 16-bit register at off, which must be 2-byte aligned.

Source

pub fn write32(&self, off: usize, val: u32)

Write the 32-bit register at off, which must be 4-byte aligned.

Source

pub fn write64(&self, off: usize, val: u64)

Write the 64-bit register at off, which must be 8-byte aligned.

Trait Implementations§

Source§

impl Clone for Registers

Source§

fn clone(&self) -> Registers

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for Registers

Auto Trait Implementations§

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.