# d_config_port()

Configures a digital port as input or output.

This function is for use with ports that may be programmed as input or output, such as those on the 82C55 chips and 8536 chips. Refer to the 82C55A data sheet (82C55A.pdf) for details of chip operation. This document is installed in the Documents subdirectory where the UL is installed. Refer to the Zilog 8536 manual for details of 8536 chip operation.

## Prototype

d_config_port(board_num, port_type, direction)

## Parameters

board_num (int)

The number associated with the board when it was installed with InstaCal or created with create_daq_device().

port_type (DigitalPortType)

The port to configure. The port must be configurable. For most boards, AUXPORT is not configurable. Refer to board-specific information to see if your hardware has configurable ports.

direction (DigitalIODirection)

DigitalIODirection.OUT or DigitalIODirection.IN configures the entire eight or four bit port for output or input.

## Notes

When used on ports within an 8255 chip, this function will reset all ports on that chip configured for output to a zero state. This means that if you set an output value on FIRSTPORTA and then change the configuration on FIRSTPORTB from OUTPUT to INPUT, the output value at FIRSTPORTA will be all zeros. You can, however, set the configuration on SECONDPORTx without affecting the value at FIRSTPORTA. For this reason, this function is usually called at the beginning of the program for each port requiring configuration.