use crate::svd::register::{
create_bit_range, create_cluster, create_field, create_register, create_register_properties,
};
use crate::Result;
pub fn create() -> Result<svd::RegisterCluster> {
Ok(svd::RegisterCluster::Cluster(create_cluster(
"int",
"DMAC Interrupt registers",
0x0,
&[
svd::RegisterCluster::Register(create_register(
"status",
"Interrupt Status Register - shows the status of the interrupts after masking. A HIGH bit indicates that a specific DMA channel interrupt request is active. You can generate the request from either the error or terminal count interrupt requests.",
0x0,
create_register_properties(32, 0)?,
Some(&[
create_field(
"status",
"Status of the DMA interrupts after masking",
create_bit_range("[7:0]")?,
svd::Access::ReadOnly,
None,
)?,
]),
None,
)?),
svd::RegisterCluster::Register(create_register(
"tc_status",
"Interrupt Terminal Count Status Register - indicates the status of the terminal count after masking. You must use this register in conjunction with the DMACIntStatus Register if you use the combined interrupt request, DMACINTR, to request interrupts. If you use the DMACINTTC interrupt request, then you only have to read the DMACIntTCStatus Register to ascertain the source of the interrupt request.",
0x4,
create_register_properties(32, 0)?,
Some(&[
create_field(
"tc_status",
"Interrupt terminal count request status",
create_bit_range("[7:0]")?,
svd::Access::ReadOnly,
None,
)?,
]),
None,
)?),
svd::RegisterCluster::Register(create_register(
"tc_clear",
"Interrupt Terminal Count Clear Register - clears a terminal count interrupt request. When writing to this register, each data bit that is set HIGH causes the corresponding bit in the Status Register to be cleared. Data bits that are LOW have no effect on the corresponding bit in the register.",
0x8,
create_register_properties(32, 0)?,
Some(&[
create_field(
"tc_clear",
"Terminal count request clear.",
create_bit_range("[7:0]")?,
svd::Access::WriteOnly,
None,
)?,
]),
None,
)?),
svd::RegisterCluster::Register(create_register(
"error_status",
"Interrupt Error Status Register - indicates the status of the error request after masking. You must use this register in conjunction with the DMACIntStatus Register if you use the combined interrupt request, DMACINTR, to request interrupts. If you use the DMACINTERR interrupt request, then only read the DMACIntErrorStatus Register.",
0xc,
create_register_properties(32, 0)?,
Some(&[
create_field(
"error_status",
"Interrupt error status.",
create_bit_range("[7:0]")?,
svd::Access::ReadOnly,
None,
)?,
]),
None,
)?),
svd::RegisterCluster::Register(create_register(
"error_clear",
"Interrupt Error Clear Register - clears the error interrupt requests. When writing to this register, each data bit that is HIGH causes the corresponding bit in the Status Register to be cleared. Data bits that are LOW have no effect on the corresponding bit in the register.",
0x10,
create_register_properties(32, 0)?,
Some(&[
create_field(
"error_clear",
"Interrupt error clear.",
create_bit_range("[7:0]")?,
svd::Access::WriteOnly,
None,
)?,
]),
None,
)?),
],
None,
)?))
}