Before initializing the driver handles environment variables must first be set.
The driver expects to operate in a VxWorks hosted environment with a VME bus interface. Several parameters specific to VME are passed to the driver using VxWorks envinronment variables. These variables include the VME address, VME IRQ level and VME IRQ vector for each LAT COMM I/O Board
In addition to the VME parameters the LATp source address is also specified as an environment variable.
The following is an excerpt from a VxWorks startup script, specifying the required environment variables:
# global "ENV" variables
# LATpSourceAddr -- arbitrary 5 bit integer
putenv ("GTEM_LATP_SOURCE_ADDR=5");
### Command Response COMM Board Setup ###
# VME physical address -- corresponds to jumper block on
# COMM I/O Board, connector SW1 and SW2.
putenv ("GTEM_VME_ADDRESS=0x08000000")
# VME IRQ level -- make sure does not conflict with any other VME modules
putenv ("GTEM_VME_IRQ_LEVEL=4")
# VME IRQ vector
putenv ("GTEM_VME_IRQ_VECTOR=200")
### End Command Response COMM Board Setup ###
### mini-GLT COMM Board Setup ###
# VME physical address -- corresponds to jumper block on
# COMM I/O Board, connector SW1 and SW2.
putenv ("GGLT_VME_ADDRESS=0x08800000")
# VME IRQ level -- make sure does not conflict with any other VME modules
putenv ("GGLT_VME_IRQ_LEVEL=5")
# VME IRQ vector
putenv ("GGLT_VME_IRQ_VECTOR=220")
### End mini-GLT COMM Board Setup ###
|
The driver can log debugging information to the serial line of the MVME2304 processor board. The verbosity of this output is controlled by the logLevel argument of the gtOpen() function. logLevel can take the values LOG_DEBUG, LOG_INFO, LOG_WARN, LOG_ERROR or LOG_NONE. It is reccommended to use a value of LOG_ERROR for normal running.
Storage for the GTEM and GGLT handles must first be allocated before attempting to open the handles. Use the gtSizeOf() and ggSizeOf() functions to determine how much storage to allocated.
Once allocated the handles can be opened with for the are created using the gtOpen() and ggOpen() functions. The following code snippet shows how to allocate a GTEM handle:
gtemHandle gt = NULL;
/* create gtemHandle gnatHandle */
gt = (gtemHandle)malloc(gtSizeOf());
if ( !gt) {
return NULL;
}
status = gtOpen( gt, (LOG_level)logLevel);
|
An analogous calling sequence is used to allocate a GGLT handle using the functions ggSizeOf() and ggOpen().