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

Functions

int f1ConfigRead (int id, unsigned int *config_data, int chipID)
 Read the f1TDC Chip Registers into user specified config_data array. More...
 
void f1ConfigShow (int id, int chipMask)
 Print to standard out the configuration of the f1TDC chips specified by the chipmask and module in slot id. More...
 
int f1GetSerialNumber (int id, char **rval)
 Fills 'rval' with a character array containing the fa250 serial number. More...
 
int f1GetFirmwareVersion (int id, int pflag)
 Get the firmware version of the FPGA. More...
 
void f1Status (int id, int sflag)
 Print Status of f1TDC to standard out. More...
 
void f1GStatus (int sFlag)
 Print Status of all initialized f1TDCs to standard out. More...
 
void f1ChipStatus (int id, int pflag)
 Print Status of f1TDC chips to standard out. More...
 
unsigned int f1ErrorStatus (int id, int sflag)
 Return the Error status for all the f1TDC chips on the module. More...
 
unsigned int f1GErrorStatus (int sflag)
 Return the Error status for all the f1TDC chips on all initialized modules. More...
 
int f1CheckLock (int id)
 Get Resolution lock status for all chips on the board. More...
 
int f1GCheckLock (int pflag)
 Get Resolution lock status for all chips on all initialized f1TDCs. More...
 
unsigned int f1ScanMask ()
 Return the mask of all initialized modules. More...
 
int f1GetRez (int id)
 Return the mask of f1TDCs chips on the module that are set in high resolution mode. More...
 
unsigned int f1ReadCSR (int id)
 Return the value of the CSR register of the module. More...
 
int f1Enabled (int id)
 Return enabled/disabled status of FPGA data fifo. More...
 
void f1DataDecode (int id, unsigned int data)
 Decode a data word from an fADC250 and print to standard out. More...
 

Detailed Description

Function Documentation

int f1CheckLock ( int  id)

Get Resolution lock status for all chips on the board.

Parameters
id
  • Slot Number
Returns
0 if all chips are locked, else a bitmask of unlocked chips, otherwise ERROR

References F1_CHIP_RES_LOCKED, F1_MAX_TDC_CHIPS, f1ID, F1LOCK, f1Nchips, f1p, F1UNLOCK, and f1tdc_struct::stat.

Referenced by f1GCheckLock(), and f1Init().

void f1ChipStatus ( int  id,
int  pflag 
)

Print Status of f1TDC chips to standard out.

Parameters
id
  • Slot Number
pflagPrint to standard out flag
  • 0: Show minimal information
  • !0: Show description of error latch, if present

References F1_CHIP_EXTFIFO_ALMOST_FULL, F1_CHIP_EXTFIFO_EMPTY, F1_CHIP_EXTFIFO_FULL, F1_CHIP_HITFIFO_OVERFLOW, F1_CHIP_INITIALIZED, F1_CHIP_LATCH_STAT_MASK, F1_CHIP_OUTFIFO_OVERFLOW, F1_CHIP_RES_LOCKED, F1_CHIP_STAT_MASK, F1_CHIP_TRIGFIFO_OVERFLOW, F1_MAX_TDC_CHIPS, f1ID, F1LOCK, f1Nchips, f1p, F1UNLOCK, and f1tdc_struct::stat.

Referenced by f1Status(), and f1TestRead().

int f1ConfigRead ( int  id,
unsigned int *  config_data,
int  chipID 
)

Read the f1TDC Chip Registers into user specified config_data array.

Parameters
id
  • Slot Number
config_data
  • local memory address to place register values
chipID
  • Which f1TDC Chip to read from
Returns
OK if successful, otherwise ERROR.

References f1ID, F1LOCK, f1Nchips, f1p, and F1UNLOCK.

Referenced by f1SetWindow().

void f1ConfigShow ( int  id,
int  chipMask 
)

Print to standard out the configuration of the f1TDC chips specified by the chipmask and module in slot id.

Parameters
id
  • Slot Number
chipMask
  • Mask of chips in module to show

References F1_ALL_CHIPS, f1ClockSource, f1ID, F1LOCK, f1Nchips, f1p, and F1UNLOCK.

Referenced by f1Status().

void f1DataDecode ( int  id,
unsigned int  data 
)

Decode a data word from an fADC250 and print to standard out.

Parameters
id
  • Slot Number
data32bit f1TDC data word

References F1_VERSION_BOARDREV_MASK, and f1Rev.

int f1Enabled ( int  id)

Return enabled/disabled status of FPGA data fifo.

Parameters
id
  • Slot Number
Returns
1 if enabled, 0 if disabled, otherwise ERROR

References f1tdc_struct::ctrl, f1ID, F1LOCK, f1p, and F1UNLOCK.

Referenced by f1SetWindow().

unsigned int f1ErrorStatus ( int  id,
int  sflag 
)

Return the Error status for all the f1TDC chips on the module.

Parameters
id
  • Slot Number
sflagStatus flag
  • 0: Just read the status and return error info
  • !0: Do full latch and persistance check of all chips
Returns
Mask of chips that report a latched error status

References f1tdc_struct::csr, F1_CHIP_ERROR_COND, F1_CHIP_RES_LOCKED, F1_CSR_ERROR_MASK, F1_MAX_TDC_CHIPS, f1ID, F1LOCK, f1Nchips, f1p, F1UNLOCK, and f1tdc_struct::stat.

int f1GCheckLock ( int  pflag)

Get Resolution lock status for all chips on all initialized f1TDCs.

Parameters
pflagPrint Flag
  • !0: Show which slot contains unlocked chips to standard out
Returns
0 if all chips are locked, else a slot mask of modules with unlocked chips, otherwise ERROR

References f1tdc_struct::csr, F1_CSR_ERROR_MASK, f1CheckLock(), f1ID, F1LOCK, f1p, F1UNLOCK, nf1tdc, and f1tdc_struct::stat.

unsigned int f1GErrorStatus ( int  sflag)

Return the Error status for all the f1TDC chips on all initialized modules.

Parameters
sflagStatus flag
  • 0: Just read the status and return error info
  • !0: Do full latch and persistance check of all chips
Returns
Slot Mask of f1TDCs that report a latched error status

References f1tdc_struct::csr, F1_CHIP_ERROR_COND, F1_CHIP_RES_LOCKED, F1_CSR_ERROR_MASK, F1_MAX_TDC_CHIPS, f1ID, F1LOCK, f1Nchips, f1p, F1UNLOCK, nf1tdc, and f1tdc_struct::stat.

Referenced by f1ISR(), and f1TestRead().

int f1GetFirmwareVersion ( int  id,
int  pflag 
)

Get the firmware version of the FPGA.

Parameters
id
  • Slot number
pflagPrint to standard out flag
  • 0: Print nothing to stdout
  • !0: Print firmware versions to stdout

RETURNS: FPGA Version if successful or -1 if error

References F1_VERSION_FIRMWARE_MASK, f1ID, F1LOCK, f1p, F1UNLOCK, and f1tdc_struct::version.

int f1GetRez ( int  id)

Return the mask of f1TDCs chips on the module that are set in high resolution mode.

Parameters
id
  • Slot Number
Returns
mask of f1TDCs chips on the module that are set in high resolution mode, otherwise ERROR

References F1_HIREZ_MODE, f1ID, F1LOCK, f1Nchips, f1p, and F1UNLOCK.

int f1GetSerialNumber ( int  id,
char **  rval 
)

Fills 'rval' with a character array containing the fa250 serial number.

Parameters
id
  • Slot number
rvalWhere to return Serial number string
Returns
length of character array 'rval' if successful, otherwise ERROR

References f1ID, f1p, and f1tdc_struct::serial_eprom.

void f1GStatus ( int  sFlag)

Print Status of all initialized f1TDCs to standard out.

Parameters
sflagStatus flag
  • !1: Show control status of the module
  • 1: Show minimal error status of the f1TDC chips
  • 2: Show f1TDC chip configuration

References f1ID, f1Status(), and nf1tdc.

unsigned int f1ReadCSR ( int  id)

Return the value of the CSR register of the module.

Parameters
id
  • Slot Number
Returns
Value stored on the CSR register, otherwise ERROR

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

Referenced by f1ISR().

unsigned int f1ScanMask ( )

Return the mask of all initialized modules.

Returns
mask of all initialized modules

References f1ID, and nf1tdc.

Referenced by f1ISR(), and f1TestRead().

void f1Status ( int  id,
int  sflag 
)