JLab f1TDC-V2,V3 Library  V2:0x0e,V3:0x15
 All Data Structures Files Functions Variables Typedefs Macros Groups
Data Readout

Functions

int f1ReadBlock (int id, volatile UINT32 *data, int nwrds, int rflag)
 General Data readout routine. More...
 
int f1PrintEvent (int id, int rflag)
 Readout and print event to standard out. More...
 
int f1FlushEvent (int id)
 Routine to flush a partial event from the FIFO. Read until a valid trailer is found. More...
 
int f1GPrintEvent (int rflag)
 Readout and print event from all initialized f1TDCs to standard out. More...
 
int f1Dready (int id)
 Determine if an event is ready for readout on the module. More...
 
int f1Bready (int id)
 Return block available for readout status of the module. More...
 
unsigned int f1GBready ()
 Return the mask of all initialized modules with blocks available for readout. More...
 
int f1DataScan (int pflag)
 Return the mask of all initialized modules with events available for readout. More...
 

Detailed Description

Function Documentation

int f1Bready ( int  id)

Return block available for readout status of the module.

Parameters
id
  • Slot Number
Returns
1 if block available for readout, 0 if not, otherwise ERROR

References f1tdc_struct::csr, F1_CSR_BLOCK_READY, f1ID, F1LOCK, f1p, F1UNLOCK, and f1tdc_struct::stat.

int f1DataScan ( int  pflag)

Return the mask of all initialized modules with events available for readout.

Parameters
pflagPrint Flag
  • >0: Print event count of each module to standard out.
Returns
mask of all initialized modules with events available for readout

References f1tdc_struct::ev_count, F1_EVENT_COUNT_MASK, f1ID, F1LOCK, f1p, F1UNLOCK, and nf1tdc.

Referenced by f1GPrintEvent(), f1ISR(), and f1TestRead().

int f1Dready ( int  id)

Determine if an event is ready for readout on the module.

Parameters
id
  • Slot Number
Returns
Number of events ready for readout, otherwise ERROR

References f1tdc_struct::ev_count, F1_EVENT_COUNT_MASK, f1ID, F1LOCK, f1p, and F1UNLOCK.

int f1FlushEvent ( int  id)

Routine to flush a partial event from the FIFO. Read until a valid trailer is found.

Parameters
id
  • Slot Number
Returns
OK if successful, otherwise ERROR.

References f1tdc_struct::csr, f1tdc_struct::ctrl, f1tdc_struct::ev_count, F1_DATA_INVALID, F1_DATA_SLOT_MASK, F1_ENABLE_BERR, F1_EVENT_COUNT_MASK, F1_HT_DATA_MASK, F1_TAIL_DATA, f1Clear(), f1ID, F1LOCK, f1p, f1pd, and F1UNLOCK.

unsigned int f1GBready ( )

Return the mask of all initialized modules with blocks available for readout.

Returns
mask of all initialized modules with blocks available for readout

References f1tdc_struct::csr, F1_CSR_BLOCK_READY, f1ID, F1LOCK, f1p, F1UNLOCK, nf1tdc, and f1tdc_struct::stat.

int f1GPrintEvent ( int  rflag)

Readout and print event from all initialized f1TDCs to standard out.

Parameters
rflagNot used
Returns
Number of words read if successful. Otherwise ERROR.

References f1DataScan(), f1ID, f1PrintEvent(), and nf1tdc.

int f1PrintEvent ( int  id,
int  rflag 
)

Readout and print event to standard out.

Parameters
idSlot number of module to read
rflagNot used
Returns
Number of words read if successful. Otherwise ERROR.

References f1tdc_struct::csr, f1tdc_struct::ctrl, f1tdc_struct::ev_count, F1_DATA_INVALID, F1_DATA_SLOT_MASK, F1_ENABLE_BERR, F1_EVENT_COUNT_MASK, F1_HEAD_DATA, F1_HT_CHIP_MASK, F1_HT_DATA_MASK, F1_HT_EVENT_MASK, F1_HT_TRIG_MASK, F1_TAIL_DATA, f1ID, F1LOCK, f1p, f1pd, and F1UNLOCK.

Referenced by f1GPrintEvent().

int f1ReadBlock ( 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 f1tdc_struct::csr, f1tdc_struct::ctrl, f1tdc_struct::ev_count, F1_CSR_BERR_STATUS, F1_DATA_BLOCK_HEADER, F1_DATA_BLOCK_TRAILER, F1_DATA_TYPE_DEFINE, F1_DATA_TYPE_MASK, F1_DUMMY_DATA, F1_ENABLE_BERR, F1_EVENT_COUNT_MASK, F1_FIRST_BOARD, F1_MAX_HITS_PER_CHANNEL, F1_MAX_TDC_CHANNELS, f1ID, F1LOCK, f1MaxSlot, f1p, f1pd, f1pmb, f1tdcA32Offset, F1UNLOCK, and f1tdc_struct::stat.

Referenced by f1ISR(), and f1TestRead().