svd-generator 0.4.3

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

/// Creates ARM PL080 DMA Controller Channel Configuration register defintion.
pub fn create() -> Result<svd::RegisterCluster> {
    Ok(svd::RegisterCluster::Register(create_register(
        "configuration",
        "DMA Channel Configuration register",
        0x10,
        create_register_properties(32, 0)?,
        Some(&[
            create_field(
                "enable",
                "Channel enable - 0: channel disabled, 1: channel enabled.",
                create_bit_range("[0:0]")?,
                svd::Access::ReadWrite,
                None,
            )?,
            create_field(
                "src_peripheral",
                "Source peripheral. This value selects the DMA source request peripheral. This field is ignored if the source of the transfer is from memory.",
                create_bit_range("[4:1]")?,
                svd::Access::ReadWrite,
                None,
            )?,
            create_field(
                "dst_peripheral",
                "Destination peripheral. This value selects the DMA destination request peripheral. This field is ignored if the destination of the transfer is to memory.",
                create_bit_range("[9:6]")?,
                svd::Access::ReadWrite,
                None,
            )?,
            create_field(
                "flow_cntrl",
                "Flow control and transfer type. This value indicates the flow controller and transfer type. The flow controller can be the DMAC, the source peripheral, or the destination peripheral. The transfer type can be memory-to-memory, memory-to-peripheral, peripheral-to-memory, or peripheral-to-peripheral.",
                create_bit_range("[13:11]")?,
                svd::Access::ReadWrite,
                None,
            )?,
            create_field(
                "iem",
                "Interrupt error mask. When cleared, this bit masks out the error interrupt of the relevant channel.",
                create_bit_range("[14:14]")?,
                svd::Access::ReadWrite,
                None,
            )?,
            create_field(
                "itc",
                "Terminal count interrupt mask. When cleared, this bit masks out the terminal count interrupt of the relevant channel.",
                create_bit_range("[15:15]")?,
                svd::Access::ReadWrite,
                None,
            )?,
            create_field(
                "lock",
                "Lock. When set, this bit enables locked transfers. For details of how lock control works.",
                create_bit_range("[16:16]")?,
                svd::Access::ReadWrite,
                None,
            )?,
            create_field(
                "active",
                "Active - 0: there channel FIFO has no data, 1: the channel FIFO has data.",
                create_bit_range("[17:17]")?,
                svd::Access::ReadOnly,
                None,
            )?,
            create_field(
                "halt",
                "Halt - 0: enable DMA requests, 1: ignore extra source DMA requests. The contents of the channels FIFO are drained. You can use this value with the Active and Channel Enable bits to cleanly disable a DMA channel.",
                create_bit_range("[18:18]")?,
                svd::Access::ReadWrite,
                None,
            )?,
        ]),
        None,
    )?))
}