svd-generator 0.2.0

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

/// Creates a StarFive JH7110 SYSCRG Clock Mailbox APB register.
pub fn create() -> Result<svd::RegisterCluster> {
    Ok(svd::RegisterCluster::Cluster(create_cluster(
        "clk_can_ctrl",
        "Clock CAN Controller",
        0x1cc,
        &[
            jh7110::create_register_icg(
                "apb",
                "Clock Internal Controller APB",
                0x0,
                Some(1 << 31),
                None,
            )?,
            jh7110::create_register_icg_divcfg(
                "tim",
                "Clock Internal Controller Timer",
                0x4,
                [24, 24, 6, 24],
                None,
                None,
            )?,
            jh7110::create_register_icg_divcfg(
                "can",
                "Clock Internal Controller CAN",
                0x8,
                [63, 8, 8, 8],
                None,
                None,
            )?,
        ],
        Some(
            svd::DimElement::builder()
                .dim(2)
                .dim_increment(0xc)
                .dim_index(Some([String::from("_u0"), String::from("_u1")].into()))
                .build(svd::ValidateLevel::Strict)?,
        ),
    )?))
}