Main Page   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. More...

int VME_vmeProbe (unsigned int vmeAdr)
 Does a read probe of vmeAdr. More...

volatile unsigned int * VME_vmeToLocal (unsigned int vmeAdr)
 Translates a vme address to its local address equivalent. More...

unsigned int VME_vmeRead (unsigned int vmeAdr)
 Reads the value at the specified VME location. More...

unsigned int VME_vmeWrite (unsigned int vmeAdr, unsigned int val)
 Reads the value at the specified VME location. More...

unsigned int VME_vmeSet (unsigned int vmeAdr, unsigned int set)
 Sets the bits in set. More...

unsigned int VME_vmeClr (unsigned int vmeAdr, unsigned int clr)
 Clears the bits in clr. More...

unsigned int VME_vmeSetAndClr (unsigned int vmeAdr, unsigned int set, unsigned int clr)
 Does a selective set and clear. More...

unsigned int VME_vmeRMW (unsigned int vmeAdr, unsigned int mask, unsigned int val)
 Performs a read/modify/write on the specified VME location. More...


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

unsigned 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.

unsigned int VME_vmeClr unsigned int    vmeAdr,
unsigned int    clr
 

Clears the bits in clr.

Parameters:
vmeAdr  The VME address to modify to.
set  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.

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.

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.

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.
clr  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.

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.

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.

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.

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.


Generated on Fri Mar 1 18:14:52 2002 by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001