Struct tock_registers::registers::Aliased

source ·
pub struct Aliased<T: UIntLike, R: RegisterLongName = (), W: RegisterLongName = ()> { /* private fields */ }
Expand description

Read-only and write-only registers aliased to the same address.

Unlike the ReadWrite register, this represents a register which has different meanings based on if it is written or read. This might be found on a device where control and status registers are accessed via the same memory address via writes and reads, respectively.

This register implements Readable and Writeable, but in general does not implement ReadWriteable (only if the type parameters R and W are identical, in which case a ReadWrite register might be a better choice).

Trait Implementations§

source§

impl<T: UIntLike, R: RegisterLongName, W: RegisterLongName> Readable for Aliased<T, R, W>

source§

type T = T

source§

type R = R

source§

fn get(&self) -> Self::T

Get the raw register value
source§

fn read(&self, field: Field<Self::T, Self::R>) -> Self::T

Read the value of the given field
source§

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

Set the raw register value Read more
source§

fn extract(&self) -> LocalRegisterCopy<Self::T, Self::R>

Make a local copy of the register
source§

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

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

fn matches_any(&self, field: FieldValue<Self::T, Self::R>) -> bool

Check if any specified parts of a field match
source§

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

Check if all specified parts of a field match
source§

impl<T: UIntLike, R: RegisterLongName, W: RegisterLongName> Writeable for Aliased<T, R, W>

source§

type T = T

source§

type R = W

source§

fn set(&self, value: Self::T)

Set the raw register value
source§

fn write(&self, field: FieldValue<Self::T, Self::R>)

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

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

Write the value of one or more fields, maintaining the value of unchanged fields via a provided original value, rather than a register read.

Auto Trait Implementations§

§

impl<T, R = (), W = ()> !Freeze for Aliased<T, R, W>

§

impl<T, R = (), W = ()> !RefUnwindSafe for Aliased<T, R, W>

§

impl<T, R, W> Send for Aliased<T, R, W>
where T: Send, R: Send, W: Send,

§

impl<T, R = (), W = ()> !Sync for Aliased<T, R, W>

§

impl<T, R, W> Unpin for Aliased<T, R, W>
where T: Unpin, R: Unpin, W: Unpin,

§

impl<T, R, W> UnwindSafe for Aliased<T, R, W>
where T: UnwindSafe, R: UnwindSafe, W: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

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, R, S> ReadWriteable for S
where R: RegisterLongName, S: Readable<T = T, R = R> + Writeable<T = T, R = R>, T: UIntLike,

source§

type T = T

source§

type R = R

source§

fn modify( &self, field: FieldValue<<S as ReadWriteable>::T, <S as ReadWriteable>::R>, )

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.