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

📄 keyset.c

📁 单片机控制FPGA的程序,包括AD转换,频率输出,测试程序
💻 C
字号:
#include"includes.h"

void dlms()					     //延时1ms
{
   unsigned int i;
   for(i=0;i<1900;i++);

}

unsigned char kbscan()
{
	unsigned char sccode,recode,temp;
	PRT0CF=0xff;
	P0=0xf0;	          //发全0行扫描码,列线输入
	PRT0CF=0x00;
	P0=0xff;	                          
	temp=P0;
	if((temp&0xf0)!=0xf0)					  
	{
	   dlms();
	   P0=0xff;
	   temp=P0;
	   if((temp&0xf0)!=0xf0)
	   {
	      sccode=0xfe;
		  while((sccode&0x10)!=0)
		  {
		    PRT0CF=0xff;
		    P0=sccode;
			PRT0CF=0x00;
			P0=0xff;
			temp=P0;
			if((temp&0xf0)!=0xf0)
			{
			   recode=(temp&0xf0)|0x0f;
			   return((~sccode)+(~recode));
		    }
			else
			sccode=(sccode<<1)|0x01;
		  }
	    }
	 }
	 return(0);



}

⌨️ 快捷键说明

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