deviceinterface.h

来自「这个也是我们的毕业设计课题」· C头文件 代码 · 共 48 行

H
48
字号
//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 + =
减小字号Ctrl + -
显示快捷键?