Struct svd_rs::register::RegisterInfo
source · #[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
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
impl RegisterInfo
sourcepub fn builder() -> RegisterInfoBuilder
pub fn builder() -> RegisterInfoBuilder
Make a builder for RegisterInfo
sourcepub const fn array(self, dim: DimElement) -> Register
pub const fn array(self, dim: DimElement) -> Register
Construct Register
array
sourcepub fn maybe_array(self, dim: Option<DimElement>) -> Register
pub fn maybe_array(self, dim: Option<DimElement>) -> Register
Construct single Register
or array
sourcepub fn modify_from(
&mut self,
builder: RegisterInfoBuilder,
lvl: ValidateLevel
) -> Result<(), SvdError>
pub fn modify_from( &mut self, builder: RegisterInfoBuilder, lvl: ValidateLevel ) -> Result<(), SvdError>
Modify an existing RegisterInfo
based on a builder.
sourcepub fn validate(&self, lvl: ValidateLevel) -> Result<(), SvdError>
pub fn validate(&self, lvl: ValidateLevel) -> Result<(), SvdError>
Validate the RegisterInfo
sourcepub fn validate_all(&self, lvl: ValidateLevel) -> Result<(), SvdError>
pub fn validate_all(&self, lvl: ValidateLevel) -> Result<(), SvdError>
Validate the RegisterInfo
recursively
sourcepub fn fields_mut(&mut self) -> IterMut<'_, Field>
pub fn fields_mut(&mut self) -> IterMut<'_, Field>
Returns mutable iterator over child fields
sourcepub fn get_mut_field(&mut self, name: &str) -> Option<&mut Field>
pub fn get_mut_field(&mut self, name: &str) -> Option<&mut Field>
Get mutable field by name
Trait Implementations§
source§impl Clone for RegisterInfo
impl Clone for RegisterInfo
source§fn clone(&self) -> RegisterInfo
fn clone(&self) -> RegisterInfo
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RegisterInfo
impl Debug for RegisterInfo
source§impl Description for RegisterInfo
impl Description for RegisterInfo
source§fn description(&self) -> Option<&str>
fn description(&self) -> Option<&str>
source§impl From<RegisterInfo> for RegisterInfoBuilder
impl From<RegisterInfo> for RegisterInfoBuilder
source§fn from(r: RegisterInfo) -> Self
fn from(r: RegisterInfo) -> Self
source§impl PartialEq for RegisterInfo
impl PartialEq for RegisterInfo
source§fn eq(&self, other: &RegisterInfo) -> bool
fn eq(&self, other: &RegisterInfo) -> bool
self
and other
values to be equal, and is used
by ==
.