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

📄 parallelport.h

📁 51isp下载软件,使用非常方便。非常适应初学者制作使用
💻 H
字号:
// ParallelPort.h: interface for the CParallelPort class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PARALLELPORT_H__1B0F3FEB_2971_4B5F_8859_048A50435C21__INCLUDED_)
#define AFX_PARALLELPORT_H__1B0F3FEB_2971_4B5F_8859_048A50435C21__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define	PIN_STROBE 1
#define PIN_AUTO   14
#define	PIN_D0	   2
#define	PIN_D1	   3
#define	PIN_D2	   4
#define	PIN_D3	   5
#define	PIN_D4	   6
#define	PIN_D5	   7
#define	PIN_D6	   8
#define	PIN_D7	   9
#define PIN_ERROR  15
#define PIN_INIT   16
#define PIN_SELIN  17
#define PIN_ACK	   10
#define PIN_BUSY   11
#define PIN_PE	   12
#define PIN_SLCT   13


class CParallelPort  
{
public:
	BOOL SetPinLogic(int nPin,BOOL bLogic);
	//设置指定引脚,bLogic=1高电平,bLogic=0低电平
	BOOL GetPinLogic(int nPin);//得到指定引脚的电平
	BOOL SetPinL(int nPin);//设置指定引脚为低电平
	BOOL SetPinH(int nPin);//设置指定引脚为高电平
	WriteData(BYTE Data);//写数据口
	BYTE ReadData();//读数据口
	WriteCtrl(BYTE Ctrl);//写控制字
	BYTE ReadCtrl();//读控制字
	BYTE ReadState();//读状态字
	CString m_strDrivePath;//驱动程序所在路径
	BYTE m_CtrlByte,m_DataByte,m_StatByte;
	//保存当前的数据字,状态字,控制字
	unsigned short m_nCtrlPort,m_nDataPort,m_nStatPort;//端口地址
	BOOL m_bWin98;//是否是win9x
	BOOL InitPort(int nPort=0x378);
	CParallelPort();
	virtual ~CParallelPort();
};

#endif // !defined(AFX_PARALLELPORT_H__1B0F3FEB_2971_4B5F_8859_048A50435C21__INCLUDED_)

⌨️ 快捷键说明

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