📄 123dlg.cpp
字号:
// 123Dlg.cpp : implementation file
//
#include "stdafx.h"
#include "123.h"
#include "123Dlg.h"
//
#include <ceddk.h>
#pragma comment(lib,"ceddk.lib")
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMy123Dlg dialog
CMy123Dlg::CMy123Dlg(CWnd* pParent /*=NULL*/)
: CDialog(CMy123Dlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CMy123Dlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CMy123Dlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMy123Dlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMy123Dlg, CDialog)
//{{AFX_MSG_MAP(CMy123Dlg)
ON_BN_CLICKED(IDC_BUTTON1, OnGPIOTest)
ON_BN_CLICKED(IDC_BUTTON2, OnButClose)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMy123Dlg message handlers
BOOL CMy123Dlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
CenterWindow(GetDesktopWindow()); // center to the hpc screen
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
}
void CMy123Dlg::OnGPIOTest()
{
// TODO: Add your control notification handler code here
unsigned char *gpio_base;
unsigned int *gpio_PADDR, *gpio_PADR;
OutputDebugString(L"TestDrv - LedDrive1\n");
//PUCHAR ioPortBase;
PHYSICAL_ADDRESS PortAddress = {0x80840000, 0};
gpio_base =(PUCHAR) MmMapIoSpace( PortAddress, 0x80,FALSE );
gpio_PADR = (unsigned int *)(gpio_base + 0x00);
gpio_PADDR = (unsigned int *)(gpio_base + 0x10);
for(int x = 0; x< 20 ; x++)
{
*gpio_PADDR = 0xffffffff; // set port E to all output
*gpio_PADR ^= 0x0000003a ; // invert green LED state
Sleep(1000);
}
}
void CMy123Dlg::OnButClose()
{
// TODO: Add your control notification handler code here
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -