Returns the direction (input or output) settings of a selected digital port.
Gx3788PioGetPortDirection (nHandle, nPort, pdwDirection, pnStatus)
Name |
Type |
Comments |
nHandle |
SHORT |
Handle to a GX3788 board. |
nPort |
SHORT |
Select the digital port to get:0. GX3788_PIO_PORT0: Digital Port 0.1. GX3788_PIO_PORT1: Digital Port 1.2. GX3788_PIO_PORT2: Digital Port 2. |
pdwDirection |
PDWORD |
Returns the direction settings of the selected digital port:0. GX3788_PIO_PORT_DIRECTION_IN: Digital channel is an input.1. GX3788_PIO_PORT_DIRECTION_OUT: Digital channel is an output. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
Digital Port 0 contains the positive 32 channels of the 32 differential pairs.
Digital Port 1 contains the negative 32 channels of the 32 differential pairs.
Digital Port 2 contains the 32 single-ended channels.
The following example sets channels 0 to 4 of digital port 0 to output and channels 5 to 31 to input, and returns the settings:
SHORT nStatus;
DWORD dwDirection;
Gx3788PioSetPortDirection (nHandle, GX3788_PIO_PORT0, 0x1F, &nStatus);
Gx3788PioGetPortDirection (nHandle, GX3788_PIO_PORT0, &dwDirection, &nStatus);
Gx3788PioReadPort, Gx3788PioReadPortChannel, Gx3788PioResetPort, Gx3788PioResetPortChannel, Gx3788PioSetPort, Gx3788PioSetPortChannel, Gx3788PioSetPortChannelDirection, Gx3788PioSetPortDirection, GxFpgaGetErrorString