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

📄 read.c

📁 此程序是基于c8051f020平台实现的是等精度频率计的测量控制部分
💻 C
字号:
#include<c8051f020.h>
//#include "hao.h"
#define uint unsigned int
#define uchar unsigned char
#define ulong unsigned long int

sbit sel0=P2^0;
sbit sel1=P2^1;
sbit sel2=P2^2;
sbit cl=P2^3;
sbit clr=P2^4;
sbit spul=P2^5;
sbit start=P2^6;
sbit eend=P2^7;
ulong std_num;
ulong test_num;
	
ulong read_std_num()
{
   uint std_num0=0,std_num1=0,std_num2=0,std_num3=0;
   sel2=0;
   sel1=0;
   sel0=0;
   std_num0=P0;	
   sel2=0;
   sel1=0;
   sel0=1;
   std_num1=P0;
   sel2=0;
   sel1=1;
   sel0=0;
   std_num2=P0;
   sel2=0;
   sel1=1;
   sel0=1;
   std_num3=P0;
   std_num=(std_num3<<24)+(std_num2<<16)+(std_num1<<8)+std_num0;
   return(std_num);			
}

ulong read_test_num()
{
   uint test_num0,test_num1,test_num2,test_num3;
   sel2=1;
   sel1=0;
   sel0=0;
   test_num0=P0;	
   sel2=0;
   sel1=0;
   sel0=1;
   test_num1=P0;
   sel2=0;
   sel1=1;
   sel0=0;
   test_num2=P0;
   sel2=0;
   sel1=1;
   sel0=1;
   test_num3=P0;
   test_num=(test_num3<<24)+(test_num2<<16)+(test_num1<<8)+test_num0;
   return(test_num);			
}

⌨️ 快捷键说明

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