GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> GNAT / V2-0-1 > gnat_xbrd / sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

xbrd_io.h File Reference

Defines the input/output methods for the VME XBRD interface. More...

#include "GNAT/xbrd_hw.h"

Functions

int xbrd_Probe (xbrdHandle gx)
 attempts simple test for board existance
int xbrd_HWver (xbrdHandle gx, unsigned short int *version, unsigned short int *revision)
 fetchs the hardware version and revision numbers from the board
int xbrd_SWver (xbrdHandle gx, unsigned short int *version, unsigned short int *revision)
 fetchs the software version and revision numbers from the board
int xbrd_Version (xbrdHandle gx, unsigned short hwVer, unsigned short hwRev, unsigned short swVer, unsigned short swRev)
 Checks the COMM Board hardware version/revision.
int xbrd_DACload (xbrdHandle gx, unsigned short nDAC, unsigned int val)
 Loads the specified DAC with val.
int xbrd_DACread (xbrdHandle gx, unsigned short nDAC, unsigned int *val)
 Reads the specified DAC.
int xbrd_ADCload (xbrdHandle gx, unsigned short nADC, unsigned int val)
 Loads the specified ADC with val.
int xbrd_ADCread (xbrdHandle gx, unsigned short nADC, unsigned int *val)
 Reads the specified ADC.


Detailed Description

Defines the input/output methods for the VME XBRD interface.

Author:
Curt Brune -- curt@slac.stanford.edu

Function Documentation

int xbrd_ADCload ( xbrdHandle  gx,
unsigned short  nADC,
unsigned int  val 
)

Loads the specified ADC with val.

Parameters:
gx handle of device
nADC index of ADC to load
val 32-bit value to load into ADC
See also:
xbrd_ADCread()
Returns:
OK on success
Writing to the ADC starts the acquisition cycle. The value written is ignored.

References G_OK, GX_VERIFY_HANDLE, _xbrd_regBlock::m_ADC, _xbrd::m_baseAddr, N_ADC_REG, and XBRD_ERR_BAD_PARAM.

int xbrd_ADCread ( xbrdHandle  gx,
unsigned short  nADC,
unsigned int *  val 
)

Reads the specified ADC.

Parameters:
gx handle of device
nADC index of ADC to read
val pointer to storage for 32-bit ADC value.
See also:
xbrd_ADCload()
Returns:
OK on success
On read bit 13 indicates the acquisition cycle is complete and that the 12-bit value is valid. If this bit is not set then return XBRD_ERR_ADC_NOT_READY.

References G_OK, GX_VERIFY_HANDLE, _xbrd_regBlock::m_ADC, _xbrd::m_baseAddr, N_ADC_REG, XBRD_ERR_ADC_NOT_READY, and XBRD_ERR_BAD_PARAM.

int xbrd_DACload ( xbrdHandle  gx,
unsigned short  nDAC,
unsigned int  val 
)

Loads the specified DAC with val.

Parameters:
gx handle of device
nDAC index of DAC to load
val 32-bit value to load into DAC
See also:
xbrd_DACread()
Returns:
OK on success
This is a "raw" interface to the MAXIM MAX5121 part, which is a 12-bit DAC. See the spec sheet for more info.

http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1987

To perform a normal "write value" operation use the following pattern:

  1 1 1 1 1 1
  5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  ===============================
  0 1 0 D D D D D D D D D D D D 0

  0 - bit is not set
  1 - bit is set
  D - data bit of 12-bit DAC value

References G_OK, GX_VERIFY_HANDLE, _xbrd::m_baseAddr, _xbrd_regBlock::m_DAC, N_DAC_REG, and XBRD_ERR_BAD_PARAM.

int xbrd_DACread ( xbrdHandle  gx,
unsigned short  nDAC,
unsigned int *  val 
)

Reads the specified DAC.

Parameters:
gx handle of device
nDAC index of DAC to read
val pointer to storage for 32-bit DAC value.
See also:
xbrd_DACload()
Returns:
OK on success
When writing the DAC register it takes some settling time before the physical DAC part has consumed the new value. When reading the DAC bit 16 indicates if the DAC has completely settled. If this bit is not set on read return XBRD_ERR_DAC_NOT_READY .

References G_OK, GX_VERIFY_HANDLE, _xbrd::m_baseAddr, _xbrd_regBlock::m_DAC, N_DAC_REG, XBRD_ERR_BAD_PARAM, and XBRD_ERR_DAC_NOT_READY.

int xbrd_HWver ( xbrdHandle  gx,
unsigned short int *  version,
unsigned short int *  revision 
)

fetchs the hardware version and revision numbers from the board

Parameters:
gx handle of device
version 3 LSB contain hardware version number
revision 3 LSB contain hardware revision number
Returns:
OK on success
See also:
xbrd_SWver()

References _xbrd_regControl::bf, G_OK, GX_VERIFY_HANDLE, _BFxbrd_regControl::hwRev, _BFxbrd_regControl::hwVer, _xbrd::m_baseAddr, _xbrd_regBlock::m_ctrl, _xbrd_regControl::ui, and XBRD_ERR_BAD_PARAM.

Referenced by xbrd_PrintDriverInfo(), and xbrd_Version().

int xbrd_Probe ( xbrdHandle  gx  ) 

attempts simple test for board existance

Parameters:
gx handle of device to probe
Returns:
OK if board probed.

References _xbrd_regControl::bf, G_OK, _xbrd::m_baseAddr, _xbrd_regBlock::m_ctrl, _xbrd_regControl::ui, _BFxbrd_regControl::vec, and XBRD_ERR_BRD_DETECT.

Referenced by __xbrd_Open().

int xbrd_SWver ( xbrdHandle  gx,
unsigned short int *  version,
unsigned short int *  revision 
)

fetchs the software version and revision numbers from the board

Parameters:
gx handle of device
version 3 LSB contain software version number
revision 3 LSB contain software revision number
Returns:
OK on success
See also:
xbrd_HWver()

References _xbrd_regControl::bf, G_OK, GX_VERIFY_HANDLE, _xbrd::m_baseAddr, _xbrd_regBlock::m_ctrl, _BFxbrd_regControl::swRev, _BFxbrd_regControl::swVer, _xbrd_regControl::ui, and XBRD_ERR_BAD_PARAM.

Referenced by xbrd_PrintDriverInfo(), and xbrd_Version().

int xbrd_Version ( xbrdHandle  gx,
unsigned short  hwVer,
unsigned short  hwRev,
unsigned short  swVer,
unsigned short  swRev 
)

Checks the COMM Board hardware version/revision.

Parameters:
gx handle of device
hwVer VME XBRD hardware version
hwRev VME XBRD hardware revision
swVer VME XBRD firmware version
swRev VME XBRD firmware revision
Returns:
OK on success

References _CHECK, G_OK, XBRD_ERR, xbrd_HWver(), and xbrd_SWver().

Referenced by xbrd_Init().


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