Appendix A
Appendix A
DIO (Digital I/O) Sample Code
//============================================
//BEM-100Q DOS DIO sample program
//Please compile with Turbo C 3.0 to utilized the program
//============================================
int RetVal;
//init the chipset
RetVal=inp(0x4B0);
RetVal=RetVal|0x02;
outp(0x4B0,RetVal);
RetVal=inp(0x481,RetVal);
RetVal=RetVal|0xF0;
outp(0x481,RetVal);
RetVal=inp(0x480,RetVal);
RetVal=RetVal|0xC0;
outp(0x480,RetVal);
RetVal=inp(0x4B4,RetVal);
RetVal=RetVal|0x01;
outp(0x4B4,RetVal);
RetVal=inp(0x485,RetVal);
RetVal=RetVal&0x0F;
outp(0x485,RetVal);
RetVal=inp(0x485,RetVal);
RetVal=RetVal|0x02;
outp(0x485,RetVal);
RetVal=inp(0x484,RetVal);
RetVal=RetVal|0xC0;
outp(0x484,RetVal);
//reset the output pins to zero