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

📄 led_pll_test.c

📁 是在embest ide下可以直接运行的lcd实验板测试程序
💻 C
字号:


/*
***********************************************************************

	   Embest Info&Tech	Co., Ltd.  All rights reserved.
					 www.embedinfo.com

***********************************************************************

---------------- file information -------------------------------------

file name: lpc22eb06_test.c
version	 : v0
author	 : peter pan / panqan@hotmail.com
begin	 : 2006-02-10
finish	 : 2006-02-10
define	 : lpc22eb06 test file

notes	 :

---------------- modify	information	-----------------------------------
version	 :
modify	 :
begin	 :
finish	 :
define	 :
-----------------------------------------------------------------------
*/


// (--------------------- compiler condition --------------------------

/*
#ifdef	xxx
		#define	 xxx
#endif
*/

// --------------------- compiler condition	--------------------------)



/*-------------------------------------------------------------------*/
/*						 include files								 */
/*---------------------------------------------------------------- --*/

#include	"..\..\com\type_redefine.h"
#include	"..\..\com\lpc22xx_register.h"
#include    "..\..\com\22eb06_lib_iolamp\22eb06_lib_iolamp.h"
#include    "..\..\com\lpc_lib_pll\lpc_lib_pll.h"





/*-------------------------------------------------------------------*/
/*						 local function	declare						 */
/*-------------------------------------------------------------------*/

/*
void	xxx(xxx	xxx, xxx xxx);
*/


/*-------------------------------------------------------------------*/
/*						 variable define							 */
/*-------------------------------------------------------------------*/

/*
INT32U		XXXXXX;
*/






/*-------------------------------------------------------------------*/
/*						 extern	function declare					 */
/*-------------------------------------------------------------------*/

/*--- define in	XXX.c ---
extern	void	XXX();
*/


/*-------------------------------------------------------------------*/
/*						 extern	variable declare					 */
/*-------------------------------------------------------------------*/

void irq_eint3_svr(void);
extern irq_eint3(void);



/*-------------------------------------------------------------------*/
/*						 function code								 */
/*-------------------------------------------------------------------*/


/**********************************************************************
* name	:	 xxxxx
* func	:	 xxxxx
* para	:	 xxxx
* ret	:	 xxxx

* glob	:	 xxxx
* inc	:

* author:
* date	:

* modify:
* comment:
**********************************************************************/
/*void	xxx(xxx	xxx)
	  {
	  }
*/

INT8U key_data;

void Main(void)
{

	      INT32U i;

		  lpc_init_pll_manual();    
		  
		  Init_lamp();
	

//initialize the matrix key	  
		  PINSEL2 &=0xFFFFFFF7;
		
		  IODIR1 |=0x00F00000;
//		  IOSET1 |=0x000F0000;
		  IOCLR1 |=0x00F00000;
		  
//		  while(1);
	  
//select eint3 pin

		IODIR0&=0xBFFFFFFF;
		PINSEL1&=0xCFFFFFFF;
		
	  	i=PINSEL1;       
	  	i &=0xCFFFFFFF;
	  	i |=0x20000000;
	  	PINSEL1=i;



// initialize interrrupt eint3 
		VICIntEnClr = 0xffffffff;
		VICVectAddr = 0;
		VICIntSelect = 0;				//select irq
		
		VICVectCntl4 = 0x31;			//17th channel  110001
		VICVectAddr4 = (INT32U)irq_eint3;
		VICIntEnable = 0x00020000;
		
		for(;;);
//test the intrrupt flag	 			
/*		while(1)
		{
		i=VICIRQStatus;
		if((i &=0x00020000)!=0)
		 {for(i=10;i>0;i--)
			{
			  IO_lamp(0, 1);
			  time_dly(0x80);
			  IO_lamp(0, 0);
			  time_dly(0x80);
			 }
			IO_lamp(1, 0);
			EXTINT=0x08;
			}
		}

*/

	
}
	  
void irq_eint3_svr(void)
{	
	INT32U i,j=4;
/*
	INT32U temp=0x00100000;
	INT32U temp1=0x00010000;
	INT8U data=3;
	for(i=0;(i<4);i++)
	{
		IOCLR1 |=temp;
		IOSET1 |=0x00F00000-temp;		
		for(j=0,temp1=0x00010000;j<4;j++)
		{
			if((IOPIN1&temp1)==0)
			{	data=data+j*4-i;
				break;
			}
			temp1=temp1<<1;
		}
		temp*=2;
	}
	key_data=data;
	
	while((IOPIN1&0x000f0000)!=0x000f0000);
	
	IODIR1 |=0x00F00000;
	IOCLR1 |=0x00F00000;
	
*/
		 for(i=10;i>0;i--)
			{
		  IO_lamp(0, 1);
		  time_dly(0x80);
		  IO_lamp(0, 0);
		  time_dly(0x80);
		 }
		 
	EXTINT=0x08;
	VICVectAddr=0;

}	  
	  




⌨️ 快捷键说明

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