DriverLib_2
#include "driverlib.h"
int main(void) {
WDT_A_hold( WDT_A_BASE ); // 关闭看门狗
GPIO_setAsOutputPin( GPIO_PORT_P1 , GPIO_PIN0 ); // 配置P1.0为输出模式
GPIO_setOutputLowOnPin( GPIO_PORT_P1 , GPIO_PIN0 ); // 让P1.0输出低电平,熄灭LED1
GPIO_setAsPeripheralModuleFunctionOutputPin( GPIO_PORT_P5 , GPIO_PIN4 ); // 使能P5.4复用
GPIO_setAsPeripheralModuleFunctionOutputPin( GPIO_PORT_P5 , GPIO_PIN5 ); // 使能P5.5复用
UCS_turnOnLFXT1( UCS_XT1_DRIVE_3 , UCS_XCAP_3 ); // 打开XT1
UCS_initClockSignal( UCS_MCLK , UCS_XT1CLK_SELECT , UCS_CLOCK_DIVIDER_1); // 配置MCLK为XT1
while( 1 ){
GPIO_toggleOutputOnPin( GPIO_PORT_P1 , GPIO_PIN0 ); // 切换LED1亮灭
__delay_cycles( 3276800 ); // 延时10s
}
}