#include <Board.h>
Public Types | |
enum | operErr { kOperSuccess = 0, kOperAddrErr = 2, kOperValueErr = 3, kOperStateErr = 4, kOperNetworkErr = 6, kHostError = 8, kOperVerifyErr = 20, kOperBusErr = 21 } |
Return codes for get, put and oper calls. More... | |
enum | addrErr { kAddrError = 0xffffffff } |
Public Member Functions | |
virtual bool | is_SPI_I2C () const |
is_SPI_I2C - return true if SPI interface should be used to access I2C bus | |
void | setDefaultTimeout (double tmout=2.) |
Set default get/put/oper timeout. | |
double | getDefaultTimeout () const |
void | setVerbosity (int lvl=0) |
int | getVerbosity () const |
Returns debug output verbosity level. | |
ClientRole | getRole () const |
Returns client role. | |
void | Debug (int lvl, const char *fmt,...) |
Print a formatted debug message. | |
void | setOperTrace (int lvl=1) |
Set get/put/operGen trace level. | |
int | getOperTrace () const |
Returns debug output verbosity level. | |
virtual int | operGen (OperList &lst, double tmout=0.)=0 |
General operate, arbitrary list of get/put accesses to ROC control space. | |
virtual int | operGen (bool *isput, uint32_t *addr, uint32_t *value, int num, double tmout=0.) |
virtual unsigned | GetBoardId () const |
int | put (uint32_t addr, uint32_t value, double tmout=0.) |
int | get (uint32_t addr, uint32_t &value, double tmout=0.) |
int | operPP (uint32_t addr0, uint32_t val0p, uint32_t addr1, uint32_t val1p, double tmout=0.) |
Put-Put accesses sequence to ROC control space. | |
int | operPG (uint32_t addr0, uint32_t val0p, uint32_t addr1, uint32_t &val1g, double tmout=0.) |
Put-Get accesses sequence to ROC control space. | |
int | operPPP (uint32_t addr0, uint32_t val0p, uint32_t addr1, uint32_t val1p, uint32_t addr2, uint32_t val2p, double tmout=0.) |
Put-Put-Put accesses sequence to ROC control space. | |
int | operGGG (uint32_t addr0, uint32_t &val0p, uint32_t addr1, uint32_t &val1p, uint32_t addr2, uint32_t &val2p, double tmout=0.) |
Get-Get-Get accesses sequence to ROC control space. | |
int | operPPPP (uint32_t addr0, uint32_t val0p, uint32_t addr1, uint32_t val1p, uint32_t addr2, uint32_t val2p, uint32_t addr3, uint32_t val3p, double tmout=0.) |
Put-Put-Put-Put accesses sequence to ROC control space. | |
uint32_t | findRegAddressByName (const char *name) |
Retrieve a ROC control space address by its symbolic name. | |
const char * | findRegNameByAddress (uint32_t addr) |
Retrieve symbolic name of a ROC control space address. | |
void | printRegAddressMap (std::ostream &os, bool byname=false) |
void | addRegAddrMapping (const char *name, uint32_t addr) |
Add an entry to the ROC control space address mapping table. | |
void | fillRegAddrNames (std::list< std::string > &lst) |
virtual int | getTransportKind () const =0 |
getTransportKind | |
bool | isFile () const |
isFile | |
bool | isOptic () const |
isOptic - returns true when optic use for connection | |
bool | isUSB () const |
isUSB - returns true when optic use for connection | |
virtual bool | restartBoard () |
resetBoard - method should restart board. Return true if implemented. One should immediately close connection to board | |
virtual int | setToDefault () |
setToDefault - method set all board registers to default values. Return 0 if ok | |
virtual uint32_t | getHardwareType () |
Returns hardware type (frontend/backend) of ROC (FPGA firmware kind). | |
virtual uint32_t | getHardwareVersion () |
Returns hardware version of ROC (FPGA firmware version). | |
virtual uint32_t | getFrontendKind () |
Return frontend kinds - kind_nXYTER (1), kind_oldFEET (2) or kind_FEET (3). | |
virtual uint32_t | getBackendKind () |
Return backend kinds - kind_Optic (1), kind_FX20 (2), kind_FX40 (3) or kind_FX60 (4). | |
uint32_t | boardNumber () const |
Returns locally stored board number. | |
uint32_t | getBoardNumber () |
Request number from board. | |
void | setBoardNumber (uint32_t num) |
Change board number in device. | |
virtual int | invokeDLM (unsigned num, double tmout=0.) |
invokeDLM - method generate DLM, which sends to every endnode | |
virtual bool | startDaq ()=0 |
Activate DAQ. | |
virtual bool | suspendDaq ()=0 |
suspendDaq | |
virtual bool | stopDaq ()=0 |
stopDaq | |
virtual bool | getNextBuffer (void *&buf, unsigned &len, double tmout=1.)=0 |
getNextBuffer | |
virtual int | getMsgFormat () const =0 |
getMsgFormat | |
virtual void | setFlushTimeout (double tmout) |
Sets flush timeout of data transport. | |
Static Public Member Functions | |
static int | operErrCode (int rc) |
Retrieve error code from get/put/oper return code. | |
static int | operErrIndex (int rc) |
Retrieve index from get/put/oper return code. | |
static int | operErrBuild (int code, int index) |
Build get/put/oper return code from error code and index value. | |
static int | operErrBuildInc (int rc, int inc) |
Add to index value of get/put/oper return code. | |
static std::string | operErrToString (int rc) |
Returns a string with a human readable form of a get/put/oper return code. | |
static const char * | operErrCodeName (int rc) |
Returns descriptive text for a get/put/oper error code. | |
static Board * | Connect (const char *url, ClientRole role=roleNone) |
static bool | Close (Board *brd) |
static const char * | versionToString (uint32_t ver) |
Returns a string representation of a version number. | |
Protected Types | |
typedef std::map< std::string, uint32_t > | mapn2a_t |
typedef std::map< uint32_t, std::string > | mapa2n_t |
Protected Member Functions | |
Board () | |
virtual | ~Board () |
void | traceOper (OperList &lst, int rc) |
Generate output for get/put/operGen traces. | |
void | setRole (ClientRole role) |
uint32_t | initBoard (const char *name, uint32_t minversion) |
Checks and print board kind, version and id. | |
Protected Attributes | |
unsigned | fBoardId |
mapn2a_t | fMapName2Addr |
mapa2n_t | fMapAddr2Name |
BoardFactory * | fBrdFactory |
factory used to create board instance | |
double | fDefaultTimeout |
default timeout | |
int | fVerbosity |
Debug verbosity level. | |
int | fOperTrace |
Oper trace level. | |
ClientRole | fRole |
client role (access rights) | |
uint32_t | fBrdNumber |
number of connected ROC |
Definition at line 9 of file Board.h.
typedef std::map<uint32_t,std::string> base::Board::mapa2n_t [protected, inherited] |
typedef std::map<std::string,uint32_t> base::Board::mapn2a_t [protected, inherited] |
enum base::Board::addrErr [inherited] |
enum base::Board::operErr [inherited] |
Return codes for get, put and oper calls.
For a detailed documentation of get/put/oper return code see roc::Board get/put/oper return codes.
sp605::Board::Board | ( | ) | [protected] |
Reimplemented from base::Board.
Definition at line 6 of file Board.cxx.
References sp605::addr_BoardId, sp605::addr_HwType, sp605::addr_HwVersion, and base::Board::addRegAddrMapping().
sp605::Board::~Board | ( | ) | [protected, virtual] |
Reimplemented from base::Board.
void base::Board::addRegAddrMapping | ( | const char * | name, | |
uint32_t | addr | |||
) | [inherited] |
Add an entry to the ROC control space address mapping table.
This method is protected and used in the contructors to initialize the table.
Definition at line 399 of file Board.cxx.
References base::Board::fMapAddr2Name, and base::Board::fMapName2Addr.
Referenced by roc::I2cDevice::addAddrMap(), nxyter::RocNx::addAddrMap(), nxyter::MainAdc::addAddrMap(), feet::RocFeet::addAddrMap(), base::Gpio::addAddrMap(), Board(), roc::Board::Board(), and roc::UdpBoard::UdpBoard().
uint32_t base::Board::boardNumber | ( | ) | const [inline, inherited] |
Returns locally stored board number.
Definition at line 329 of file Board.h.
References base::Board::fBrdNumber.
Referenced by roc::AbbBoard::initAbbBoard(), roc::UdpDevice::initUdp(), roc::Iterator::Iterator(), roc::Iterator::nextBuffer(), and roc::Board::rocNumber().
bool base::Board::Close | ( | Board * | brd | ) | [static, inherited] |
Definition at line 493 of file Board.cxx.
References base::BoardFactory::DestroyBoard().
Referenced by main(), and roc::Iterator::~Iterator().
base::Board * base::Board::Connect | ( | const char * | url, | |
ClientRole | role = roleNone | |||
) | [static, inherited] |
Definition at line 488 of file Board.cxx.
References base::BoardFactory::CreateBoard().
Referenced by cmd_board(), and main().
void base::Board::Debug | ( | int | lvl, | |
const char * | fmt, | |||
... | ||||
) | [inherited] |
Print a formatted debug message.
Show debug information, using functionality of factory
If the debug level lvl is less or equal to the verbosity level setup with setVerbosity() a message will be printed with ShowDebug(). The message text is defined by the printf
style format fmt and variable length argument list.
lvl | debug level | |
fmt | format a la printf |
Debug(-1, "Error reading Register %d on bus %d", reg, num);
Definition at line 64 of file Board.cxx.
References base::Board::fBrdFactory, base::Board::getVerbosity(), and base::BoardFactory::ShowDebug().
Referenced by roc::UdpBoard::calcBinXOR(), roc::Board::downloadCommandsList(), base::Board::initBoard(), roc::UdpBoard::loadConfig(), roc::UdpBoard::parseBitfileHeader(), roc::UdpBoard::saveConfig(), nxyter::MainAdc::setClockDelay(), nxyter::NxChip::setNxNumber(), roc::UdpBoard::setRocLowHighWater(), nxyter::QuickDaq::startRun(), base::Board::traceOper(), roc::UdpBoard::uploadBitfile(), roc::Board::uploadCommandsList(), roc::UdpBoard::uploadDataToRoc(), and roc::UdpBoard::uploadSDfile().
void base::Board::fillRegAddrNames | ( | std::list< std::string > & | lst | ) | [inherited] |
Definition at line 465 of file Board.cxx.
References base::Board::fMapName2Addr.
Referenced by BoardWidget::BoardWidget().
uint32_t base::Board::findRegAddressByName | ( | const char * | name | ) | [inherited] |
Retrieve a ROC control space address by its symbolic name.
Methods about map of registers addresses and their symbolic names
Locates in the ROC control space address mapping table the entry for the name name and returns the associated address in addr.
name | name to be looked up | |
addr | address to be returned |
Definition at line 417 of file Board.cxx.
References base::Board::fMapName2Addr, and base::Board::kAddrError.
Referenced by cmd_getroc(), cmd_putroc(), BoardWidget::getRegister(), and BoardWidget::putRegister().
const char * base::Board::findRegNameByAddress | ( | uint32_t | addr | ) | [inherited] |
Retrieve symbolic name of a ROC control space address.
Locates in the Board control space address mapping table the entry for the address addr and returns the associated symbolic name in name.
addr | address to be looked up |
Definition at line 436 of file Board.cxx.
References base::Board::fMapAddr2Name, and base::Board::kAddrError.
Referenced by cmd_printroc(), RocMainWidget::getCmdList(), and base::Board::traceOper().
int base::Board::get | ( | uint32_t | addr, | |
uint32_t & | value, | |||
double | tmout = 0. | |||
) | [inherited] |
Definition at line 161 of file Board.cxx.
References base::Board::operGen().
Referenced by cmd_board(), cmd_getroc(), cmd_printid(), cmd_printroc(), nxyter::MainAdc::getAdcDirect(), nxyter::NxChip::getChannelDelay(), nxyter::MainAdc::getChannelLatency(), nxyter::MainAdc::getClockDelayBufg(), nxyter::MainAdc::getClockDelaySrInit(), base::Gpio::getConfig(), nxyter::RocNx::getFifoEmpty(), nxyter::RocNx::getFifoFull(), nxyter::RocNx::getNxActive(), BoardWidget::getRegister(), RocMainWidget::getSubConfig(), and base::Gpio::getSyncScale().
virtual uint32_t base::Board::getBackendKind | ( | ) | [inline, virtual, inherited] |
Return backend kinds - kind_Optic (1), kind_FX20 (2), kind_FX40 (3) or kind_FX60 (4).
Definition at line 325 of file Board.h.
References base::Board::getHardwareType().
virtual unsigned base::Board::GetBoardId | ( | ) | const [inline, virtual, inherited] |
Method returns board id
Reimplemented in roc::Board.
Definition at line 202 of file Board.h.
Referenced by base::Board::traceOper().
uint32_t base::Board::getBoardNumber | ( | ) | [inherited] |
Request number from board.
Returns board number as stored in ROC.
Definition at line 568 of file Board.cxx.
References base::addr_BoardId, and base::Board::fBrdNumber.
Referenced by roc::Board::getRocNumber().
double base::Board::getDefaultTimeout | ( | ) | const [inline, inherited] |
Returns default get/put/oper timeout.
Definition at line 120 of file Board.h.
References base::Board::fDefaultTimeout.
Referenced by sp605::OpticBoard::invokeDLM(), roc::AbbBoard::invokeDLM(), roc::UdpDevice::operGen(), sp605::OpticBoard::operGen(), roc::AbbBoard::operGen(), and roc::UdpDevice::rawPut().
virtual uint32_t base::Board::getFrontendKind | ( | ) | [inline, virtual, inherited] |
Return frontend kinds - kind_nXYTER (1), kind_oldFEET (2) or kind_FEET (3).
Definition at line 322 of file Board.h.
References base::Board::getHardwareType().
Referenced by cmd_board(), sp605::OpticBoard::initAbbBoard(), and main().
uint32_t base::Board::getHardwareType | ( | ) | [virtual, inherited] |
Returns hardware type (frontend/backend) of ROC (FPGA firmware kind).
Returns kind of fornend (higher 16 bit) and backend (lower 16 bit)
Definition at line 512 of file Board.cxx.
Referenced by base::Board::getBackendKind(), and base::Board::getFrontendKind().
uint32_t base::Board::getHardwareVersion | ( | ) | [virtual, inherited] |
virtual int base::Board::getMsgFormat | ( | ) | const [pure virtual, inherited] |
getMsgFormat
Returns message format like roc::formatEth2, roc::formatOptic2 and so on Base on message format appropriate iterator must be used to access messages from raw buffers
Implemented in roc::AbbBoard, sp605::OpticBoard, roc::FileInput, and roc::UdpDevice.
Referenced by roc::ReadoutApplication::CreateRocCombiner(), roc::Iterator::Iterator(), sp605::Iterator::nextBuffer(), roc::Iterator::nextBuffer(), and TRocSource::Open().
virtual bool base::Board::getNextBuffer | ( | void *& | buf, | |
unsigned & | len, | |||
double | tmout = 1. | |||
) | [pure virtual, inherited] |
getNextBuffer
Returns pointer on the buffer which contains received messages.
len | returns length of buffer in bytes. Buffer is allocated by board itself, buffer content remains valid until next call of getNextBuffer() or when daq is stopped. Format of messages can be defined by getMsgFormat() To extract single messages from the buffer, roc::Iterator class should be used |
Implemented in roc::AbbBoard, sp605::OpticBoard, roc::FileInput, and roc::UdpDevice.
Referenced by TRocSource::BuildEvent(), sp605::Iterator::nextBuffer(), and roc::Iterator::nextBuffer().
int base::Board::getOperTrace | ( | ) | const [inline, inherited] |
Returns debug output verbosity level.
Definition at line 169 of file Board.h.
References base::Board::fOperTrace.
ClientRole base::Board::getRole | ( | ) | const [inline, inherited] |
Returns client role.
Definition at line 128 of file Board.h.
References base::Board::fRole.
Referenced by cmd_board(), cmd_feb(), roc::UdpDevice::ExecuteCommand(), roc::UdpDevice::InitAsBoard(), roc::UdpDevice::initUdp(), and roc::UdpDevice::~UdpDevice().
virtual int base::Board::getTransportKind | ( | ) | const [pure virtual, inherited] |
getTransportKind
Returns kind of transport - base::kind_UDP, base::kind_ABB or base::kind_File
Implemented in sp605::OpticBoard, roc::OpticBoard, roc::UdpBoard, and roc::FileInput.
Referenced by cmd_printid(), cmd_printroc(), roc::ReadoutApplication::CreateRocCombiner(), RocMainWidget::getSubConfig(), base::Board::isFile(), base::Board::isOptic(), base::Board::isUSB(), roc::Board::uploadStartDaqCmdList(), and roc::Board::uploadStopDaqCmdList().
int base::Board::getVerbosity | ( | ) | const [inline, inherited] |
Returns debug output verbosity level.
Definition at line 125 of file Board.h.
References base::Board::fVerbosity.
Referenced by base::Board::Debug().
uint32_t base::Board::initBoard | ( | const char * | name, | |
uint32_t | minversion | |||
) | [protected, inherited] |
Checks and print board kind, version and id.
Definition at line 523 of file Board.cxx.
References base::OperList::addGet(), base::addr_BoardId, base::addr_HardwareType, base::addr_HardwareVersion, base::Board::Debug(), base::Board::fBrdNumber, base::kind_FEET, base::kind_FX20, base::kind_FX40, base::kind_FX60, base::kind_newNX, base::kind_newOptic, base::kind_nXYTER, base::kind_oldFEET, base::kind_Optic, base::kind_SPADIC, base::OperList::oper(), base::Board::operGen(), base::Oper::value, and base::Board::versionToString().
Referenced by sp605::OpticBoard::initAbbBoard(), roc::AbbBoard::initAbbBoard(), and roc::UdpDevice::initUdp().
virtual int base::Board::invokeDLM | ( | unsigned | num, | |
double | tmout = 0. | |||
) | [inline, virtual, inherited] |
invokeDLM - method generate DLM, which sends to every endnode
Reimplemented in roc::AbbBoard, sp605::OpticBoard, roc::Board, and roc::UdpBoard.
virtual bool sp605::Board::is_SPI_I2C | ( | ) | const [inline, virtual] |
is_SPI_I2C - return true if SPI interface should be used to access I2C bus
Reimplemented from base::Board.
bool base::Board::isFile | ( | ) | const [inline, inherited] |
isFile
Returns true if board is just envelope around file reading - most operation like put/get are nit working and should not be tried
Definition at line 296 of file Board.h.
References base::Board::getTransportKind().
Referenced by cmd_board(), cmd_printdata(), roc::Iterator::isFile(), nxyter::QuickDaq::startRun(), and nxyter::QuickDaq::testRun().
bool base::Board::isOptic | ( | ) | const [inline, inherited] |
isOptic - returns true when optic use for connection
Definition at line 299 of file Board.h.
References base::Board::getTransportKind().
bool base::Board::isUSB | ( | ) | const [inline, inherited] |
isUSB - returns true when optic use for connection
Definition at line 302 of file Board.h.
References base::Board::getTransportKind().
static int base::Board::operErrBuild | ( | int | code, | |
int | index | |||
) | [inline, static, inherited] |
Build get/put/oper return code from error code and index value.
Build a return code for a board access method from an error code code, in general one of the values specified in the board::operErr enum, and an index value index.
code | error code. Only the lower 8 bits are used, to one can use a full return code, the index part will be discarded. | |
index | index or stage number at the point of failure |
Definition at line 258 of file Board.h.
Referenced by roc::UdpControlSocket::completeLoop(), roc::AbbDevice::ExecuteCommand(), nxyter::RocNx::fireTestPulse(), roc::I2cDevice::getMailboxRegister(), roc::I2cDevice::getRegister(), nxyter::MainAdc::getRegister(), roc::I2cDevice::getRegisterArray(), nxyter::NxI2c::getRegTrim(), base::Board::operErrBuildInc(), nxyter::NxI2c::probe(), nxyter::MainAdc::probe(), nxyter::MainAdc::setClockDelay(), nxyter::NxI2c::setContext(), roc::I2cDevice::setMailboxRegister(), nxyter::FebBase::setNxRegisterAll(), nxyter::FebBase::setNxTestModes(), roc::I2cDevice::setRegister(), nxyter::MainAdc::setRegister(), roc::I2cDevice::setRegisterArray(), roc::I2cDevice::setRegisterVerify(), nxyter::NxI2c::setRegTrim(), nxyter::MainAdc::setTestMode(), nxyter::NxI2c::setTestModes(), nxyter::RocNx::setToDefault(), nxyter::MainAdc::setToDefault(), nxyter::FebBase::setToDefault(), and nxyter::MainAdc::setUserPattern().
static int base::Board::operErrBuildInc | ( | int | rc, | |
int | inc | |||
) | [inline, static, inherited] |
Add to index value of get/put/oper return code.
rc | return code from board access method | |
inc | value to be added to the index field |
Definition at line 269 of file Board.h.
References base::Board::operErrBuild(), and base::Board::operErrIndex().
Referenced by nxyter::NxChip::activate(), nxyter::NxChip::deactivate(), nxyter::NxI2c::getContext(), nxyter::NxI2c::getRegCore(), nxyter::FebBase::initRoc(), base::Gpio::setConfig(), nxyter::NxI2c::setContext(), nxyter::QuickDaq::setNxRegisterAll(), nxyter::QuickDaq::setNxTestModes(), nxyter::NxI2c::setRegCore(), and nxyter::NxI2c::setRegTrim().
static int base::Board::operErrCode | ( | int | rc | ) | [inline, static, inherited] |
Retrieve error code from get/put/oper return code.
Extracts the error code, in general one of the values specified in the board::operErr enum, from a return code rc of a board access method.
Definition at line 234 of file Board.h.
Referenced by base::Board::operErrCodeName(), base::Board::operErrToString(), and nxyter::FebUtil::probe().
const char * base::Board::operErrCodeName | ( | int | rc | ) | [static, inherited] |
Returns descriptive text for a get/put/oper error code.
rc | return code, the index part will be ignored |
Definition at line 343 of file Board.cxx.
References base::Board::kOperAddrErr, base::Board::kOperBusErr, base::Board::kOperNetworkErr, base::Board::kOperStateErr, base::Board::kOperSuccess, base::Board::kOperValueErr, base::Board::kOperVerifyErr, and base::Board::operErrCode().
Referenced by base::Board::operErrToString(), and nxyter::FebUtil::probe().
static int base::Board::operErrIndex | ( | int | rc | ) | [inline, static, inherited] |
Retrieve index from get/put/oper return code.
Extracts the index value from a return code rc of a board access. method. The index allows to reconstruct at which point of an access sequence the error occurred.
Definition at line 244 of file Board.h.
Referenced by base::Board::operErrBuildInc(), base::Board::operErrToString(), and nxyter::FebUtil::probe().
std::string base::Board::operErrToString | ( | int | rc | ) | [static, inherited] |
Returns a string with a human readable form of a get/put/oper return code.
Return codes of many roc or device handling methods return either a negative number to indicate an illegal argument combination or state or a positive number to indicate a control space access errors (see roc::Board get/put/oper return codes). This method converts the return code into a human readable form. For negative values it simply returns "rc = nnn", while for positive values it extracts the index and error code part of the return code rc and returns a string of the form
rc = 7,20 -> readback verify error | | | | | string representation of error code | error code index part
Definition at line 376 of file Board.cxx.
References base::Board::operErrCode(), base::Board::operErrCodeName(), and base::Board::operErrIndex().
Referenced by cmd_geti2c(), cmd_printroc(), cmd_printstatus(), cmd_puti2c(), cmd_seti2c(), print_opererr(), nxyter::NxI2c::printRegisters(), nxyter::FebUtil::testFebControlPathCombo(), nxyter::FebUtil::testMainAdcControlPath(), nxyter::FebUtil::testMainAdcDataPath(), nxyter::FebUtil::testNxControlPath(), nxyter::FebUtil::testNxRegisters(), and base::Board::traceOper().
virtual int base::Board::operGen | ( | OperList & | lst, | |
double | tmout = 0. | |||
) | [pure virtual, inherited] |
General operate, arbitrary list of get/put accesses to ROC control space.
This function allow to execute a list of gets and puts from and to the ROC control address space. It is guaranteed that the execution is an atomic action, no control space access from other sources will be handled concurrently.
isput | array of flags, if true a put is done, otherwise a get. | |
addr | array of ROC control space addresses | |
value | array of data values. If the corresponding entry in isput is true the array element is read and written into the ROC address, otherwise the array element is written by data retrieved from the ROC address. | |
num | number of operates to do, size of arrays isput, addr, and value | |
tmout | maximal network response time |
Implemented in roc::AbbBoard, sp605::OpticBoard, roc::FileInput, and roc::UdpDevice.
Referenced by roc::Board::downloadCommandsList(), base::Board::get(), DataWidget::getData(), nxyter::RocNx::getDataDebug(), OpticWidget::getDLMHistory(), roc::I2cDevice::getRegister(), nxyter::MainAdc::getRegister(), roc::I2cDevice::getRegister16(), RocNxWidget::getSubConfig(), RocFeetWidget::getSubConfig(), OpticWidget::getSubConfig(), base::Board::initBoard(), base::Board::operGen(), base::Board::operGGG(), base::Board::operPG(), base::Board::operPP(), base::Board::operPPP(), base::Board::operPPPP(), base::Board::put(), nxyter::RocNx::resetRocNxTs(), roc::I2cDevice::setRegister(), nxyter::MainAdc::setRegister(), roc::I2cDevice::setRegisterVerify(), RocNxWidget::setSubConfig(), RocFeetWidget::setSubConfig(), roc::NxCalibrModule::switchCalibration(), and roc::Board::uploadCommandsList().
int base::Board::operGen | ( | bool * | isput, | |
uint32_t * | addr, | |||
uint32_t * | value, | |||
int | num, | |||
double | tmout = 0. | |||
) | [virtual, inherited] |
Method need to be virtual to satisfy compiler rules
Definition at line 137 of file Board.cxx.
References base::OperList::oper(), base::Board::operGen(), and base::Oper::value.
int base::Board::operGGG | ( | uint32_t | addr0, | |
uint32_t & | val0p, | |||
uint32_t | addr1, | |||
uint32_t & | val1p, | |||
uint32_t | addr2, | |||
uint32_t & | val2p, | |||
double | tmout = 0. | |||
) | [inherited] |
Get-Get-Get accesses sequence to ROC control space.
This is a specialization of operGen(), check the documentation of this method for details.
addr0 | address for 1st get | |
val0p | value to write in 1st get | |
addr1 | address for 2nd get | |
val1p | value to write in 2nd get | |
addr2 | address for 3rd get | |
val2p | value to write in 3rd get | |
tmout | maximal network response time |
Definition at line 277 of file Board.cxx.
References base::Board::operGen().
Referenced by base::Gpio::getSyncBaud().
int base::Board::operPG | ( | uint32_t | addr0, | |
uint32_t | val0p, | |||
uint32_t | addr1, | |||
uint32_t & | val1g, | |||
double | tmout = 0. | |||
) | [inherited] |
Put-Get accesses sequence to ROC control space.
This is a specialization of operGen(), check the documentation of this method for details.
addr0 | address for 1st put | |
val0p | value to write in 1st put | |
addr1 | address for 1st get | |
val1g | value returned in 1st get | |
tmout | maximal network response time |
Definition at line 212 of file Board.cxx.
References base::Board::operGen().
Referenced by nxyter::MainAdc::getRegister().
int base::Board::operPP | ( | uint32_t | addr0, | |
uint32_t | val0p, | |||
uint32_t | addr1, | |||
uint32_t | val1p, | |||
double | tmout = 0. | |||
) | [inherited] |
Put-Put accesses sequence to ROC control space.
This is a specialization of operGen(), check the documentation of this method for details.
addr0 | address for 1st put | |
val0p | value to write in 1st put | |
addr1 | address for 2nd put | |
val1p | value to write in 2nd put | |
tmout | maximal network response time |
Definition at line 183 of file Board.cxx.
References base::Board::operGen().
Referenced by roc::Board::clearRocFifo(), and RocFeetWidget::resetFifo().
int base::Board::operPPP | ( | uint32_t | addr0, | |
uint32_t | val0p, | |||
uint32_t | addr1, | |||
uint32_t | val1p, | |||
uint32_t | addr2, | |||
uint32_t | val2p, | |||
double | tmout = 0. | |||
) | [inherited] |
Put-Put-Put accesses sequence to ROC control space.
This is a specialization of operGen(), check the documentation of this method for details.
addr0 | address for 1st put | |
val0p | value to write in 1st put | |
addr1 | address for 2nd put | |
val1p | value to write in 2nd put | |
addr2 | address for 3rd put | |
val2p | value to write in 3rd put | |
tmout | maximal network response time |
Definition at line 244 of file Board.cxx.
References base::Board::operGen().
Referenced by autoped_issue_system_message(), nxyter::FebBase::resetNxI2cBus(), nxyter::FebBase::resetNxI2cRegister(), and base::Gpio::setSyncBaud().
int base::Board::operPPPP | ( | uint32_t | addr0, | |
uint32_t | val0p, | |||
uint32_t | addr1, | |||
uint32_t | val1p, | |||
uint32_t | addr2, | |||
uint32_t | val2p, | |||
uint32_t | addr3, | |||
uint32_t | val3p, | |||
double | tmout = 0. | |||
) | [inherited] |
Put-Put-Put-Put accesses sequence to ROC control space.
This is a specialization of operGen(), check the documentation of this method for details.
addr0 | address for 1st put | |
val0p | value to write in 1st put | |
addr1 | address for 2nd put | |
val1p | value to write in 2nd put | |
addr2 | address for 3rd put | |
val2p | value to write in 3rd put | |
addr3 | address for 4th put | |
val3p | value to write in 4th put | |
tmout | maximal network response time |
Definition at line 317 of file Board.cxx.
References base::Board::operGen().
Referenced by nxyter::RocNx::fireTestPulse().
void base::Board::printRegAddressMap | ( | std::ostream & | os, | |
bool | byname = false | |||
) | [inherited] |
Definition at line 447 of file Board.cxx.
References base::Board::fMapAddr2Name, and base::Board::fMapName2Addr.
Referenced by cmd_printrocmap().
int base::Board::put | ( | uint32_t | addr, | |
uint32_t | value, | |||
double | tmout = 0. | |||
) | [inherited] |
Definition at line 154 of file Board.cxx.
References base::Board::operGen().
Referenced by roc::BoardsVector::autoped_issue_system_message(), roc::UdpBoard::BURST(), cmd_putroc(), RocNxWidget::delayChanged(), RocFeetWidget::enableDatagen(), RocFeetWidget::initFeet(), nxyter::FebBase::initRoc(), roc::UdpDevice::initUdp(), roc::Board::invokeCommandsList(), roc::UdpBoard::invokeDLM(), RocNxWidget::latencyChanged(), RocNxWidget::parityChanged(), BoardWidget::putRegister(), RocFeetWidget::resetFrontend(), roc::Board::restartRoc(), RocFeetWidget::sendCmdToFeet(), base::Board::setBoardNumber(), nxyter::NxChip::setChannelDelay(), nxyter::MainAdc::setChannelLatency(), nxyter::MainAdc::setChannelMux(), nxyter::MainAdc::setClockDelayBufg(), nxyter::MainAdc::setClockDelaySrInit(), base::Gpio::setConfig(), roc::UdpBoard::setConsoleOutput(), OpticWidget::setDataGen(), nxyter::RocNx::setDebugMode(), RocFeetWidget::setEpoch250En(), nxyter::RocNx::setLTSDelay(), nxyter::RocNx::setNxActive(), nxyter::RocNx::setParityCheck(), roc::UdpBoard::setRocBufferFlushTimer(), roc::UdpBoard::setRocLowHighWater(), OpticWidget::setSendDLM_R2A(), OpticWidget::setStartDAQ(), OpticWidget::setStopDAQ(), base::Gpio::setSyncScale(), nxyter::RocNx::setToDefault(), roc::UdpBoard::switchToConsole(), and roc::UdpBoard::uploadDataToRoc().
virtual bool base::Board::restartBoard | ( | ) | [inline, virtual, inherited] |
resetBoard - method should restart board. Return true if implemented. One should immediately close connection to board
Reimplemented in roc::Board.
Definition at line 305 of file Board.h.
Referenced by cmd_restartbrd(), and BoardWidget::resetBoard().
void base::Board::setBoardNumber | ( | uint32_t | num | ) | [inherited] |
Change board number in device.
Updates board number in device memory.
Definition at line 580 of file Board.cxx.
References base::addr_BoardId, and base::Board::put().
Referenced by roc::Board::setRocNumber().
void base::Board::setDefaultTimeout | ( | double | tmout = 2. |
) | [inline, inherited] |
Set default get/put/oper timeout.
The value set with this method is used whenever no explicit timeout is specified in a get(), put() or openGen() call.
tmout | network communication timeout in sec. |
Definition at line 117 of file Board.h.
References base::Board::fDefaultTimeout.
virtual void base::Board::setFlushTimeout | ( | double | tmout | ) | [inline, virtual, inherited] |
Sets flush timeout of data transport.
Local transport accumulates data in buffer and until buffer is not filled, data is not delivered further. Flush timeout defines time interval, when any amount of data will be flushed.
tmout | timeout value in sec. |
Reimplemented in roc::AbbBoard, sp605::OpticBoard, roc::FileInput, and roc::UdpDevice.
Definition at line 400 of file Board.h.
Referenced by TRocSource::Open(), and nxyter::QuickDaq::startRun().
void base::Board::setOperTrace | ( | int | lvl = 1 |
) | [inline, inherited] |
Set get/put/operGen trace level.
Controls whether the full context of get(), put() and operGen() requests is printed to stdout. The lvl determines whether all, none or only failed requests are traced:
The output format is like (-> indicates get, <- indicates put):
get (3,0x00000580 ROC_GPIO_CONFIG ) -> 0x00000000 0 ok put (3,0x00000580 ROC_GPIO_CONFIG ) <- 0x00000100 256 ok op[00](3,0x00000514 ROC_SYNC2_BAUD_START ) <- 0x00000002 2 op[01](3,0x00000518 ROC_SYNC2_BAUD1 ) <- 0x00000004 4 op[02](3,0x0000051c ROC_SYNC2_BAUD2 ) <- 0x00000004 4 ok put (3,0x00000500 ROC_SYNC1_M_SCALEDOWN ) <- 0x00000004 4 ok op[00](3,0x00000504 ROC_SYNC1_BAUD_START ) <- 0x00000002 2 op[01](3,0x00000508 ROC_SYNC1_BAUD1 ) <- 0x00000004 4 op[02](3,0x0000050c ROC_SYNC1_BAUD2 ) <- 0x00000004 4 ok op[00](3,0x00000054 ROC_TESTPULSE_LENGTH ) <- 0x0000c34f 49999 op[01](3,0x00000058 ROC_TESTPULSE_NUMBER ) <- 0x00000000 0 op[02](3,0x0000005c ROC_TESTPULSE_START ) <- 0x00000001 1 ok op[00](3,0x00010100 ROC_I2C1_SWITCH ) <- 0x00000000 0 op[01](3,0x0001000c ROC_I2C1_SLAVEADDR ) <- 0x00000008 8 op[02](3,0x00010010 ROC_I2C1_REGISTER ) <- 0x00000015 21 op[03](3,0x00010000 ROC_I2C1_DATA ) -> 0x0000000f 15 op[04](3,0x00010020 ROC_I2C1_ERROR ) -> 0x00000000 0 ok
Definition at line 166 of file Board.h.
References base::Board::fOperTrace.
Referenced by cmd_settrace().
void base::Board::setRole | ( | ClientRole | role | ) | [inline, protected, inherited] |
Definition at line 84 of file Board.h.
References base::Board::fRole.
Referenced by roc::AbbBoard::AbbBoard(), roc::FileInput::FileInput(), sp605::OpticBoard::OpticBoard(), and roc::UdpDevice::UdpDevice().
virtual int base::Board::setToDefault | ( | ) | [inline, virtual, inherited] |
setToDefault - method set all board registers to default values. Return 0 if ok
Reimplemented in roc::Board.
Definition at line 311 of file Board.h.
Referenced by cmd_setbrddef(), cmd_setrocdef(), and BoardWidget::setSubToDefault().
void base::Board::setVerbosity | ( | int | lvl = 0 |
) | [inline, inherited] |
Set debug output verbosity level.
Definition at line 123 of file Board.h.
References base::Board::fVerbosity.
Referenced by cmd_setdebug().
virtual bool base::Board::startDaq | ( | ) | [pure virtual, inherited] |
Activate DAQ.
This method will initialize the data transport chain which brings message data from the ROC. The details depend in the underlying transport. By the daq starting commands list 0 is always executed. This commands list can be initialized by
Implemented in roc::AbbBoard, sp605::OpticBoard, roc::FileInput, and roc::UdpDevice.
Referenced by roc::Iterator::Iterator(), TRocSource::Open(), and nxyter::QuickDaq::startRun().
virtual bool base::Board::stopDaq | ( | ) | [pure virtual, inherited] |
stopDaq
Complimentary function for startDaq. Disables any new data requests, all coming data will be discarded
Implemented in roc::AbbBoard, sp605::OpticBoard, roc::FileInput, and roc::UdpDevice.
Referenced by TRocSource::Close(), and nxyter::QuickDaq::startRun().
virtual bool base::Board::suspendDaq | ( | ) | [pure virtual, inherited] |
suspendDaq
Sends to ROC ROC_SUSPEND_DAQ command. ROC will produce stop message and will deliver it sometime to host PC. User can continue to take data until this message. Normally no more messages will be delivered after stop daq message.
Implemented in roc::AbbBoard, sp605::OpticBoard, roc::FileInput, and roc::UdpDevice.
Referenced by nxyter::QuickDaq::stopRun().
void base::Board::traceOper | ( | OperList & | lst, | |
int | rc | |||
) | [protected, inherited] |
Generate output for get/put/operGen traces.
isput | 'isput' array | |
addr | 'addr' array (or pointer to address in case of get/put) | |
value | 'value' array (or pointer to value in case of get/put) | |
num | request list length | |
rc | return code |
Definition at line 103 of file Board.cxx.
References base::Oper::addr, base::Board::Debug(), base::Board::findRegNameByAddress(), base::Board::fOperTrace, base::Board::GetBoardId(), base::Oper::isput, base::Board::kOperNetworkErr, base::OperList::number(), base::OperList::oper(), base::Board::operErrToString(), and base::Oper::value.
Referenced by roc::UdpDevice::operGen(), sp605::OpticBoard::operGen(), and roc::AbbBoard::operGen().
const char * base::Board::versionToString | ( | uint32_t | ver | ) | [static, inherited] |
Returns a string representation of a version number.
Definition at line 476 of file Board.cxx.
Referenced by cmd_printid(), RocNxWidget::getSubConfig(), RocMainWidget::getSubConfig(), RocFeetWidget::getSubConfig(), OpticWidget::getSubConfig(), roc::AbbBoard::initAbbBoard(), base::Board::initBoard(), and roc::UdpDevice::initUdp().
unsigned sp605::Board::fBoardId [protected] |
BoardFactory* base::Board::fBrdFactory [protected, inherited] |
factory used to create board instance
Definition at line 70 of file Board.h.
Referenced by base::BoardFactory::CreateBoard(), base::Board::Debug(), and base::BoardFactory::DestroyBoard().
uint32_t base::Board::fBrdNumber [protected, inherited] |
number of connected ROC
Definition at line 75 of file Board.h.
Referenced by base::Board::boardNumber(), base::Board::getBoardNumber(), roc::FileInput::getNextBuffer(), and base::Board::initBoard().
double base::Board::fDefaultTimeout [protected, inherited] |
default timeout
Definition at line 71 of file Board.h.
Referenced by base::Board::getDefaultTimeout(), and base::Board::setDefaultTimeout().
mapa2n_t base::Board::fMapAddr2Name [protected, inherited] |
Definition at line 68 of file Board.h.
Referenced by base::Board::addRegAddrMapping(), base::Board::findRegNameByAddress(), and base::Board::printRegAddressMap().
mapn2a_t base::Board::fMapName2Addr [protected, inherited] |
Definition at line 67 of file Board.h.
Referenced by base::Board::addRegAddrMapping(), base::Board::fillRegAddrNames(), base::Board::findRegAddressByName(), and base::Board::printRegAddressMap().
int base::Board::fOperTrace [protected, inherited] |
Oper trace level.
Definition at line 73 of file Board.h.
Referenced by base::Board::getOperTrace(), base::Board::setOperTrace(), and base::Board::traceOper().
ClientRole base::Board::fRole [protected, inherited] |
client role (access rights)
Definition at line 74 of file Board.h.
Referenced by base::Board::getRole(), and base::Board::setRole().
int base::Board::fVerbosity [protected, inherited] |
Debug verbosity level.
Definition at line 72 of file Board.h.
Referenced by base::Board::getVerbosity(), and base::Board::setVerbosity().