GtDio6xSequencerGetSystemClockExternal

Applies To

GX5961, GX5964, File

Purpose

Returns the external system clock edge mode and offset parameters.

Syntax

GtDio6xSequencerGetSystemClockExternal (nHandle, pnMode, pnOffset, 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.

pnMode
PSHORT
Returns 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.

pnOffset
PSHORT
Returns 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

GtDio6xSequencerSetSystemClockExternal, GtDio6xSequencerSetSystemClockSource, GtDio6xSequencerGetSystemClockSource, GtDio6xGetErrorString