Struct ReadWriteRegWrapper

Source
pub struct ReadWriteRegWrapper<'a, T, N, R>(/* private fields */)
where
    T: UIntLike,
    N: RegisterLongName,
    R: BaseReadableRegister<T> + BaseWriteableRegister<T>;
Expand description

Workaround-wrapper for read- and writable LiteX registers

This workaround-wrapper is required to make an associated type of LiteXSoCRegisterConfiguration generic over the RegisterLongName until generic associated types stabilize in Rust. Please see the LiteXSoCRegisterConfiguration documentation for more information.

Implementations§

Source§

impl<'a, T, N, R> ReadWriteRegWrapper<'a, T, N, R>

Source

pub fn wrap(reg: &'a R) -> ReadWriteRegWrapper<'a, T, N, R>

Trait Implementations§

Source§

impl<T, N, R> BaseReadableRegister<T> for ReadWriteRegWrapper<'_, T, N, R>

Source§

const REG_WIDTH: usize

Source§

type Reg = N

Source§

fn base_get(&self) -> T

Get the raw register value
Source§

impl<T, N, R> BaseWriteableRegister<T> for ReadWriteRegWrapper<'_, T, N, R>

Source§

const REG_WIDTH: usize

Source§

type Reg = N

Source§

fn base_set(&self, value: T)

Set the raw register value

Auto Trait Implementations§

§

impl<'a, T, N, R> Freeze for ReadWriteRegWrapper<'a, T, N, R>

§

impl<'a, T, N, R> RefUnwindSafe for ReadWriteRegWrapper<'a, T, N, R>

§

impl<'a, T, N, R> Send for ReadWriteRegWrapper<'a, T, N, R>
where R: Sync, T: Send, N: Send,

§

impl<'a, T, N, R> Sync for ReadWriteRegWrapper<'a, T, N, R>
where R: Sync, T: Sync, N: Sync,

§

impl<'a, T, N, R> Unpin for ReadWriteRegWrapper<'a, T, N, R>
where T: Unpin, N: Unpin,

§

impl<'a, T, N, R> UnwindSafe for ReadWriteRegWrapper<'a, T, N, R>

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> 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<R, T> Read<T> for R

Source§

const REG_WIDTH: usize = R::REG_WIDTH

Source§

type Reg = <R as BaseReadableRegister<T>>::Reg

Source§

fn get(&self) -> T

Get the raw register value
Source§

fn read(&self, field: Field<T, <R as Read<T>>::Reg>) -> T

Read the value of the given field
Source§

fn read_as_enum<E>(&self, field: Field<T, <R as Read<T>>::Reg>) -> Option<E>
where E: TryFromValue<T, EnumType = E>,

Read value of the given field as an enum member
Source§

fn extract(&self) -> LocalRegisterCopy<T, <R as Read<T>>::Reg>

Make a local copy of the register
Source§

fn is_set(&self, field: Field<T, <R as Read<T>>::Reg>) -> bool

Check if one or more bits in a field are set
Source§

fn any_matching_bits_set( &self, field: FieldValue<T, <R as Read<T>>::Reg>, ) -> bool

Check if any specified parts of a field match
Source§

fn matches_all(&self, field: FieldValue<T, <R as Read<T>>::Reg>) -> bool

Check if all specified parts of a field match
Source§

impl<R, T> ReadWrite<T> for R
where T: UIntLike, R: Read<T> + Write<T>,

Source§

const REG_WIDTH: usize

Source§

fn modify(&self, field: FieldValue<T, <R as Read<T>>::Reg>)

Write the value of one or more fields, leaving the other fields unchanged
Source§

fn modify_no_read( &self, original: LocalRegisterCopy<T, <R as Read<T>>::Reg>, field: FieldValue<T, <R as Read<T>>::Reg>, )

Write the value of one or more fields, maintaining the value of unchanged fields via a provided original value, rather than a register read.
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.
Source§

impl<R, T> Write<T> for R

Source§

const REG_WIDTH: usize = R::REG_WIDTH

Source§

type Reg = <R as BaseWriteableRegister<T>>::Reg

Source§

fn set(&self, value: T)

Set the raw register value
Source§

fn write(&self, field: FieldValue<T, <R as Write<T>>::Reg>)

Write the value of one or more fields, overwriting the other fields with zero