import Ivory.BSP.STM32F412.SYSCFG.Peripheral
import Ivory.BSP.STM32F412.SYSCFG.Regs
import Ivory.BSP.STM32F412.RCC
import Ivory.BSP.STM32F412.MemoryMap (syscfg_periph_base)

syscfg :: SYSCFG
syscfg = mkSYSCFG syscfg_periph_base rccenable rccdisable
  where
  rccenable  = modifyReg rcc_reg_apb2enr $ setBit   rcc_apb2enr_syscfgen