Struct svd_rs::peripheral::Peripheral [−][src]
#[non_exhaustive]pub struct Peripheral {
pub name: String,
pub display_name: Option<String>,
pub version: Option<String>,
pub description: Option<String>,
pub group_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: String
The 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
group_name: Option<String>
Assigns this peripheral to a group of peripherals. This is only used bye the System View
base_address: u64
Lowest address reserved or used by the peripheral
default_register_properties: RegisterProperties
Default 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
Make a builder for Peripheral
pub fn modify_from(
&mut self,
builder: PeripheralBuilder,
lvl: ValidateLevel
) -> Result<(), SvdError>
pub fn modify_from(
&mut self,
builder: PeripheralBuilder,
lvl: ValidateLevel
) -> Result<(), SvdError>
Modify an existing Peripheral
based on a builder.
Validate the Peripheral
returns iterator over all registers peripheral contains
pub fn reg_iter_mut(&mut self) -> RegIterMut<'_>ⓘNotable traits for RegIterMut<'a>impl<'a> Iterator for RegIterMut<'a> type Item = &'a mut Register;
pub fn reg_iter_mut(&mut self) -> RegIterMut<'_>ⓘNotable traits for RegIterMut<'a>impl<'a> Iterator for RegIterMut<'a> type Item = &'a mut Register;
impl<'a> Iterator for RegIterMut<'a> type Item = &'a mut Register;
returns mutable iterator over all registers peripheral contains
Trait Implementations
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for Peripheral
impl Send for Peripheral
impl Sync for Peripheral
impl Unpin for Peripheral
impl UnwindSafe for Peripheral
Blanket Implementations
Mutably borrows from an owned value. Read more