svd-generator 0.4.1

Converts device information from flattened device tree into an SVD description
Documentation
use crate::svd::register::{
    create_bit_range, create_cluster, create_field, create_register, create_register_properties,
};
use crate::Result;

/// Creates ARM PL080 DMA Controller Peripheral ID registers.
pub fn create() -> Result<svd::RegisterCluster> {
    Ok(svd::RegisterCluster::Cluster(create_cluster(
        "pcell_id",
        "DMAC PrimeCell ID registers - You can treat the registers conceptually as a 32-bit register. The register is a standard cross-peripheral identification system. The DMACPCellID Register is set to 0xB105F00D.",
        0xff0,
        &[
            svd::RegisterCluster::Register(create_register(
                "pcell_id0",
                "DMA PrimeCell ID 0 register - is hard-coded and the fields in the register determine the reset value.",
                0x0,
                create_register_properties(32, 0x0D)?,
                Some(&[
                    create_field(
                        "pcell_id",
                        "These bits read back as 0x80",
                        create_bit_range("[7:0]")?,
                        svd::Access::ReadOnly,
                        None,
                    )?,
                ]),
                None,
            )?),
            svd::RegisterCluster::Register(create_register(
                "pcell_id1",
                "DMA PrimeCell ID 1 register - is hard-coded and the fields in the register determine the reset value.",
                0x4,
                create_register_properties(32, 0xF0)?,
                Some(&[
                    create_field(
                        "pcell_id",
                        "These bits read back as 0xF0",
                        create_bit_range("[7:0]")?,
                        svd::Access::ReadOnly,
                        None,
                    )?,
                ]),
                None,
            )?),
            svd::RegisterCluster::Register(create_register(
                "pcell_id2",
                "DMA PrimeCell ID 2 register - is hard-coded and the fields in the register determine the reset value.",
                0x8,
                create_register_properties(32, 0x05)?,
                Some(&[
                    create_field(
                        "pcell_id",
                        "These bits read back as 0x05",
                        create_bit_range("[7:0]")?,
                        svd::Access::ReadOnly,
                        None,
                    )?,
                ]),
                None,
            )?),
            svd::RegisterCluster::Register(create_register(
                "pcell_id3",
                "DMA PrimeCell ID 3 register - is hard-coded and the fields in the register determine the reset value.",
                0xc,
                create_register_properties(32, 0xB1)?,
                Some(&[
                    create_field(
                        "pcell_id",
                        "These bits read back as 0xB1",
                        create_bit_range("[7:0]")?,
                        svd::Access::ReadOnly,
                        None,
                    )?,
                ]),
                None,
            )?),
        ],
        None,
    )?))
}