GtDio6xSequencerSetSystemClockExternal

Applies To

GX5961, GX5964, File

Purpose

Sets the external system clock edge mode and offset parameters.

Syntax

GtDio6xSequencerSetSystemClockExternal (nHandle, nMode, nOffset, pnStatus);

Parameters

Name
Type
Comments
nHandle
SHORT
Session identifier:

     Board handle is used when communicating with the hardware. The Board handle session identifier is returned by calling GtDio6xInitialize or GtDio6xSetupInitialization.

     File handle is used when communicating with a file. The File handle session identifier is  returned by calling GtDio6xFileOpen.

nMode
SHORT
Sets the external system clock edge mode.

0.    GTDIO6X_EXT_SYS_CLK:  no signal conditioning.

1.  GTDIO6X_EXT_SYS_CLK_RISING_EDGE: Use the rising edge of the external signal as the active edge.

2.  GTDIO6X_EXT_SYS_CLK_FALLING_EDGE: Use the falling edge of the external signal as the active edge.

3.  GTDIO6X_EXT_SYS_CLK_BOTH_EDGES: Use the rising and falling edge of the external signal as the active edge.

4.    GTDIO6X_EXT_SYS_CLK_RISING_EDGE_DIV_BY_2: Use the rising edge of the external signal as the active edge divided by 2.

5.    GTDIO6X_EXT_SYS_CLK_FALLING_EDGE_DIV_BY_2 Use the falling edge of the external signal as the active edge divided by 2.

nOffset
SHORT
Sets the system clock offset (0-65534). The resolution is 1/2 the master clock period.
pnStatus
PSHORT
Returned status: 0 on success, negative value on failure.

Comments

The offset allows the user to shift the system clock in order to align the clock/data relationship.  The resolution is 1/2 the master clock period.

The clock edge mode is applicable only when the System Clock source is set to any non T0_CLK selection, see GtDio6xSequencerSetSystemClockSource API for details.

Example

The following example sets the system clock parameters with a Rising Edge mode and an offset of 0, and returns the settings:

 

SHORT nMode, nOffset;

SHORT nStatus;

GtDio6xSequencerSetSystemClockExternal(nHandle, GTDIO6X_EXT_SYS_CLK_RISING_EDGE, 0, &nStatus);

GtDio6xSequencerGetSystemClockExternal(nHandle, &nMode, &nOffset, &nStatus);

 

See Also

GtDio6xSequencerGetSystemClockExternal, GtDio6xSequencerSetSystemClockSource, GtDio6xSequencerGetSystemClockSource,  GtDio6xGetErrorString