use vorago_shared_hal::{PeripheralSelect, enable_peripheral_clock, reset_peripheral_for_cycles};
use crate::pac;
pub fn enable_and_init_irq_router() {
let irq_router = unsafe { pac::IrqRouter::steal() };
enable_peripheral_clock(PeripheralSelect::IrqRouter);
reset_peripheral_for_cycles(PeripheralSelect::IrqRouter, 2);
unsafe {
irq_router.dmasel0().write_with_zero(|w| w);
irq_router.dmasel1().write_with_zero(|w| w);
irq_router.dmasel2().write_with_zero(|w| w);
irq_router.dmasel3().write_with_zero(|w| w);
irq_router.adcsel().write_with_zero(|w| w);
irq_router.dacsel0().write_with_zero(|w| w);
irq_router.dacsel1().write_with_zero(|w| w);
}
}