B&B Electronics PPIO manual Void SetIRQOffvoid Outport ControlAddress

Models: PPIO

1 34
Download 34 pages 1.88 Kb
Page 21
Image 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

Page 21
Image 21
B&B Electronics PPIO manual Void SetIRQOffvoid Outport ControlAddress