Winmate ID31 User Manual page 91

3.5” fanless sbc with intel atom dual core n2600 1.6 ghz, vga, lvds, dual giga ethernet, and mini-pcie interface
Hide thumbs Also See for ID31:
Table of Contents

Advertisement

USER MANUAL
APPENDIX A
DIGITAL I/O SAMPLE CODE
ucBuf = Get_W83627EHG_Reg(0x29); Set_W83627EHG_Reg(0x29,ucBuf|0x01);
// Bit0 = 0 -> GPIO1 is inactive.
// Bit1 = 1 -> Activate GPIO1.
ucBuf = Get_W83627EHG_Reg(0x30);
Set_W83627EHG_Reg(0x30,ucBuf|0x01);//Activate GPIO1
Set_W83627EHG_Reg(0xF0,0x0F);//switch GPIO Input(1)/Output(0) port
Set_W83627EHG_Reg(0xF1, 0x00); //clear
ucDI = Get_W83627EHG_Reg(0xF1) & 0x0F; ClrKbBuf();
while(1)
{
ucDO++;
Set_W83627EHG_Reg(0xF1, ((ucDO & 0x0F) << 4));
ucBuf = Get_W83627EHG_Reg(0xF1) & 0x0F; if (ucBuf != ucDI)
{
ucDI = ucBuf;
printf("Digital I/O Input Changed. Current Data is 0x%X\n",ucDI);
}
if (kbhit())
{
getch(); break;
}
delay(500);
}
return 0;
}
//============================================================
void ClrKbBuf(void)
{
while(kbhit())
{ getch(); }
} ID31 Motherboard User Manual
73
ID31 Motherboard User Manual / Engineering Spec.
ID31 MOTHERBOARD
83

Advertisement

Table of Contents
loading

Table of Contents