⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 timer0a_int.c

📁 EasyARM615的KEIL下的调试程序,包含IO口,串口,SPI口等
💻 C
字号:
#include "hw_memmap.h"
#include "hw_types.h"
#include "hw_timer.h"
#include "gpio.h"
#include "sysctl.h"
#include "timer.h"
#include"interrupt.h"
#include "hw_ints.h"
#include "TIMER0A_int.h"

extern TIME_FORMAT time;

void Timer1a_int(void)
{
                   
    SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER1);        // 使能定时器0外设。

    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);         // 使能GPIO D口外设。

    IntMasterEnable();                                   // 处理器使能。

	GPIOPinTypeTimer(GPIO_PORTD_BASE ,CCP0);			//设置PB0为32K输入口
    
	TimerConfigure(TIMER1_BASE, TIMER_CFG_32_RTC|TIMER_CFG_32_BIT_PER);   
                                                         // 设置RTC模式。
    TimerMatchSet(TIMER1_BASE,TIMER_A,2);			 // 设置RTC的匹配值
	TimerLoadSet(TIMER1_BASE, TIMER_A, 1);
	TimerRTCEnable(TIMER1_BASE);  						//使能RTC计数
	
	TimerIntEnable(TIMER1_BASE,TIMER_RTC_MATCH);		//使RTC中断

    TimerEnable(TIMER1_BASE, TIMER_A);		 //	RTC模式使能
	
	IntEnable(INT_TIMER1A);					// 使能中断

}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -