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
sourceimpl 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 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(&mut self, lvl: ValidateLevel) -> Result<(), SvdError>
pub fn validate(&mut self, lvl: ValidateLevel) -> Result<(), SvdError>
Validate the RegisterInfo
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
sourceimpl Clone for RegisterInfo
impl Clone for RegisterInfo
sourcefn clone(&self) -> RegisterInfo
fn clone(&self) -> RegisterInfo
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RegisterInfo
impl Debug for RegisterInfo
sourceimpl From<RegisterInfo> for RegisterInfoBuilder
impl From<RegisterInfo> for RegisterInfoBuilder
sourcefn from(r: RegisterInfo) -> Self
fn from(r: RegisterInfo) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<RegisterInfo> for RegisterInfo
impl PartialEq<RegisterInfo> for RegisterInfo
sourcefn eq(&self, other: &RegisterInfo) -> bool
fn eq(&self, other: &RegisterInfo) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &RegisterInfo) -> bool
fn ne(&self, other: &RegisterInfo) -> bool
This method tests for !=
.
impl StructuralPartialEq for RegisterInfo
Auto Trait Implementations
impl RefUnwindSafe for RegisterInfo
impl Send for RegisterInfo
impl Sync for RegisterInfo
impl Unpin for RegisterInfo
impl UnwindSafe for RegisterInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more