use crate::svd::register::{
create_bit_range, create_field, create_register, create_register_properties,
};
use crate::Result;
pub fn create() -> Result<svd::RegisterCluster> {
Ok(svd::RegisterCluster::Register(create_register(
"chsusp",
"DMAC Channel Suspend register contains the DMAC channel suspend settings. Only exists when DMAX_NUM_CHANNELS > 8",
0x20,
create_register_properties(64, 0)?,
Some(&[
create_field(
"susp0_ch",
"DMAC Channel Suspend - 0: no DMAC channel suspend request, 1: DMAC channel suspend request",
create_bit_range("[0:0]")?,
svd::Access::ReadWrite,
Some(svd::DimElement::builder()
.dim(16)
.dim_increment(1)
.dim_index(Some([
String::from("1"),
String::from("2"),
String::from("3"),
String::from("4"),
String::from("5"),
String::from("6"),
String::from("7"),
String::from("8"),
String::from("9"),
String::from("10"),
String::from("11"),
String::from("12"),
String::from("13"),
String::from("14"),
String::from("15"),
String::from("16"),
].into()))
.build(svd::ValidateLevel::Strict)?),
)?,
create_field(
"susp_we0_ch",
"DMAC Channel Suspend Write-enable - 0: disable write to DMAC channel suspend bit, 1: enable write to DMAC channel suspend bit",
create_bit_range("[16:16]")?,
svd::Access::WriteOnly,
Some(svd::DimElement::builder()
.dim(16)
.dim_increment(1)
.dim_index(Some([
String::from("1"),
String::from("2"),
String::from("3"),
String::from("4"),
String::from("5"),
String::from("6"),
String::from("7"),
String::from("8"),
String::from("9"),
String::from("10"),
String::from("11"),
String::from("12"),
String::from("13"),
String::from("14"),
String::from("15"),
String::from("16"),
].into()))
.build(svd::ValidateLevel::Strict)?),
)?,
create_field(
"susp1_ch",
"DMAC Channel Suspend - 0: no DMAC channel suspend request, 1: DMAC channel suspend request",
create_bit_range("[32:32]")?,
svd::Access::ReadWrite,
Some(svd::DimElement::builder()
.dim(16)
.dim_increment(1)
.dim_index(Some([
String::from("17"),
String::from("18"),
String::from("19"),
String::from("20"),
String::from("21"),
String::from("22"),
String::from("23"),
String::from("24"),
String::from("25"),
String::from("26"),
String::from("27"),
String::from("28"),
String::from("29"),
String::from("30"),
String::from("31"),
String::from("32"),
].into()))
.build(svd::ValidateLevel::Strict)?),
)?,
create_field(
"susp_we1_ch",
"DMAC Channel Suspend Write-enable - 0: disable write to DMAC channel suspend bit, 1: enable write to DMAC channel suspend bit",
create_bit_range("[48:48]")?,
svd::Access::WriteOnly,
Some(svd::DimElement::builder()
.dim(16)
.dim_increment(1)
.dim_index(Some([
String::from("17"),
String::from("18"),
String::from("19"),
String::from("20"),
String::from("21"),
String::from("22"),
String::from("23"),
String::from("24"),
String::from("25"),
String::from("26"),
String::from("27"),
String::from("28"),
String::from("29"),
String::from("30"),
String::from("31"),
String::from("32"),
].into()))
.build(svd::ValidateLevel::Strict)?),
)?,
]),
None,
)?))
}