Input_Byte = inp( Control_Address ) & 0x0F;
if( (Input_Byte & Output_Byte) == Output_Byte )
{
status = 0x01;
}
}
/* Restore the state of the digital outputs */
Output_Byte = old_value;
outp( Base_Address, Output_Byte );
return (status);
}
This function writes A0h to the upper four digital outputs, then verifies that the digital output lines are in that state. Then it writes 50h to the upper four digital outputs and verifies that the digital outputs are in set properly. The lower four digital outputs are checked in a similar manner with the values 0Ah and 05h.
NOTE: If the PPIO is connected properly and the upper four outputs (4 - 7) are functional, but the lower four outputs (0 - 3) are not functional, the parallel port may be in ECP or EPP mode. It must be in “compatible” or “normal” mode for the PPIO to work properly. The mode of the parallel port can be changed in the BIOS setup by pressing either the F2 key or DEL key just after the computer begins the boot procedure.
For an example of an application that uses these functions, look at the source code in PPIO.C.
PPIO2899 Manual | 25 |
B&B Electronics Mfg Co Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph