B&B Electronics PPIO manual Void SetIRQOffvoid Outport ControlAddress

Page 21

The function, Set_IRQ_OFF(), tells the parallel port not to generate any interrupts. This should be called immediately after Set_Start(). It is defined as:

void Set_IRQ_Off(void)

{

outport (Control_Address, 0x04);

}

The function, In_Byte(), returns the value of the variable, Input_Byte. It is defined as:

unsigned int In_Byte(void)

{

return (Input_Byte);

}

Notice that this does not read the value of the parallel port. The function Read_Input_Bit() reads the port.

The function, Out_Byte(), returns the value of the variable Output_Byte. It is defined as:

unsigned int Out_Byte(void)

{

return (Output_Byte);

}

Notice that this does not read the parallel port, it only returns the value of Output_Byte.

The function, Read_Input_Bit(), returns the status of the specified input line. The function is defined as:

boolean Read_Input_Bit(unsigned char Line_Number)

{

Input_Byte = (inport(Status_Address) & 0xF0) (inport(Control_Address) & 0x0F);

return ( ((Input_Byte & (1 << Line_Number)) != 0) );

}

PPIO2899 Manual

19

B&B Electronics Mfg Co Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104

Image 21
Contents Not Recommended for New Installations Table of Contents Introduction Packing List PC Parallel Port Description Page BIT PPIO2899 Manual Ppio Description & Connection PPIO2899 Manual Controlling the Ppio Using Gwbasic Bit Force I/O on Force I/O OFF Low High Page Begin Controlling the Ppio Using PascalElse Mask Value Function OutputBit BitNumberBYTE Byte Procedure SetOutputBit BitNumber,OutputBYTE XOR Controlling the Ppio Using C Void SetIRQOffvoid Outport ControlAddress Mask Value Page Page New PPIO2899 Manual Page Interfacing to the Ppio PPIO2899 Manual Example USE of the Ppio Page REM IB is the Input Byte and OB is the Output Byte Appendix Hexadecimal NumbersBinary Numbers