(Page 6 of 28 in this chapter)


swiConfigBoardClock

Description

Establishes the clock source for an MVIP board.

Prototype

DWORD swiConfigBoardClock ( SWIHD swihd,
SWI_CLOCK_ARGS *args)

swihd Handle returned by swiOpenSwitch.

args Pointer to a clock parameter structure for configuring the MVIP board clock. The SWI_CLOCK_ARGS structure is:

typedef struct
{
DWORD size;
DWORD clocktype;
DWORD clocksource;
DWORD network;

union
{
struct
{
DWORD mc1clockmode;
DWORD autofallback;
} mc1; /* only for MC1 */
} ext; /* specific extensions per board based on clocktype */
} SWI_CLOCK_ARGS;
See the Details section for a description of these fields.

Return Values

Events

Details

This function establishes the clock source for an MVIP board. This single function supports clock configuration for all standard MVIP boards as well as MC1, MC2, MC3, MC4, and future generations of MVIP boards.

The size, clocktype, clocksource, and network fields of the SWI_CLOCK_ARGS structure are identical across all board types.

Field

Description

size

Specifies the number of bytes contained in the structure. If size is less than the size of SWI_CLOCK_ARGS, the command will only use the number of bytes specified by size. If size is greater than the size of SWI_CLOCK_ARGS, size will be set to the size of SWI_CLOCK_ARGS, and the command will use this number of bytes.

clocktype

Specifies the MVIP standard to which clocking on the board applies. Acceptable clocktype values are:
MVIP95_STD_CLOCKING
MVIP95_MC1_CLOCKING
MVIP95_MC2_CLOCKING
MVIP95_MC3_CLOCKING
MVIP95_MC4_CLOCKING

clocksource

Specifies where the clock reference originates. Acceptable values for clocksource are:
MVIP95_SOURCE_INTERNAL
MVIP95_SOURCE_SEC8K
MVIP95_SOURCE_MVIP
MVIP95_SOURCE_NETWORK
Additional values for clocksource for MC1 boards are:
MVIP95_SOURCE_8KREF
MVIP95_SOURCE_MC1_LEFT
MVIP95_SOURCE_MC1_RIGHT

network

Specifies the device source for the MVIP clock signals.
Acceptable values for network are 1 to n where n is the number of devices on the specified board capable of being a clock source. A value for network is valid only when clocksource is equal to MVIP95_SOURCE_NETWORK.

The extension part of the SWI_CLOCK_ARGS structure is a union that currently only has a structure for MC1 boards. Further evolution of MVIP and standardization work will modify this part of the SWI_CLOCK_ARGS structure.

Field

Description

mc1clockmode

Specifies the board's control of the MC1 clocks. Acceptable values for mc1clockmode are:

MVIP95_MC1_SLAVE
MVIP95_MC1_MASTER_LEFT
MVIP95_MC1_MASTER_RIGHT
MVIP95_MC1_SLAVE_NO_MVIP_CLK
MVIP95_EXT_MC1_MASTER_LEFT_NO_MVIP_CLK
MVIP95_EXT_MC1_MASTER_RIGHT_NO_MVIP_CLK

autofallback

Specifies whether the board is to automatically switch to fallback mode and become a slave to the alternate MC1 clock. Acceptable values for autofallback are:

MVIP95_MC1_DISABLE_AUTO_FB
MVIP95_MC1_ENABLE_AUTO_FB

Refer to Chapter 5 for more information about configuring clocks.

If CTAERR_DRIVER_ERROR is returned, call swiGetLastError to retrieve the MVIP device error code.

See Also

swiConfigSec8KClock, swiConfig8KRefClock, swiGetLastError

Example


void myAGT1ClockFallback(SWIHD t1hd)
{
SWI_CLOCK_ARGS boardclock;

/* Make AG-T1 sync off SEC8K */
boardclock.size = sizeof(SWI_CLOCK_ARGS);
boardclock.clocktype = MVIP95_STD_CLOCKING;
boardclock.clocksource = MVIP95_SOURCE_SEC8K;
swiConfigBoardClock(t1hd, &boardclock);
}


(Page 6 of 28 in this chapter)


tech_support@nmss.com
Copyright © 1997, Natural MicroSystems, Inc. All rights reserved.