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

📄 base_io.c

📁 Six objects here: The document you re reading & its Chinese version Set of "HWDesign" includes
💻 C
字号:
#include <reg51.h>	//SFR declarations
#include "base_io.h"
#include "mainloop.h"

extern EPPFLAGS bEPPflags;

void outportb(unsigned int Addr,unsigned char Data)	//send to D12
{
	switch (Addr)	//in fact,'Addr' should be described as 'Command or Data select word'
	{
		case D12_Command:	//send command-byte to D12
			A0c=D12_Command;
			break;
		case D12_Data:	//send data-byte to D12
			A0c=D12_Data;
			break;
	}

	WRc=0;	//Write immediately
	do {if (1+1==2);} while(0);
	P0=Data;
	do {if (1+1==2);} while(0);
	WRc=1;	//enclose
}

unsigned char inportb(unsigned int Addr)	//receive from D12
{
unsigned char tmpData;
	switch (Addr)	//in fact,'Addr' should be described as 'Command or Data select word'
	{
		case D12_Command:
			A0c=D12_Command;
			break;
		case D12_Data:
			A0c=D12_Data;
			break;
	}
	
	RDc=0;	//Read immediately
	do {if (1+1==2);} while(0);
	tmpData=P0;
	do {if (1+1==2);} while(0);
	RDc=1;	//enclose
	return tmpData;
}

⌨️ 快捷键说明

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