void Timer0A_Init(void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0); //使能定时器0
IntMasterEnable();
TimerConfigure(TIMER0_BASE,TIMER_CFG_32_BIT_OS); //配置定时器为32bit周期计数模式
TimerLoadSet(TIMER0_BASE,TIMER_A,6000000); //设置装载寄存器值
TimerIntRegister(TIMER0_BASE,TIMER_A,Timer0A_ISR); //注册中断服务子程序的名称
TimerIntEnable(TIMER0_BASE,TIMER_TIMA_TIMEOUT); //设置定时器为溢出中断
TimerEnable(TIMER0_BASE,TIMER_A); //使能定时器0
} |