Struct drone_svd::Peripheral[][src]

#[non_exhaustive]pub struct Peripheral {
    pub derived_from: Option<String>,
    pub dim: Option<u32>,
    pub dim_increment: Option<u32>,
    pub name: String,
    pub description: Option<String>,
    pub alternate_peripheral: Option<String>,
    pub base_address: u32,
    pub size: Option<u32>,
    pub reset_value: Option<u32>,
    pub access: Option<Access>,
    // some fields omitted
}

A peripheral of a device.

Fields (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.
derived_from: Option<String>

The peripheral name from which to inherit data.

dim: Option<u32>

Define the number of elements in an array.

dim_increment: Option<u32>

Specify the address increment, in Bytes, between two neighboring array members in the address map.

name: String

The string identifies the peripheral.

description: Option<String>

The string provides an overview of the purpose and functionality of the peripheral.

alternate_peripheral: Option<String>

A peripheral redefining an address block needs to specify the name of the peripheral that is listed first in the description.

base_address: u32

Lowest address reserved or used by the peripheral.

size: Option<u32>

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

reset_value: Option<u32>

Default value for all registers in the peripheral at RESET.

access: Option<Access>

Default access rights for all registers in the peripheral.

Implementations

impl Peripheral[src]

pub fn reg(&mut self, path: &str) -> &mut Register[src]

Returns a mutable reference to the register at the path path.

pub fn add_reg(&mut self, register: Register)[src]

Adds a new register register.

pub fn new_reg(&mut self, f: impl FnOnce(&mut Register))[src]

Adds a new register initialized by f.

pub fn remove_reg(&mut self, path: &str) -> Register[src]

Removes the register at the path path.

Trait Implementations

impl Clone for Peripheral[src]

impl Debug for Peripheral[src]

impl Default for Peripheral[src]

impl<'de> Deserialize<'de> for Peripheral[src]

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

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[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.