只做一个电灯的测试程序
int main (void)
{
int i;
IntMasterDisable();
SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
while(!SysCtlPeripheralReady(SYSCTL_PERIPH_GPIOB))
{
}
GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, GPIO_PIN_0);
while(1)
{
//
// Turn on the LED
//
GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_0,GPIO_PIN_0 );
//
//
for( i=0;i<100;i++);
//
// Turn on the LED
//
GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_0, ~GPIO_PIN_0);
//
//
for( i=0;i<100;i++);
}
}