7.2 Opening the AG Driver

(Page 3 of 11 in this chapter)
This section describes how to access AG boards. The following functions are discussed in this section.

Function

Description

adiOpenDriver

Gains access to AG boards.

adiCloseDriver

Closes an open driver.

adiFetchAndProcess

Retrieves event from AG driver and processes it.

adiGetBoardInfo

Retrieves information about an AG board.

adiGetBoardSlots

Retrieves the board's MVIP configuration.

In order to communicate with an AG board, the application must first open the AG driver. The AG driver provides physical access to all AG boards in the host computer. The function adiOpenDriver invokes the AG driver open procedure and is prototyped below.

#include <adi.h>

EXTRET adiOpenDriver ( 
     		unsigned		*drvid,		/* ADI Drv Handle */
   		MUX_HANDLE		*muxid ); 		/* OS MUX Handle  */
AG Access returns a drvid (driver handle) which is used when communicating with AG boards. The application supplies the driver handle to AG Access when invoking the following functions:

The muxid (mux handle) is an operating system (OS) specific object used by the application process to wait for events, as described below:

The application passes the muxid to an OS wait routine, e.g., UNIX poll(), when it is ready to wait for and process AG Access events. The AG driver awakens the application when an event arrives from the AG board.

To promote portability, AG Access typecasts the mux handle to a MUX_HANDLE.

After the driver is open, the application can read the hardware configuration for each board in the system. The adiGetBoardInfo function returns information about the board such as its product name. The adiGetBoardSlots function returns the current MVIP address configuration.


(Page 3 of 11 in this chapter)

Copyright 1996 Natural MicroSystems, Inc. All Rights Reserved.