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

📄 parportmodedlg.h

📁 可以用于各种并口方式(SPP,EPP,ECP)的读写测试。
💻 H
字号:
// ParPortModeDlg.h : header file
//

#if !defined(AFX_PARPORTMODEDLG_H__C7BBA647_02F0_11D8_A589_00485467F99D__INCLUDED_)
#define AFX_PARPORTMODEDLG_H__C7BBA647_02F0_11D8_A589_00485467F99D__INCLUDED_

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

////////////////////////////////////////
#define SYS_ADDR_LOW            0x00
#define SYS_ADDR_HIGH           0x01
#define SYS_DATA_ADDR           0x02

#define BASE_ADDR              0x278
#define Status_ADDR            0x279
#define CTRL_ADDR              0x27A
#define EPP_ADDR               0x27B
#define EPP_DATA               0x27C
#define ECP_ADDR               0x278
#define ECP_DATA               0x678
#define ECR_ADDR               0x67A
//////////////////////
#define NOT_SELECT              -1
#define SPP_MODE                0
#define EPP_MODE                1
#define ECP_MODE                2

/////////////////////////////////////////////////////////////////////////////
// CParPortModeDlg dialog

class CParPortModeDlg : public CDialog
{
// Construction
public:
	CParPortModeDlg(CWnd* pParent = NULL);	// standard constructor

	HINSTANCE hLib;

// Dialog Data
	//{{AFX_DATA(CParPortModeDlg)
	enum { IDD = IDD_PARPORTMODE_DIALOG };
	CStatic	m_Static_EcpRead;
	CEdit	m_Edit_EcpWrite;
	CStatic	m_Static_EppRead;
	CEdit	m_Edit_EppWrite;
	CStatic	m_Static_SppRead;
	CEdit	m_Edit_SppWrite;
	CStatic	m_Static_Status7;
	CStatic	m_Static_Status6;
	CStatic	m_Static_Status5;
	CStatic	m_Static_Status4;
	CStatic	m_Static_Status3;
	CStatic	m_Static_Status2;
	CStatic	m_Static_Status1;
	CStatic	m_Static_Status0;
	CStatic	m_Static_Ctrl5;
	CStatic	m_Static_Ctrl4;
	CStatic	m_Static_Ctrl3;
	CStatic	m_Static_Ctrl2;
	CStatic	m_Static_Ctrl1;
	CStatic	m_Static_Ctrl0;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CParPortModeDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	void  EnableBttn(BOOL status);
    void  EnableModeReadWriteBttn(int iMode);

	long  String_To_Hexa(char * buffer);
    BOOL  CheckStatusBusyBit() ;

	void  Set_SppCompatibleWriteMode();
	void  Set_SppNibbleReadMode();
	void  Set_SppByteReadMode();

    BOOL  CheckByteMode_PtrClkBit();
    BOOL  CheckStatusTimeOutBit();

	BOOL  EppAddrWriteByteToPort(BYTE bData);
	BOOL  EppDataWriteByteToPort(BYTE bData);

	BOOL  CheckEcpMode_PeriphClkBit();

	// Generated message map functions
	//{{AFX_MSG(CParPortModeDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnButtonOpenLib();
	afx_msg void OnButtonCloseLib();
	afx_msg void OnRadioSpp();
	afx_msg void OnRadioEpp();
	afx_msg void OnRadioEcp();
	afx_msg void OnButtonCtrlport();
	afx_msg void OnButtonStatusport();
	afx_msg void OnButtonSppwrite();
	afx_msg void OnButtonNibbleRead();
	afx_msg void OnButtonByteRead();
	afx_msg void OnButtonEppWrite();
	afx_msg void OnButtonEppRead();
	afx_msg void OnButtonEcpWrite();
	afx_msg void OnButtonEcpRead();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_PARPORTMODEDLG_H__C7BBA647_02F0_11D8_A589_00485467F99D__INCLUDED_)

⌨️ 快捷键说明

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