[−][src]Struct svd_expander::DeviceSpec
Represents information about a device specified in a CMSIS-SVD file.
Fields
name: String
version: Option<String>
The full name of the vendor of the device.
description: Option<String>
Description of the main features of the device (i.e. CPU, clock frequency, peripheral overview).
address_unit_bits: Option<u32>
The number of data bits uniquely selected by each address. The value for Cortex-M-based
devices is 8
(byte-addressable).
width: Option<u32>
The bit width of the maximum single data transfer supported by bu bus infrastructure. Expected value for Cortex-M-based devices is 32.
cpu: Option<CpuSpec>
The processor included in the device.
peripherals: Vec<PeripheralSpec>
The device's peripherals.
default_register_size: Option<u32>
Default bit width of any register contained in the device.
default_register_reset_value: Option<u32>
Default value of all registers after reset.
default_register_reset_mask: Option<u32>
Defines which register bits have a defined reset value.
default_register_access: Option<AccessSpec>
Default access rights for all registers.
Implementations
impl DeviceSpec
[src]
pub fn from_xml(xml: &str) -> SvdExpanderResult<Self>
[src]
Creates a new device by parsing an XML string following the CMSIS-SVD specification. Expands all array definitions and resolves inheritance chains to fully resolve all populate all the components of the device.
Arguments
xml
= An XML string containing a device specification in the CMSIS-SVD format.
Example
use svd_expander::DeviceSpec; let device = DeviceSpec::from_xml( r##" <device xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="1.1" xsi:noNamespaceSchemaLocation="CMSIS-SVD_Schema_1_1.xsd"> <name>STM32F303</name> <version>1.2</version> <peripherals> </peripherals> </device> "## ).unwrap(); assert_eq!("STM32F303", device.name); assert_eq!("1.2", device.version.unwrap());
pub fn iter_clusters(&self) -> impl Iterator<Item = &ClusterSpec>
[src]
Recursively iterates all the register clusters on the device.
pub fn iter_registers(&self) -> impl Iterator<Item = &RegisterSpec>
[src]
Recursively iterates all the registers on the device.
pub fn iter_fields(&self) -> impl Iterator<Item = &FieldSpec>
[src]
Recursively iterates all the register fields on the device.
pub fn iter_enumerated_value_sets(
&self
) -> impl Iterator<Item = &EnumeratedValueSetSpec>
[src]
&self
) -> impl Iterator<Item = &EnumeratedValueSetSpec>
Recursively iterates all the enumerated value sets on the device.
pub fn get_peripheral(&self, path: &str) -> SvdExpanderResult<&PeripheralSpec>
[src]
Gets the peripheral that exists at the given path. Peripherals top-level constructs and can't be nested, so a peripheral path is simply the name of the peripheral.
Arguments
path
= The path to the peripheral. Since peripherals are top-level components and can't be nested, this is just the name of the peripheral.
pub fn get_cluster(&self, path: &str) -> SvdExpanderResult<&ClusterSpec>
[src]
Gets the register cluster that exists at the given path.
Arguments
path
= The path to the register cluster.
pub fn get_register(&self, path: &str) -> SvdExpanderResult<&RegisterSpec>
[src]
pub fn get_field(&self, path: &str) -> SvdExpanderResult<&FieldSpec>
[src]
Gets the register field that exists at the given path.
Arguments
path
= The path to the register field.
Trait Implementations
impl Clone for DeviceSpec
[src]
fn clone(&self) -> DeviceSpec
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for DeviceSpec
[src]
impl PartialEq<DeviceSpec> for DeviceSpec
[src]
fn eq(&self, other: &DeviceSpec) -> bool
[src]
fn ne(&self, other: &DeviceSpec) -> bool
[src]
impl StructuralPartialEq for DeviceSpec
[src]
Auto Trait Implementations
impl RefUnwindSafe for DeviceSpec
impl Send for DeviceSpec
impl Sync for DeviceSpec
impl Unpin for DeviceSpec
impl UnwindSafe for DeviceSpec
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,