谁能帮我在每句后面加上注释、、、、谢谢、、下面有整个测试程序的压缩包、、、、
#include "hw_ints.h"
#include "hw_memmap.h"
LED.rar
(56.84 KB)
#include "hw_types.h"
#include "gpio.h"
#include "sysctl.h"
#include "cpu.h"
#include "interrupt.h"
#define LED_PERIPH SYSCTL_PERIPH_GPIOB
#define LED_PORT GPIO_PORTB_BASE
#define LED GPIO_PIN_5 // PB5控制D1
void delay (int a)
{
for (; a > 0; a--);
}
int main(void)
{
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_6MHZ);
SysCtlPeripheralEnable(LED_PERIPH);
GPIOPinTypeGPIOOutput(LED_PORT, LED);
GPIOPadConfigSet(LED_PORT, LED, GPIO_STRENGTH_8MA,
GPIO_PIN_TYPE_STD_WPU);
for(;;)
{
GPIOPinWrite(LED_PORT, LED, 0xFF);
delay(1000000);
GPIOPinWrite(LED_PORT, LED, 0x00);
delay(1000000);
}
} |