JLab fADC125 Library  1.2.1
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups
Data Readout

Functions

int fa125Poll (int id)
 Poll the specified fADC125's busy status. More...
 
unsigned int fa125GetBerrCount ()
 Return the Bus Error count that occurred while checking the busy status. More...
 
int fa125SoftTrigger (int id)
 Initiate a software trigger for a specific fADC125 module. More...
 
int fa125Bready (int id)
 Return a Block Ready status. More...
 
unsigned int fa125GBready ()
 Return a Block Ready status mask for all initialized fADC125s. More...
 
int fa125ReadBlockStatus (int pflag)
 Return the block error flag and optionally print out the description to standard out. More...
 
int fa125ReadBlock (int id, volatile UINT32 *data, int nwrds, int rflag)
 General Data readout routine. More...
 

Detailed Description

Function Documentation

int fa125Bready ( int  id)

Return a Block Ready status.

Parameters
idSlot number
Returns
1 if block is ready for readout, 0 if not, otherwise ERROR.

References fa125_a24_main::blockCSR, FA125_BLOCKCSR_BLOCK_READY, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, and fa125_a24::main.

unsigned int fa125GBready ( )

Return a Block Ready status mask for all initialized fADC125s.

Returns
block ready mask, otherwise ERROR.

References fa125_a24_main::blockCSR, FA125_BLOCKCSR_BLOCK_READY, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, fa125_a24::main, and nfa125.

unsigned int fa125GetBerrCount ( )

Return the Bus Error count that occurred while checking the busy status.

Returns
Bus Error count
See Also
fa125Poll

References berr_count.

int fa125Poll ( int  id)

Poll the specified fADC125's busy status.

Parameters
idSlot number
Returns
Busy status
  • 0: Not Busy
  • 1: Busy
  • ERROR: otherwise

References berr_count, fa125_a24_proc::csr, FA125_PROC_CSR_BUSY, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, LSWAP, and fa125_a24::proc.

int fa125ReadBlock ( int  id,
volatile UINT32 *  data,
int  nwrds,
int  rflag 
)

General Data readout routine.

Parameters
idSlot number of module to read
datalocal memory address to place data
nwrdsMax number of words to transfer
rflagReadout Flag
             0 - programmed I/O from the specified board
             1 - DMA transfer using Universe/Tempe DMA Engine 
                   (DMA VME transfer Mode must be setup prior)
             2 - Multiblock DMA transfer (Multiblock must be enabled
                    and daisychain in place or SD being used)
Returns
Number of words inserted into data if successful. Otherwise ERROR.

References fa125_a24_main::blockCSR, fa125_a24_main::ctrl1, fa125_a32::data, fa125_a24_proc::ev_count, FA125_BLOCKCSR_BERR_ASSERTED, FA125_BLOCKERROR_DMADONE_ERROR, FA125_BLOCKERROR_NO_ERROR, FA125_BLOCKERROR_TERM_ON_WORDCOUNT, FA125_BLOCKERROR_UNKNOWN_BUS_ERROR, FA125_BLOCKERROR_ZERO_WORD_COUNT, FA125_CTRL1_ENABLE_BERR, FA125_CTRL1_FIRST_BOARD, FA125_DATA_BLKNUM_MASK, FA125_DATA_BLOCK_HEADER, FA125_DATA_BLOCK_TRAILER, FA125_DATA_TYPE_DEFINE, FA125_DATA_TYPE_MASK, FA125_DUMMY_DATA, FA125_MAX_ADC_CHANNELS, FA125_MAX_DATA_PER_CHANNEL, FA125_PROC_EVCOUNT_MASK, fa125A32Offset, fa125BlockError, fa125ID, FA125LOCK, fa125MaxSlot, fa125p, fa125pd, FA125pmb, FA125UNLOCK, LSWAP, fa125_a24::main, and fa125_a24::proc.

int fa125ReadBlockStatus ( int  pflag)

Return the block error flag and optionally print out the description to standard out.

Parameters
pflagIf >0 will print the error flag to standard out.
Returns
Block Error flag.
See Also
FA125_BLOCKERROR_FLAGS

References FA125_BLOCKERROR_NO_ERROR, and fa125BlockError.

int fa125SoftTrigger ( int  id)

Initiate a software trigger for a specific fADC125 module.

Parameters
idSlot number
Returns
OK if successful, otherwise ERROR.

References fa125ID, FA125LOCK, fa125p, FA125UNLOCK, fa125_a24::proc, and fa125_a24_proc::softtrig.