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

📄 deviceinterface.h

📁 这个也是我们的毕业设计课题
💻 H
字号:
//DeviceInterface.h
//refer to BUSSystem.h relationshio between 
//DeviceInterface and BUSSystem
//Abstract class
//class DeviceInterface defination
//used for attach to sumulation system , and adapt 
//the speed
#if !defined(AFX_DEVICEINTERFACE1_H__0BC5CBC0_3E21_40CC_96C7_B348393157EA__INCLUDED_)
#define AFX_DEVICEINTERFACE1_H__0BC5CBC0_3E21_40CC_96C7_B348393157EA__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "type.h"
//declare classes that will be used in the class DeviceInterface
class BUSSystem;
class DeviceInterface
{
private:
	BYTE m_ndevicePort;
	BYTE m_ndeviceType;//0:byte device 1:blockdevice
	BOOL m_bBG;//BUS Grant inforamtion,it means the device
				//occupy the BUS if the value is TRUE
	BOOL m_bIORead;
	BOOL m_bIOWrite;
	BUSSystem* _busSystem;//for attaching to a BUSSystem
public:
	//construction/destruction
	DeviceInterface(){_busSystem=NULL;}
	~DeviceInterface(){_busSystem=NULL;}
	//attribute
	void SetDevicePort(BYTE ndevicePort);
	void SetDeviceType(BYTE ndeviceType);
	BYTE GetDevicePort();
	BYTE GetDeviceType();
	void SetIORead(BOOL bState){m_bIORead=bState;}//it will be called by the 
											//IOBUS's SetIORead() function
	void SetIOWrite(BOOL bState){m_bIOWrite=bState;}//it will be called by the 
											//IOBUS's SetIOWrite() function
	//operation
	void AccessDevice();
	BOOL RequestBUS();
	void WriteToAddrBUS();
	void ReadDataFromDataBus();
	void WriteDataToDataBus();
	void SetBUSSystem(BUSSystem* lpBUSSystem){_busSystem=lpBUSSystem;}
};
#endif // !defined(AFX_DEVICEINTERFACE1_H__0BC5CBC0_3E21_40CC_96C7_B348393157EA__INCLUDED_)

⌨️ 快捷键说明

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