#[non_exhaustive]
pub struct RegisterInfo { pub name: String, pub display_name: Option<String>, pub description: Option<String>, pub alternate_group: Option<String>, pub alternate_register: Option<String>, pub address_offset: u32, pub properties: RegisterProperties, pub modified_write_values: Option<ModifiedWriteValues>, pub write_constraint: Option<WriteConstraint>, pub read_action: Option<ReadAction>, pub fields: Option<Vec<Field>>, pub derived_from: Option<String>, }
Expand description

A register is a named, programmable resource that belongs to a peripheral.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

String to identify the register. Register names are required to be unique within the scope of a peripheral

§display_name: Option<String>

Specifies a register name without the restrictions of an ANSI C identifier.

§description: Option<String>

String describing the details of the register

§alternate_group: Option<String>

Specifies a group name associated with all alternate register that have the same name

§alternate_register: Option<String>

This tag can reference a register that has been defined above to current location in the description and that describes the memory location already

§address_offset: u32

Define the address offset relative to the enclosing element

§properties: RegisterProperties

Specifies register size, access permission and reset value

§modified_write_values: Option<ModifiedWriteValues>

Specifies the write side effects

§write_constraint: Option<WriteConstraint>

Specifies the subset of allowed write values

§read_action: Option<ReadAction>

If set, it specifies the side effect following a read operation. If not set, the register is not modified

§fields: Option<Vec<Field>>

None indicates that the <fields> node is not present

§derived_from: Option<String>

Specify the register name from which to inherit data. Elements specified subsequently override inherited values

Implementations§

source§

impl RegisterInfo

source

pub fn builder() -> RegisterInfoBuilder

Make a builder for RegisterInfo

source

pub const fn single(self) -> Register

Construct single Register

source

pub const fn array(self, dim: DimElement) -> Register

Construct Register array

source

pub fn modify_from( &mut self, builder: RegisterInfoBuilder, lvl: ValidateLevel ) -> Result<(), SvdError>

Modify an existing RegisterInfo based on a builder.

source

pub fn validate(&self, lvl: ValidateLevel) -> Result<(), SvdError>

Validate the RegisterInfo

source

pub fn validate_all(&self, lvl: ValidateLevel) -> Result<(), SvdError>

Validate the RegisterInfo recursively

source

pub fn fields(&self) -> Iter<'_, Field>

Returns iterator over child fields

source

pub fn fields_mut(&mut self) -> IterMut<'_, Field>

Returns mutable iterator over child fields

source

pub fn get_field(&self, name: &str) -> Option<&Field>

Get field by name

source

pub fn get_mut_field(&mut self, name: &str) -> Option<&mut Field>

Get mutable field by name

Trait Implementations§

source§

impl Clone for RegisterInfo

source§

fn clone(&self) -> RegisterInfo

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for RegisterInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Description for RegisterInfo

source§

fn description(&self) -> Option<&str>

Get description
source§

impl From<RegisterInfo> for RegisterInfoBuilder

source§

fn from(r: RegisterInfo) -> Self

Converts to this type from the input type.
source§

impl Name for RegisterInfo

source§

fn name(&self) -> &str

Get name
source§

impl PartialEq for RegisterInfo

source§

fn eq(&self, other: &RegisterInfo) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for RegisterInfo

source§

impl StructuralEq for RegisterInfo

source§

impl StructuralPartialEq for RegisterInfo

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> 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.