[][src]Struct svd_expander::PeripheralSpec

pub struct PeripheralSpec {
    pub name: String,
    pub version: Option<String>,
    pub display_name: Option<String>,
    pub group_name: Option<String>,
    pub description: Option<String>,
    pub base_address: u32,
    pub address_block: Option<AddressBlockSpec>,
    pub default_register_size: Option<u32>,
    pub default_register_reset_value: Option<u32>,
    pub default_register_reset_mask: Option<u32>,
    pub default_register_access: Option<AccessSpec>,
    pub interrupts: Vec<InterruptSpec>,
    pub registers: Vec<RegisterSpec>,
    pub clusters: Vec<ClusterSpec>,
    // some fields omitted
}

Describes a peripheral on a device.

Fields

name: String

Name of the peripheral. Must be unique for the entire device.

version: Option<String>

The version of the peripheral description.

display_name: Option<String>

Human-friendly name of the peripheral.

group_name: Option<String>

Name of the group to which this peripheral belongs. This is optional and is mostly intended to visually group the peripheral with related peripherals in documentation and user interfaces.

description: Option<String>

Overview of the purpose and functionality of the peripheral.

base_address: u32

Lowest address reserved or used by the peripheral.

address_block: Option<AddressBlockSpec>

An address range uniquely mapped to this peripheral.

default_register_size: Option<u32>

Default bit-width of any register contained in this peripheral.

default_register_reset_value: Option<u32>

Default value after reset of any register contained in this peripheral.

default_register_reset_mask: Option<u32>

Default register bits that have a defined reset value for any register in this peripheral.

default_register_access: Option<AccessSpec>

Default access rights for any register contained in this peripheral.

interrupts: Vec<InterruptSpec>

Interrupts that exist on this peripheral.

registers: Vec<RegisterSpec>

Top-level registers that exist on this peripheral.

clusters: Vec<ClusterSpec>

Top-level register clusters that exist on this peripheral. Clusters may contain registers or other clusters.

Implementations

impl PeripheralSpec[src]

pub fn iter_clusters(&self) -> impl Iterator<Item = &ClusterSpec>[src]

Recursively iterates all the register clusters contained within this peripheral.

pub fn iter_registers(&self) -> impl Iterator<Item = &RegisterSpec>[src]

Recursively iterates all the registers contained within this peripheral.

pub fn iter_fields(&self) -> impl Iterator<Item = &FieldSpec>[src]

Recursively iterates all the register fields contained within this peripheral.

pub fn derived_from_path(&self) -> Option<String>[src]

The full path of the peripheral that this peripheral inherits from (if any). Since all peripherals are top-level components of the device, this is just the name of the other peripheral.

pub fn path(&self) -> String[src]

The full path of this peripheral. Since all peripherals are top-level components of the device, this is just the name of the peripheral.

Trait Implementations

impl Clone for PeripheralSpec[src]

impl Debug for PeripheralSpec[src]

impl PartialEq<PeripheralSpec> for PeripheralSpec[src]

impl StructuralPartialEq for PeripheralSpec[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.