Gx3748ResistorsGetStates

Purpose

Returns the specified group channel resistor type (pullup or pulldown) state.

Syntax

Gx3748ResistorsGetStates (nHandle, nType, nGroup, pnResistorStates, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle for a GX3748 board.
nType
SHORT
Specified resistor type:
0.      GX3748_RESISTOR_TYPE_PULLUP: pullup resistor.
1.    GX3748_RESISTOR_TYPE_PULLDOWN: pulldown resistor.
nGroup
SHORT
Group number as follows:
0.      GX3748_GROUP0: J1 input connector pins 2 to 17.
1.      GX3748_GROUP1: J1 input connector pins 23 to 38.
2.    GX3748_GROUP2: J1 input connector pins 44 to 59.
pnResistorStates
PSHORT

Returns all the specified group channels resistor type (pullup or pulldown) states. Each bit represents a channel, e.g. ch 0 bit 0, ch 1 bit 1 etc.

Bit low: resistor is disconnected.

Bit high: resistor is connected.  

pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

The function returns all the specified group channels resistor type (pullup or pulldown) states.

All pullup and pulldown resistors are 10KOhms.

Example

The following example disconnect all resistors, Connect Group 0 channels 0, 2, 4, 6 pullups, and return the resistor state:

 

SHORT nHandle, nStatus;

SHORT nResistorStates;

 

Gx3748ResistorsReset (nHandle, &nStatus);

Gx3748ResistorsSetStates (nHandle, GX3748_RESISTOR_TYPE_PULLUP, GX3748_GROUP0, GX3748_GROUP_CH1, 0x55, &nStatus);

Gx3748ResistorsGetStates (nHandle, GX3748_RESISTOR_TYPE_PULLUP, GX3748_GROUP0, GX3748_GROUP_CH1, &nResistorStates, &nStatus);

 

See Also

Gx3748ResistorsReset, Gx3748ResistorsSetState, Gx3748ResistorsSetStates, GxFpgaGetErrorString