Public Member Functions | Static Public Member Functions | Protected Attributes

nxyter::RocNx Class Reference

Device class with all generic nXYTER access methods. More...

#include <RocNx.h>

Inheritance diagram for nxyter::RocNx:
Inheritance graph
[legend]
Collaboration diagram for nxyter::RocNx:
Collaboration graph
[legend]

Public Member Functions

 RocNx (base::Board *board)
 Constructor with full addressing path information.
virtual ~RocNx ()
int setToDefault ()
 Set nXYTER specific interface registers in ROC to default values.
int resetRocNxTs ()
 Reset nXYTER (and ROC) timestamp system.
int fireTestPulse (uint32_t delay, uint32_t period, int32_t width, uint32_t number)
 Fire a test pulse sequence after next nXYTER/ROC timestamp reset.
int fireTestPulse (uint32_t period, int32_t width, uint32_t number)
 Fire a test pulse sequence.
int setNxActive (int nx0, int nx1, int nx2, int nx3)
 setNxActive
int setNxActive (uint32_t mask)
 setRocNxActive
int getNxActive (uint32_t &mask)
 NX_getActivate.
int setLTSDelay (uint32_t val)
 setRocLTSDelay
int setParityCheck (uint32_t val)
 Sets nXYTER parity check flag.
int setDebugMode (uint32_t val)
 Sets debug mode readout flag in ROC.
int getFifoFull (uint32_t &val)
 Retrieves FIFO full state from ROC (1=fifo full).
int getFifoEmpty (uint32_t &val)
 Retrieves FIFO empty state from ROC (1=fifo empty).
int getDataDebug (std::vector< nxyter::DataDebug > &datvec, int nmsg)
 Try to acquire nmsg messages from 'debug' port.
base::Boardboard ()
 Return reference to roc::Board which hosts the Peripheral.
base::BoardgetBoard () const
 Returns pointer to the roc::Board which hosts the Peripheral.

Static Public Member Functions

static void addAddrMap (base::Board *board, unsigned hw_kind=base::kind_nXYTER)
 Add the nXYTER interface address set to the address mapping tables.

Protected Attributes

base::BoardfBoard
 board pointer

Detailed Description

Device class with all generic nXYTER access methods.

Definition at line 12 of file RocNx.h.


Constructor & Destructor Documentation

nxyter::RocNx::RocNx ( base::Board board  )  [explicit]

Constructor with full addressing path information.

Sets up RocNx object with full addressing information

Parameters:
board ROC board pointer

Definition at line 24 of file RocNx.cxx.

nxyter::RocNx::~RocNx (  )  [virtual]

Definition at line 31 of file RocNx.cxx.


Member Function Documentation

void nxyter::RocNx::addAddrMap ( base::Board board,
unsigned  hw_kind = base::kind_nXYTER 
) [static]
base::Board & base::Peripheral::board (  )  [inherited]
int nxyter::RocNx::fireTestPulse ( uint32_t  period,
int32_t  width,
uint32_t  number 
)

Fire a test pulse sequence.

The ROC has a build-in test pulse generator which can produce pulse trains with programmable period, width and number of cycles. This method causes the ROC to generate a test pulse sequence with a period of period * 4 ns, a pulse width of width * 4 ns, and number rising test pulse edges. If number if 0 the generator produces test pulses continuously up to the next fireTestPulse(uint32_t, int32_t, uint32_t) or fireTestPulse(uint32_t, uint32_t, int32_t uint32_t) call. To stop a continuous sequence simply call fireTestPulse(2,1,1).

Parameters:
period controls period, rising edges occur every period * 4 ns. If period is 0, a currently running test pulse train is aborted. In this case width and number are ignored and can be specified as 0.
width controls the pulse shape. If width > 0, the "H" time is width * 4 ns and the "L" time is period - width * 4 ns. If width < 0, the "L" time is width * 4 ns and the "H" time is period - width * 4 ns.
number controls number of generated pulses. Only the lower 15 LSB are used, maximal pulse train length is 32767 pulses. A 0 causes a continuous pulse train.
Returns:
see roc::Board get/put/oper return codes or -1 if the arguments are out-of-range.
Note:
The "L" time and the "H" time is limited to 4 * 2^24 = 67108864 ns. Usually width is quite small, so in practice the minimal frequency is about 14.9 Hz.
See also:
fireTestPulse(uint32_t delay, uint32_t period, int32_t width, uint32_t number)

Definition at line 135 of file RocNx.cxx.

References base::Peripheral::board(), base::Board::operPPPP(), ROC_NX_TESTPULSE_LENGTH, ROC_NX_TESTPULSE_LENGTH2, ROC_NX_TESTPULSE_NUMBER, and ROC_NX_TESTPULSE_START.

int nxyter::RocNx::fireTestPulse ( uint32_t  delay,
uint32_t  period,
int32_t  width,
uint32_t  number 
)

Fire a test pulse sequence after next nXYTER/ROC timestamp reset.

The ROC test pulse generator can produce a pulse train with programmable period, width and number of cycles which start with a defined delay after a nXYTER/ROC timestamp reset. This allows to produce nXYTER hits with controlled timestamp and is used for calibrations of delay parameters.

This method will cause a nXYTER/ROC timestamp reset (with resetRocNxTs()) followed a test pulse train with a period of period * 4 ns, a pulse width of width * 4 ns, and number rising test pulse edges starting delay * 4 ns after the reset pulse to the nXYTER.

Parameters:
delay controls delay, first edge after delay * 4 ns after reset. Only the 16 LSB are used, the maximal delay is 4 * 65535 = 262140 ns.
period controls period, rising edges occur every period * 4 ns.
width controls the pulse shape. If width > 0, the "H" time is width * 4 ns and the "L" time is period - width * 4 ns. If width < 0, the "L" time is width * 4 ns and the "H" time is period - width * 4 ns.
number controls number of generated pulses. Only the lower 16 LSB are used, maximal pulse train length is 32767 pulses. A 0 causes a continuous pulse train.
Returns:
see roc::Board get/put/oper return codes or -1 if the arguments are out-of-range.
Note:
The "L" time and the "H" time is limited to 4 * 2^24 = 67108864 ns. Usually width is quite small, so in practice the minimal frequency is about 14.9 Hz.
See also:
fireTestPulse(uint32_t delay, uint32_t period, int32_t width)

Definition at line 199 of file RocNx.cxx.

References base::Peripheral::board(), base::Board::operErrBuild(), base::Board::operPPPP(), resetRocNxTs(), ROC_NX_TESTPULSE_LENGTH, ROC_NX_TESTPULSE_LENGTH2, ROC_NX_TESTPULSE_NUMBER, and ROC_NX_TESTPULSE_RESET_DELAY.

Referenced by roc::BoardsVector::autoped_switch(), cmd_autoped(), cmd_autosettrh(), cmd_firepulser(), cmd_printdata(), cmd_testnxdata(), RocNxWidget::firePulse(), roc::BoardsVector::returnBoards(), roc::BoardsVector::setBoard(), and RocNxWidget::stopPulse().

base::Board* base::Peripheral::getBoard (  )  const [inline, inherited]
int nxyter::RocNx::getDataDebug ( std::vector< nxyter::DataDebug > &  datvec,
int  nmsg 
)

Try to acquire nmsg messages from 'debug' port.

Uses the DAQ 'debug' port to read up to nmsg messages via ROC control space accesses. ROC must be in 'debug' mode. The method will append messages to data until either the maximal message count nmsg is reached or the 'wide FIFO' is empty.

Parameters:
datvec retrieved message are appended to the vector, the vector is not initially cleared by this method
nmsg maximal number of messages read
Returns:
number of message appended to data or -2 in case of get/put/operGen errors or -1 if ROC not in debug mode. A 0 is returned if the 'wide FIFO' is empty when getDataDebug() is called.
See also:
setDebugMode(), getRocFifoEmpty()

Definition at line 336 of file RocNx.cxx.

References base::Peripheral::board(), and base::Board::operGen().

Referenced by cmd_printdatadbg().

int nxyter::RocNx::getFifoEmpty ( uint32_t &  val  ) 

Retrieves FIFO empty state from ROC (1=fifo empty).

Definition at line 313 of file RocNx.cxx.

References base::Peripheral::board(), base::Board::get(), and ROC_NX_FIFO_EMPTY.

int nxyter::RocNx::getFifoFull ( uint32_t &  val  ) 

Retrieves FIFO full state from ROC (1=fifo full).

Definition at line 305 of file RocNx.cxx.

References base::Peripheral::board(), base::Board::get(), and ROC_NX_FIFO_FULL.

int nxyter::RocNx::getNxActive ( uint32_t &  mask  ) 

NX_getActivate.

Read status mask which nXYTERs is on/off

Definition at line 258 of file RocNx.cxx.

References base::Peripheral::board(), base::Board::get(), and ROC_NX_NXACTIVE.

Referenced by nxyter::NxChip::activate(), nxyter::NxChip::deactivate(), nxyter::NxChip::isactive(), and nxyter::QuickDaq::startRun().

int nxyter::RocNx::resetRocNxTs (  ) 

Reset nXYTER (and ROC) timestamp system.

This method brings the timestamp system of all connected nXYTERs and the local timestamp counter of the ROC into a consistent state, counting up from almost zero.

Returns:
see roc::Board get/put/oper return codes

Definition at line 91 of file RocNx.cxx.

References base::OperList::addPut(), base::Peripheral::board(), base::Board::operGen(), and ROC_NX_TS_RESET.

Referenced by cmd_printdata(), cmd_printdatadbg(), cmd_resetrocnxts(), and fireTestPulse().

int nxyter::RocNx::setDebugMode ( uint32_t  val  ) 

Sets debug mode readout flag in ROC.

Parameters:
val debug mode enable flag (1 is yes, 0 is no)
Returns:
see roc::Board get/put/oper return codes

Definition at line 297 of file RocNx.cxx.

References base::Peripheral::board(), base::Board::put(), and ROC_NX_DEBUG_MODE.

Referenced by cmd_printdatadbg().

int nxyter::RocNx::setLTSDelay ( uint32_t  val  ) 

setRocLTSDelay

Sets the global LTS Delay. Please, only use this function, if know what you're doing!

Definition at line 270 of file RocNx.cxx.

References base::Peripheral::board(), base::Board::put(), and ROC_NX_DELAY_LTS.

int nxyter::RocNx::setNxActive ( int  nx0,
int  nx1,
int  nx2,
int  nx3 
)

setNxActive

Actiavte/deactive nXYTERs, setting on/off for each nxyter

Definition at line 234 of file RocNx.cxx.

Referenced by nxyter::NxChip::activate(), nxyter::NxChip::deactivate(), and nxyter::QuickDaq::startRun().

int nxyter::RocNx::setNxActive ( uint32_t  mask  ) 

setRocNxActive

Actiavte/deactive nXYTERs, setting on/off for each nxyter

Definition at line 247 of file RocNx.cxx.

References base::Peripheral::board(), base::Board::put(), and ROC_NX_NXACTIVE.

int nxyter::RocNx::setParityCheck ( uint32_t  val  ) 

Sets nXYTER parity check flag.

Activates/Deactivates the nXYTER parity checking. If parity checking is activated, the broken nXYTER hit message is replaced by a nXYTER parity error system message.

Parameters:
val Is parity checking on? (1 is yes, 0 is no)
Returns:
see roc::Board get/put/oper return codes

Definition at line 285 of file RocNx.cxx.

References base::Peripheral::board(), base::Board::put(), and ROC_NX_PARITY_CHECK.

int nxyter::RocNx::setToDefault (  ) 

Set nXYTER specific interface registers in ROC to default values.

This method sets default values for

  • ROC number (0)
  • nXYTER active mask (all off)
  • ADC port selector (values for Feb1nx)
  • ADC clock delay (value good for 2-4 segment cables)
  • ADC latency (value good for 2-4 segment cables)
  • nXYTER delay (value good for iDUR=15 operation)

Definition at line 46 of file RocNx.cxx.

References base::Peripheral::board(), base::Board::operErrBuild(), and base::Board::put().

Referenced by cmd_setrocdef(), and RocNxWidget::setSubToDefault().


Field Documentation

base::Board* base::Peripheral::fBoard [protected, inherited]

board pointer

Definition at line 26 of file Peripheral.h.

Referenced by base::Peripheral::board(), base::Peripheral::getBoard(), and base::Peripheral::Peripheral().


The documentation for this class was generated from the following files: