void systemInit(void) { //Default configuration SCU_MCLKSourceConfig(SCU_MCLK_OSC); //Configure the FMI FMI_Config(FMI_READ_WAIT_STATE_2, FMI_WRITE_WAIT_STATE_0, FMI_PWD_ENABLE, FMI_LVD_ENABLE, FMI_FREQ_HIGH); //Configure PLL factors SCU_PLLFactorsConfig(192, 25, 2); //Enable PLL and wait for the the PLL to lock SCU_PLLCmd(ENABLE); //Set clock dividers SCU_RCLKDivisorConfig(SCU_RCLK_Div1); SCU_HCLKDivisorConfig(SCU_HCLK_Div1); SCU_FMICLKDivisorConfig(SCU_FMICLK_Div1); SCU_PCLKDivisorConfig(SCU_PCLK_Div2); //Switch to PLL clock SCU_MCLKSourceConfig(SCU_MCLK_PLL); //Enable VIC clock SCU_AHBPeriphClockConfig(__VIC, ENABLE); //Reset VIC peripheral VIC_DeInit(); //Assign default vectors VIC_InitDefaultVectors(); }
// Configure the interrupt vector. static void VICConfig(void) { // Enable the AHB (advanced high-performance but) clock for VIC (vectored // interrupt controller). SCU_AHBPeriphClockConfig(__VIC,ENABLE); // Reset the VIC registers (to their default reset values). VIC_DeInit(); // Initialize VICs default vector registers. VIC_InitDefaultVectors(); // Reset the wakeup interrupt unit registers. WIU_DeInit(); }