inttimer2410.c

来自「Nucleus的源代码」· C语言 代码 · 共 34 行

C
34
字号
#include"2410addr.h"


void INT_Timer_Initialize(void)
{
	rTCFG0=0x00000064; //prescaler0 100
	rTCFG1=0x00000011; //divide value 1/4
	rTCNTB0=0x5dc;
	rTCNTB1=0x1000;
	rTCON=0x00000a0a;  //auto load, invert off, manual update, stop timer

	rSRCPND=0x0;
	rINTPND=0x0;
	/*INTIALIZE THE INTERRUPT*/
	rINTMOD=0x0;  //all irq
	rINTMSK=0xffffffff;  //disable all interrupt source
	rINTSUBMSK=0xffff; //disable all sub interrupt source
}


/* open the interrupt timer0 and eint0 */
void ENABLE_INTERRUPT(void)
{
	rINTMSK=~(BIT_TIMER0|BIT_EINT0);
	rTCON=0x00000009;
}

void ENABLE_INTERRUPT_1(void)
{
  rINTMSK&=~(BIT_TIMER1);
  rTCON=0x00000909;

}

⌨️ 快捷键说明

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