Struct svd_rs::peripheral::PeripheralInfo
source · [−]#[non_exhaustive]pub struct PeripheralInfo {Show 15 fields
pub name: String,
pub display_name: Option<String>,
pub version: Option<String>,
pub description: Option<String>,
pub alternate_peripheral: Option<String>,
pub group_name: Option<String>,
pub prepend_to_name: Option<String>,
pub append_to_name: Option<String>,
pub header_struct_name: Option<String>,
pub base_address: u64,
pub default_register_properties: RegisterProperties,
pub address_block: Option<Vec<AddressBlock>>,
pub interrupt: Vec<Interrupt>,
pub registers: Option<Vec<RegisterCluster>>,
pub derived_from: Option<String>,
}Expand description
A description of a peripheral in the device, describing, for example, the memory mappings.
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: StringThe string identifies the peripheral. Peripheral names are required to be unique for a device
display_name: Option<String>Specifies a register name without the restrictions of an ANSI C identifier.
version: Option<String>The string specifies the version of this peripheral description
description: Option<String>The string provides an overview of the purpose and functionality of the peripheral
alternate_peripheral: Option<String>Specifies peripheral assigned to the same address blocks
group_name: Option<String>Assigns this peripheral to a group of peripherals. This is only used bye the System View
prepend_to_name: Option<String>Define a string as prefix. All register names of this peripheral get this prefix
append_to_name: Option<String>Define a string as suffix. All register names of this peripheral get this suffix
header_struct_name: Option<String>Specify the struct type name created in the device header file
base_address: u64Lowest address reserved or used by the peripheral
default_register_properties: RegisterPropertiesDefault properties for all registers
address_block: Option<Vec<AddressBlock>>Specify an address range uniquely mapped to this peripheral
interrupt: Vec<Interrupt>A peripheral can have multiple associated interrupts
registers: Option<Vec<RegisterCluster>>Group to enclose register definitions.
None indicates that the <registers> node is not present
derived_from: Option<String>Specify the peripheral name from which to inherit data. Elements specified subsequently override inherited values
Implementations
sourceimpl PeripheralInfo
impl PeripheralInfo
sourcepub fn builder() -> PeripheralInfoBuilder
pub fn builder() -> PeripheralInfoBuilder
Make a builder for PeripheralInfo
sourcepub const fn single(self) -> Peripheral
pub const fn single(self) -> Peripheral
Construct single Peripheral
sourcepub const fn array(self, dim: DimElement) -> Peripheral
pub const fn array(self, dim: DimElement) -> Peripheral
Construct Peripheral array
sourcepub fn modify_from(
&mut self,
builder: PeripheralInfoBuilder,
lvl: ValidateLevel
) -> Result<(), SvdError>
pub fn modify_from(
&mut self,
builder: PeripheralInfoBuilder,
lvl: ValidateLevel
) -> Result<(), SvdError>
Modify an existing Peripheral based on a builder.
sourcepub fn validate(&mut self, lvl: ValidateLevel) -> Result<(), SvdError>
pub fn validate(&mut self, lvl: ValidateLevel) -> Result<(), SvdError>
Validate the Peripheral
sourcepub fn registers(&self) -> RegisterIter<'_>ⓘNotable traits for RegisterIter<'a>impl<'a> Iterator for RegisterIter<'a> type Item = &'a Register;
pub fn registers(&self) -> RegisterIter<'_>ⓘNotable traits for RegisterIter<'a>impl<'a> Iterator for RegisterIter<'a> type Item = &'a Register;
Returns iterator over child registers
sourcepub fn registers_mut(&mut self) -> RegisterIterMut<'_>ⓘNotable traits for RegisterIterMut<'a>impl<'a> Iterator for RegisterIterMut<'a> type Item = &'a mut Register;
pub fn registers_mut(&mut self) -> RegisterIterMut<'_>ⓘNotable traits for RegisterIterMut<'a>impl<'a> Iterator for RegisterIterMut<'a> type Item = &'a mut Register;
Returns mutable iterator over child registers
sourcepub fn clusters(&self) -> ClusterIter<'_>ⓘNotable traits for ClusterIter<'a>impl<'a> Iterator for ClusterIter<'a> type Item = &'a Cluster;
pub fn clusters(&self) -> ClusterIter<'_>ⓘNotable traits for ClusterIter<'a>impl<'a> Iterator for ClusterIter<'a> type Item = &'a Cluster;
Returns iterator over child clusters
sourcepub fn clusters_mut(&mut self) -> ClusterIterMut<'_>ⓘNotable traits for ClusterIterMut<'a>impl<'a> Iterator for ClusterIterMut<'a> type Item = &'a mut Cluster;
pub fn clusters_mut(&mut self) -> ClusterIterMut<'_>ⓘNotable traits for ClusterIterMut<'a>impl<'a> Iterator for ClusterIterMut<'a> type Item = &'a mut Cluster;
Returns mutable iterator over child clusters
sourcepub fn reg_iter(&self) -> AllRegistersIter<'_>ⓘNotable traits for AllRegistersIter<'a>impl<'a> Iterator for AllRegistersIter<'a> type Item = &'a Register;
👎 Deprecated since 0.12.1: Please use all_registers instead
pub fn reg_iter(&self) -> AllRegistersIter<'_>ⓘNotable traits for AllRegistersIter<'a>impl<'a> Iterator for AllRegistersIter<'a> type Item = &'a Register;
Please use all_registers instead
Returns iterator over all descendant registers
sourcepub fn all_registers(&self) -> AllRegistersIter<'_>ⓘNotable traits for AllRegistersIter<'a>impl<'a> Iterator for AllRegistersIter<'a> type Item = &'a Register;
pub fn all_registers(&self) -> AllRegistersIter<'_>ⓘNotable traits for AllRegistersIter<'a>impl<'a> Iterator for AllRegistersIter<'a> type Item = &'a Register;
Returns iterator over all descendant registers
sourcepub fn reg_iter_mut(&mut self) -> AllRegistersIterMut<'_>ⓘNotable traits for AllRegistersIterMut<'a>impl<'a> Iterator for AllRegistersIterMut<'a> type Item = &'a mut Register;
👎 Deprecated since 0.12.1: Please use all_registers_mut instead
pub fn reg_iter_mut(&mut self) -> AllRegistersIterMut<'_>ⓘNotable traits for AllRegistersIterMut<'a>impl<'a> Iterator for AllRegistersIterMut<'a> type Item = &'a mut Register;
Please use all_registers_mut instead
Returns mutable iterator over all descendant registers
sourcepub fn all_registers_mut(&mut self) -> AllRegistersIterMut<'_>ⓘNotable traits for AllRegistersIterMut<'a>impl<'a> Iterator for AllRegistersIterMut<'a> type Item = &'a mut Register;
pub fn all_registers_mut(&mut self) -> AllRegistersIterMut<'_>ⓘNotable traits for AllRegistersIterMut<'a>impl<'a> Iterator for AllRegistersIterMut<'a> type Item = &'a mut Register;
Returns mutable iterator over all descendant registers
sourcepub fn get_register(&self, name: &str) -> Option<&Register>
pub fn get_register(&self, name: &str) -> Option<&Register>
Get register by name
sourcepub fn get_mut_register(&mut self, name: &str) -> Option<&mut Register>
pub fn get_mut_register(&mut self, name: &str) -> Option<&mut Register>
Get mutable register by name
sourcepub fn get_cluster(&self, name: &str) -> Option<&Cluster>
pub fn get_cluster(&self, name: &str) -> Option<&Cluster>
Get cluster by name
sourcepub fn get_mut_cluster(&mut self, name: &str) -> Option<&mut Cluster>
pub fn get_mut_cluster(&mut self, name: &str) -> Option<&mut Cluster>
Get mutable cluster by name
sourcepub fn get_interrupt(&self, name: &str) -> Option<&Interrupt>
pub fn get_interrupt(&self, name: &str) -> Option<&Interrupt>
Get interrupt by name
sourcepub fn get_mut_interrupt(&mut self, name: &str) -> Option<&mut Interrupt>
pub fn get_mut_interrupt(&mut self, name: &str) -> Option<&mut Interrupt>
Get mutable enumeratedValue by name
Trait Implementations
sourceimpl Clone for PeripheralInfo
impl Clone for PeripheralInfo
sourcefn clone(&self) -> PeripheralInfo
fn clone(&self) -> PeripheralInfo
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 PeripheralInfo
impl Debug for PeripheralInfo
sourceimpl From<PeripheralInfo> for PeripheralInfoBuilder
impl From<PeripheralInfo> for PeripheralInfoBuilder
sourcefn from(p: PeripheralInfo) -> Self
fn from(p: PeripheralInfo) -> Self
Performs the conversion.
sourceimpl PartialEq<PeripheralInfo> for PeripheralInfo
impl PartialEq<PeripheralInfo> for PeripheralInfo
sourcefn eq(&self, other: &PeripheralInfo) -> bool
fn eq(&self, other: &PeripheralInfo) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &PeripheralInfo) -> bool
fn ne(&self, other: &PeripheralInfo) -> bool
This method tests for !=.
impl StructuralPartialEq for PeripheralInfo
Auto Trait Implementations
impl RefUnwindSafe for PeripheralInfo
impl Send for PeripheralInfo
impl Sync for PeripheralInfo
impl Unpin for PeripheralInfo
impl UnwindSafe for PeripheralInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub 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.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more