Device class with all generic nXYTER access methods. More...
#include <RocNx.h>
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::Board & | board () |
Return reference to roc::Board which hosts the Peripheral . | |
base::Board * | getBoard () 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::Board * | fBoard |
board pointer |
Device class with all generic nXYTER access methods.
Definition at line 12 of file RocNx.h.
nxyter::RocNx::RocNx | ( | base::Board * | board | ) | [explicit] |
void nxyter::RocNx::addAddrMap | ( | base::Board * | board, | |
unsigned | hw_kind = base::kind_nXYTER | |||
) | [static] |
Add the nXYTER interface address set to the address mapping tables.
Definition at line 373 of file RocNx.cxx.
References base::Board::addRegAddrMapping(), base::kind_newNX, base::kind_nXYTER, ROC_NX_ADC_DATA, ROC_NX_BURST1, ROC_NX_BURST2, ROC_NX_BURST3, ROC_NX_DEBUG_MODE, ROC_NX_DELAY_LTS, ROC_NX_DELAY_NX0, ROC_NX_DELAY_NX1, ROC_NX_DELAY_NX2, ROC_NX_DELAY_NX3, ROC_NX_FEB4NX, ROC_NX_FIFO_EMPTY, ROC_NX_FIFO_FULL, ROC_NX_FIFO_RESET, ROC_NX_HWV, ROC_NX_I2C_REGRESET, ROC_NX_I2C_RESET, ROC_NX_INIT, ROC_NX_LT_HIGH, ROC_NX_LT_LOW, ROC_NX_NX_DATA, ROC_NX_NXACTIVE, ROC_NX_PARITY_CHECK, ROC_NX_TESTPULSE_LENGTH, ROC_NX_TESTPULSE_LENGTH2, ROC_NX_TESTPULSE_NUMBER, ROC_NX_TESTPULSE_RESET_DELAY, ROC_NX_TESTPULSE_RUNNING, ROC_NX_TESTPULSE_START, ROC_NX_THROTTLE, and ROC_NX_TS_RESET.
Referenced by cmd_board(), and main().
base::Board & base::Peripheral::board | ( | ) | [inherited] |
Return reference to roc::Board
which hosts the Peripheral
.
std::runtime_error | if board pointer not initialized or 0. |
Definition at line 30 of file Peripheral.cxx.
References base::Peripheral::fBoard.
Referenced by fireTestPulse(), nxyter::MainAdc::getAdcDirect(), nxyter::NxChip::getChannelDelay(), nxyter::MainAdc::getChannelLatency(), nxyter::MainAdc::getClockDelayBufg(), nxyter::MainAdc::getClockDelaySrInit(), base::Gpio::getConfig(), getDataDebug(), getFifoEmpty(), getFifoFull(), getNxActive(), roc::I2cDevice::getRegister(), nxyter::MainAdc::getRegister(), roc::I2cDevice::getRegister16(), base::Gpio::getSyncBaud(), base::Gpio::getSyncScale(), nxyter::FebBase::initRoc(), nxyter::FebBase::resetNxI2cBus(), nxyter::FebBase::resetNxI2cRegister(), resetRocNxTs(), nxyter::NxChip::setChannelDelay(), nxyter::MainAdc::setChannelLatency(), nxyter::MainAdc::setChannelMux(), nxyter::MainAdc::setClockDelay(), nxyter::MainAdc::setClockDelayBufg(), nxyter::MainAdc::setClockDelaySrInit(), base::Gpio::setConfig(), setDebugMode(), setLTSDelay(), setNxActive(), nxyter::NxChip::setNxNumber(), setParityCheck(), roc::I2cDevice::setRegister(), nxyter::MainAdc::setRegister(), roc::I2cDevice::setRegisterVerify(), base::Gpio::setSyncBaud(), base::Gpio::setSyncScale(), and setToDefault().
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).
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. |
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.
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. |
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] |
Returns pointer to the roc::Board which hosts the Peripheral
.
Note: normally using board()
is more convenient.
Definition at line 38 of file Peripheral.h.
References base::Peripheral::fBoard.
Referenced by nxyter::FebUtil::acquireTestTriggerData(), nxyter::NxChip::activate(), nxyter::FebBase::addNxChip(), nxyter::NxChip::deactivate(), nxyter::NxChip::isactive(), and nxyter::QuickDaq::QuickDaq().
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.
datvec | retrieved message are appended to the vector, the vector is not initially cleared by this method | |
nmsg | maximal number of messages read |
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.
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.
val | debug mode enable flag (1 is yes, 0 is no) |
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.
val | Is parity checking on? (1 is yes, 0 is no) |
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
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().
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().