B&B Electronics PPIO manual Else

Page 15

PROCEDURE Set_IRQ_Off;

BEGIN

PORT[Control_Address] := $04;{Write 4 to disable IRQ}

END; {Set_IRQ_Off}

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

FUNCTION In_Byte : Byte;

BEGIN

In_Byte := Input_Byte;

End; { In_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:

FUNCTION Out_Byte : Byte;

BEGIN

Out_Byte := Output_Byte;

End; { Out_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:

FUNCTION Read_Input_Bit (Bit_Number:BYTE) : BYTE;

BEGIN

Input_Byte := (PORT[Status_Address] AND $F0)

OR (PORT[Control_Address] AND $0F) ;

IF ( (Input_Byte AND (1 SHL Bit_Number) ) = 0 ) THEN

Read_Input_Bit := 0

ELSE

Read_Input_Bit := 1;

END; {Read_Input_Bit}

PPIO2899 Manual

13

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

Image 15
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