svd-generator 0.6.0

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

/// Creates Synopsys DesignWare MMC Interrupt field definition.
pub fn create_int_fields(desc: &str, access: svd::Access) -> Result<svd::Field> {
    create_field(
        "int",
        desc,
        create_bit_range("[0:0]")?,
        access,
        Some(
            svd::DimElement::builder()
                .dim(32)
                .dim_increment(0x1)
                .dim_index(Some(
                    [
                        String::from("_cd"),
                        String::from("_resp_err"),
                        String::from("_cmd_done"),
                        String::from("_data_over"),
                        String::from("_txdr"),
                        String::from("_rxdr"),
                        String::from("_rcrc"),
                        String::from("_dcrc"),
                        String::from("_rto"),
                        String::from("_drto"),
                        String::from("_hto_volt_switch"),
                        String::from("_frun"),
                        String::from("_hle"),
                        String::from("_sbe"),
                        String::from("_acd"),
                        String::from("_ebe"),
                        String::from("_sdio0"),
                        String::from("_sdio1"),
                        String::from("_sdio2"),
                        String::from("_sdio3"),
                        String::from("_sdio4"),
                        String::from("_sdio5"),
                        String::from("_sdio6"),
                        String::from("_sdio7"),
                        String::from("_sdio8"),
                        String::from("_sdio9"),
                        String::from("_sdio10"),
                        String::from("_sdio11"),
                        String::from("_sdio12"),
                        String::from("_sdio13"),
                        String::from("_sdio14"),
                        String::from("_sdio15"),
                    ]
                    .into(),
                ))
                .build(svd::ValidateLevel::Strict)?,
        ),
    )
}