Struct svd_rs::device::Device

source ·
#[non_exhaustive]
pub struct Device {
Show 17 fields pub vendor: Option<String>, pub vendor_id: Option<String>, pub name: String, pub series: Option<String>, pub version: String, pub description: String, pub license_text: Option<String>, pub cpu: Option<Cpu>, pub header_system_filename: Option<String>, pub header_definitions_prefix: Option<String>, pub address_unit_bits: u32, pub width: u32, pub default_register_properties: RegisterProperties, pub peripherals: Vec<Peripheral>, pub xmlns_xs: String, pub no_namespace_schema_location: String, pub schema_version: String,
}
Expand description

The top element in a SVD file. Describes information specific to a device.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§vendor: Option<String>

Specify the vendor of the device using the full name

§vendor_id: Option<String>

Specify the vendor abbreviation without spaces or special characters

§name: String

The string identifies the device or device series. Device names are required to be unique

§series: Option<String>

Specify the name of the device series

§version: String

Define the version of the SVD file

§description: String

Describe the main features of the device (for example CPU, clock frequency, peripheral overview)

§license_text: Option<String>

The text will be copied into the header section of the generated device header file and shall contain the legal disclaimer

§cpu: Option<Cpu>

Describe the processor included in the device

§header_system_filename: Option<String>

Specify the file name (without extension) of the device-specific system include file

§header_definitions_prefix: Option<String>

This string is prepended to all type definition names generated in the CMSIS-Core device header file

§address_unit_bits: u32

Define the number of data bits uniquely selected by each address

§width: u32

Define the number of data bit-width of the maximum single data transfer supported by the bus infrastructure

§default_register_properties: RegisterProperties

Default properties for all registers

§peripherals: Vec<Peripheral>

Group to define peripherals

§xmlns_xs: String

Specify the underlying XML schema to which the CMSIS-SVD schema is compliant.

§no_namespace_schema_location: String

Specify the file path and file name of the CMSIS-SVD Schema

§schema_version: String

Specify the compliant CMSIS-SVD schema version

Implementations§

source§

impl Device

source

pub fn builder() -> DeviceBuilder

Make a builder for Device

source

pub fn modify_from( &mut self, builder: DeviceBuilder, lvl: ValidateLevel ) -> Result<(), SvdError>

Modify an existing Device based on a builder.

source

pub fn validate(&self, lvl: ValidateLevel) -> Result<(), SvdError>

Validate the Device

source

pub fn validate_all(&self, lvl: ValidateLevel) -> Result<(), SvdError>

Validate the Device recursively

source

pub fn get_peripheral(&self, name: &str) -> Option<&Peripheral>

Get peripheral by name

source

pub fn get_mut_peripheral(&mut self, name: &str) -> Option<&mut Peripheral>

Get mutable peripheral by name

Trait Implementations§

source§

impl Clone for Device

source§

fn clone(&self) -> Device

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Device

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Description for Device

source§

fn description(&self) -> Option<&str>

Get description
source§

impl From<Device> for DeviceBuilder

source§

fn from(d: Device) -> Self

Converts to this type from the input type.
source§

impl Name for Device

source§

fn name(&self) -> &str

Get name
source§

impl PartialEq for Device

source§

fn eq(&self, other: &Device) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Device

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.