void Chip_SetupIrcClocking(void) { /* Disconnect the Main PLL if it is connected already */ if (Chip_Clock_IsMainPLLConnected()) { Chip_Clock_DisablePLL(SYSCTL_MAIN_PLL, SYSCTL_PLL_CONNECT); } /* Disable the PLL if it is enabled */ if (Chip_Clock_IsMainPLLEnabled()) { Chip_Clock_DisablePLL(SYSCTL_MAIN_PLL, SYSCTL_PLL_ENABLE); } Chip_Clock_SetCPUClockDiv(0); Chip_Clock_SetMainPLLSource(SYSCTL_PLLCLKSRC_IRC); /* FCCO = ((44+1) * 2 * 4MHz) / (0+1) = 360MHz */ Chip_Clock_SetupPLL(SYSCTL_MAIN_PLL, 44, 0); Chip_Clock_EnablePLL(SYSCTL_MAIN_PLL, SYSCTL_PLL_ENABLE); Chip_Clock_SetCPUClockDiv(2); while (!Chip_Clock_IsMainPLLLocked()) {} /* Wait for the PLL to Lock */ Chip_Clock_EnablePLL(SYSCTL_MAIN_PLL, SYSCTL_PLL_CONNECT); } |