JHCTech FEBC-3158 User Manual page 60

Table of Contents

Advertisement

void CL706_GPIO_TESTDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CL706_GPIO_TESTDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
BOOL CL706_GPIO_TESTDlg::DestroyWindow()
{
// TODO: Add your specialized code here and/or call the base class
ShutdownWinIo();
KillTimer(1);
return CDialog::DestroyWindow();
}
void CL706_GPIO_TESTDlg::Gpio2_Out_detect()
{
//set GPIO is enabled GPIO68 69 70 71 27 57 58 75
SetPortVal(0x540, 0xF0, 1); //GPIO68 69 70 71
SetPortVal(0x541, 0x08, 1); //GPIO75
SetPortVal(0x503, 0x3F, 1); //GPIO27
SetPortVal(0x533, 0x16, 1); //GPIO57 58
//set GPIO is ouput
User's Manual
53

Advertisement

Table of Contents
loading

Table of Contents