GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> GNAT / V2-0-1 > gnat_vme / mv2304


Interface   Data Structures   File List   Data Fields   Globals  

VME.h File Reference

VME Utilities, Interface. More...


Functions

int VME_probe (volatile unsigned int *lclAdr)
 Does a read probe of lclAdr.
int VME_vmeProbe (unsigned int vmeAdr)
 Does a read probe of vmeAdr.
volatile unsigned int * VME_vmeToLocal (unsigned int vmeAdr)
 Translates a vme address to its local address equivalent.
unsigned int VME_vmeRead (unsigned int vmeAdr)
 Reads the value at the specified VME location.
unsigned int VME_vmeWrite (unsigned int vmeAdr, unsigned int val)
 Reads the value at the specified VME location.
unsigned int VME_vmeSet (unsigned int vmeAdr, unsigned int set)
 Sets the bits in set.
unsigned int VME_vmeClr (unsigned int vmeAdr, unsigned int clr)
 Clears the bits in clr.
unsigned int VME_vmeSetAndClr (unsigned int vmeAdr, unsigned int set, unsigned int clr)
 Does a selective set and clear.
unsigned int VME_vmeRMW (unsigned int vmeAdr, unsigned int mask, unsigned int val)
 Performs a read/modify/write on the specified VME location.


Detailed Description

VME Utilities, Interface.

Author:
JJRussell - russell@slac.stanford.edu
Very basic set of VME utilities. There is nothing fancy here, but using these routines provides at least the ability to link on the host, and in very simple cases, to run on the host.

Function Documentation

int VME_probe ( volatile unsigned int *  lclAdr  ) 

Does a read probe of lclAdr.

Parameters:
lclAdr The local address representation of the VME address to probe.
Returns:
0 if the address is valid, 1 if it is not.
Does a read probe of the specified address on the VME bus. This function can be used as a map function of the VME crate. This routine works only on addresses with are 32 bit readable.

References STATUS, and sysBusProbe().

Referenced by VME_vmeProbe().

unsigned int VME_vmeClr ( unsigned int  vmeAdr,
unsigned int  clr 
)

Clears the bits in clr.

Parameters:
vmeAdr The VME address to modify to.
clr The bits to clear (the bits to be cleareed are set to 1).
Returns:
The original value before it was modified.
Clears the bits in the clears parameter. This, by its nature, involves a read/modify/write operation. This routine does not perform this operation in an interlocked fashion.

References toLocal().

int VME_vmeProbe ( unsigned int  vmeAdr  ) 

Does a read probe of vmeAdr.

Parameters:
vmeAdr The VME address to probe.
Returns:
0 if the address is valid, 1 if it is not.
Does a read probe of the specified address on the VME bus. This function can be used as a map function of the VME crate. This routine works only on addresses with are 32 bit readable.

References toLocal(), and VME_probe().

unsigned int VME_vmeRead ( unsigned int  vmeAdr  ) 

Reads the value at the specified VME location.

Parameters:
vmeAdr The VME address to read.
Returns:
The result of the read
Reads the value at the specified VME location. The address is first translated to its local equivalent before the read is performed.

References toLocal().

unsigned int VME_vmeRMW ( unsigned int  vmeAdr,
unsigned int  mask,
unsigned int  value 
)

Performs a read/modify/write on the specified VME location.

Parameters:
vmeAdr The VME address to modify.
mask A bit mask indicating which bits should be modified.
value Each bit that is set to a 1 will be set to a 0 in the output location.
Returns:
The original value.
Performs a read/modify/write on the specified VME location. This is one of the two common ways of specifying such an interface. See VME_setAndClr for the other. Bits specified by 'mask' parameter are modified to those in the 'value' parameter.

By definition this involves a read/modify/write operation. This routine does not perform this operation in an interlocked fashion.

References toLocal().

unsigned int VME_vmeSet ( unsigned int  vmeAdr,
unsigned int  set 
)

Sets the bits in set.

Parameters:
vmeAdr The VME address to modify to.
set The bits to set.
Returns:
The original value before it was modified.
Sets the bits in the set parameter. This, by its nature, involves a read/modify/write operation. This routine does not perform this operation in an interlocked fashion.

References toLocal().

unsigned int VME_vmeSetAndClr ( unsigned int  vmeAdr,
unsigned int  set,
unsigned int  clr 
)

Does a selective set and clear.

Parameters:
vmeAdr The VME address to modify to.
set Each bit that is set to a 1 will be set to a 1 in the output location.
clr Each bit that is set to a 1 will be set to a 0 in the output location.
Returns:
The original value before it was modified.
Does a selective set and clear. This is one of the two common ways of specifying such an interface. See VME_rmw for the other. While more intuitive in some cases, this routine does suffer from an ambiguity when corresponding bits in both the the set and clear masks are selected.

The routine, by definition first sets the bits in the specified in the 'set' parameter, then clears the bits in the 'clr' parameter. This means that the when both are specified, the clear bit wins.

By definition this involves a read/modify/write operation. This routine does not perform this operation in an interlocked fashion.

References toLocal().

volatile unsigned int * VME_vmeToLocal ( unsigned int  vmeAdr  ) 

Translates a vme address to its local address equivalent.

Parameters:
vmeAdr The VME address to translate.
Returns:
The translated address.
If the translation fails, the routine bugchecks.

References toLocal().

unsigned int VME_vmeWrite ( unsigned int  vmeAdr,
unsigned int  value 
)

Reads the value at the specified VME location.

Parameters:
vmeAdr The VME address to write to.
value The value to write.
Returns:
The value which was written.
Reads the value at the specified VME location. The address is first translated to its local equivalent before the read is performed.

References toLocal().


Generated on Wed Nov 21 22:06:50 2012 by  doxygen 1.5.8