Table of Contents Index NMS Glossary Previous Page Next Page (Page 13 of 29 in this chapter) Version


swiGetBoardClock

Description

Retrieves information regarding the configuration of the board clocking and current status of the clocks.

Prototype

DWORD swiGetBoardClock ( SWIHD swihd,
DWORD clocktype,
SWI_QUERY_CLOCK_ARGS *args,
unsigned size )

swihd Handle returned by swiOpenSwitch.

clocktype Specifies the MVIP standard to which clocking on the board applies. Refer to the Details section for acceptable values.

args Pointer to a clock parameter structure for querying the CT Bus board clock. The SWI_QUERY_CLOCK_ARGS structure is:

typedef struct
{
    DWORD size;
    DWORD clocktype;
    DWORD clocksource;
    DWORD network;
    union
    {
       struct
       {
            DWORD mc1clockmode;
    DWORD autofallback;
    DWORD fallbackoccurred;
       } mc1;  /* only for MC1*/

       struct
       {
            DWORD clockmode;
    DWORD autofallback;
    DWORD fallbackoccurred;
    DWORD clockstatus_a;
    DWORD clockstatus_b;
    DWORD clockstatus_netref1;
    DWORD clockstatus_netref2;
   }h100; /* only for h100 */

    } ext; /* extension, specific parts for each board, based on
              clocktype */
} SWI_QUERY_CLOCK_ARGS;
Refer to the Details section for a description of these fields.

size Specifies the number of bytes contained in the structure.

Return Values

Events

None.

Details

This function retrieves information about the configuration of the board clocking and the current status of the clocks for a CT Bus board.

The current code supports only H.100/H.110.

Acceptable values for clocktype are:

MVIP95_STD_CLOCKING
MVIP95_H100_CLOCKING

The clocksource and network fields of the SWI_QUERY_CLOCK_ARGS structure are identical across all board types.
Field

Description

clocksource

Specifies where the clock reference originates.

Acceptable values for clocksource are:
MVIP95_SOURCE_INTERNAL
MVIP95_SOURCE_NETWORK

Additional values for clocksource for H.100/H.110 boards are:
MVIP95_SOURCE_H100_A
MVIP95_SOURCE_H100_B
MVIP95_SOURCE_H100_NETREF
MVIP95_SOURCE_H110_NETREF_1
MVIP95_SOURCE_H110_NETREF_2

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 fields that are specific to the H.100/H.110 boards are described in the following table:
Field

Description

clockmode

Indicates the board's control of the H.100/H.110 clocks.

Acceptable values for clockmode are:
MVIP95_H100_SLAVE
MVIP95_H100_MASTER_A
MVIP95_H100_MASTER_B
MVIP95_H100_STAND_ALONE

autofallback

Indicates whether the board is set to automatically switch to fallback mode and become a slave to the alternate H.100/H.110 clock.

Acceptable values for autofallback are:
MVIP95_H100_DISABLE_AUTO_FB
MVIP95_H100_ENABLE_AUTO_FB

fallbackoccurred

Indicates whether the board has detected the primary clock signal, has become unreliable, and has fallen back to the secondary reference.

Acceptable values for fallbackoccurred are:
MVIP95_H100_NO_FALLBACK_OCCURRED
MVIP95_H100_FALLBACK_OCCURRED

clockstatus_a

Reports the quality of the A clock master signal.

Acceptable values for clockstatus_a are:
MVIP95_CLOCK_STATUS_GOOD
MVIP95_CLOCK_STATUS_BAD
MVIP95_CLOCK_STATUS_UNKNOWN

clockstatus_b

Reports the quality of the B clock master signal.

Acceptable values for clockstatus_b are:
MVIP95_CLOCK_STATUS_GOOD
MVIP95_CLOCK_STATUS_BAD
MVIP95_CLOCK_STATUS_UNKNOWN

clockstatus_netref1

Reports the quality of the NETREF (H.100) or NETREF_1 (H.110) clock signal.

Acceptable values for clockstatus_netref1 are:
MVIP95_CLOCK_STATUS_GOOD
MVIP95_CLOCK_STATUS_BAD
MVIP95_CLOCK_STATUS_UNKNOWN

clockstatus_netref2

Reports the quality of the NETREF_2 (H.110 only) clock master signal.

Acceptable values for clockstatus_netref2 are:
MVIP95_CLOCK_STATUS_GOOD
MVIP95_CLOCK_STATUS_BAD
MVIP95_CLOCK_STATUS_UNKNOWN

Refer to Chapter 4 for more information about querying clocks.

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

See Also

swiConfigBoardClock, swiGetLastError, swiOpenSwitch

Example


void myGetClock (SWIHD swihd)
{
SWI_QUERY_CLOCK_ARGS queryclock;
DWORD clocktype;
unsigned size;

size = sizeof (SWI_QUERY_CLOCK_ARGS);
swiGetBoardClock (swihd, clocktype, &queryclock, size);
}
}


Table of Contents Index NMS Glossary Previous Page Next Page (Page 13 of 29 in this chapter) Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights reserved.