我们可以看到这两段代码:
int main(void)
{
/* Halting the Watchdog */
MAP_WDT_A_holdTimer();
/* Configuring pins for peripheral/crystal usage and LED for output */
MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_PJ,
GPIO_PIN3 | GPIO_PIN4, GPIO_PRIMARY_MODULE_FUNCTION);
MAP_GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN0);
/* Setting the external clock frequency. This API is optional, but will
* come in handy if the user ever wants to use the getMCLK/getACLK/etc
* functions
*/
CS_setExternalClockSourceFrequency(32000,48000000);
/* Starting HFXT in non-bypass mode without a timeout. Before we start
* we have to change VCORE to 1 to support the 48MHz frequency */
MAP_PCM_setCoreVoltageLevel(PCM_VCORE1);
MAP_FlashCtl_setWaitState(FLASH_BANK0, 2);
MAP_FlashCtl_setWaitState(FLASH_BANK1, 2);
CS_startHFXT(false);
/* Configuring SysTick to trigger at 24000000 (MCLK is 48MHz so this will
* make it toggle every 0.5s) */
MAP_SysTick_enableModule();
MAP_SysTick_setPeriod(24000000);
MAP_Interrupt_enableSleepOnIsrExit();
MAP_SysTick_enableInterrupt();
/*
* Getting all of the frequency values of the CLK sources using the
* convenience functions */
aclk = CS_getACLK();
mclk = CS_getMCLK();
smclk = CS_getSMCLK();
hsmclk = CS_getHSMCLK();
bclk = CS_getBCLK();
/*
* Staying in active mode so that the user can see the values that are put
* in the above registers through the debugger
*/
while (1)
{