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

📄 isr.c

📁 ADSP 与高速AD器件无缝链接的源代码
💻 C
字号:
/***************************************************************************** * ISR.c
 * Frank.liux    2008-12-17 *****************************************************************************/
#include	"..\include\AD7877.h"
#include	"..\include\AD7877_Register.h"
#include	"stdio.h"

char 	FLAG_DAV=0;
char 	FLAG_PENIRQ=0;
int	X_Location,Y_Location,nano;


EX_INTERRUPT_HANDLER(IsrPB4_5)
{
	int Pint0_State	;
//	Pint0_State	=	*pPINT0_LATCH;
	Pint0_State = 	*pPINT0_PINSTATE;
	/* clear interrupt request */
	*pPINT0_REQUEST  = PIQ4|PIQ5;
	*pPINT0_MASK_CLEAR = PIQ4|PIQ5;

	
	if	((Pint0_State&PIQ4) == PIQ4)
		{
		//	char iData=0;
			
 			X_Location	=	AD7877_Read();
			Y_Location	=	AD7877_Read();
			
		/*
			for	(iData<14;iData++;)
			{
			nano		=	AD7877_Read();
			}
	*/
		/* next read register should be reprogrammed start at X+ Register ,or DSP would read a Series
		registers that are empty		
		Notic: In master mode ,when you touch the screen,the result you recived was the 
		previous convert result */
	AD7877_Program		(AD7877_CONTROL_REG1,
						 AD7877_MODE_3+
						 X
						 );
						 			
		/*The abs(); function returns the absolute value of its integer input*/
			printf("The X :%d\n",abs(X_Location/8.5));
			printf("The Y :%d\n",abs(Y_Location/15));
			printf("######################\n");
		}	
		
	if 	((Pint0_State&PIQ5) == PIQ5)
		{
		}		
	/* start  interrupt again */	
	*pPINT0_MASK_SET = PIQ4|PIQ5;
}

⌨️ 快捷键说明

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