Gx3756SerialOutSetShiftMode

Purpose

Sets the specified serial-out channel number shift out mode.

Syntax

Gx3756SerialOutSetShiftMode (nHandle, nChannel, nShiftMode, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX3756 board.
nChannel
SHORT
Channel to Set, channels are 0-3 board based (channels 0-3 in group 0):
0.      GX3756_SERIAL_CH0: Channel 0.
1.      GX3756_SERIAL_CH1: Channel 1.
2.      GX3756_SERIAL_CH2: Channel 2.
3.    GX3756_SERIAL_CH3: Channel 3.
nShiftMode
SHORT
Returns the specified serial-out channel number shift out mode, shift out mode are:
0.      GX3756_SERIAL_SHIFT_MODE_LEFT_MSB_FIRST: shifting data out left stating from the MSB.
1.    GX3756_SERIAL_SHIFT_MODE_RIGHT_FIRST: shifting data out right stating from the LSB.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

Channels 0-3 (Group 0) can be programmed to operate as serial-out transmitter or as static I/O, see Gx3756SerialOutSetMode() API for more details. When any of Channels 0-3 (Group 0) are set to Serial-out, all 4 channels direction is set to output.

Channels 3-7 (Group 1) can be programmed as an external trigger source to channels 0-3 (Group 0), when they are set to serial-out operation mode. See Gx3756SerialOutSetMode(), and Gx3756SerialOutGetTriggerSource() APIs for more details.

Example

See the Gx3756SerialOutGetStatus () API for complete example.

The following example sets the specified serial-out channel number 0 shift out mode:

 

SHORT nHandle, nStatus;

SHORT nShiftMode;

Gx3756SerialOutGetShiftMode (nHandle, GX3756_SERIAL_CH0, GX3756_SERIAL_SHIFT_MODE_RIGHT_FIRST, &nStatus);

 

See Also

Gx3756SerialOutReset, Gx3756SerialOutSetArmState, Gx3756SerialOutSetBitRate, Gx3756SerialOutSetData, Gx3756SerialOutSetDataBitsPulseWidth, Gx3756SerialOutSetTriggerSource, Gx3756SerialOutSetMode, Gx3756SerialOutSetNumOfDataBits, Gx3756SerialOutGetShiftMode, Gx3756SerialOutSetTriggerDelay, Gx3756SerialOutSetTriggerSource, Gx3756SerialOutTrig, GxFpgaGetErrorString