eiger server: quad, interrupt subframe, reg left and right (#45)

* eiger server: quad, interrupt subframe, reg left and right

*  eiger server: beb can fail in setting up quad, quad and gap pixels
This commit is contained in:
Dhanya Thattil
2019-08-06 10:12:34 +02:00
committed by Erik Fröjdh
parent e17de0609c
commit d72b6c3659
25 changed files with 463 additions and 105 deletions

View File

@ -1374,6 +1374,27 @@ int multiSlsDetector::setReadOutFlags(readOutFlags flag, int detPos) {
return sls::minusOneIfDifferent(r);
}
void multiSlsDetector::setInterruptSubframe(const bool enable, int detPos) {
// single
if (detPos >= 0) {
detectors[detPos]->setInterruptSubframe(enable);
}
// multi
parallelCall(&slsDetector::setInterruptSubframe, enable);
}
int multiSlsDetector::getInterruptSubframe(int detPos) {
// single
if (detPos >= 0) {
return static_cast<int>(detectors[detPos]->getInterruptSubframe());
}
// multi
auto r = parallelCall(&slsDetector::getInterruptSubframe);
return sls::minusOneIfDifferent(r);
}
uint32_t multiSlsDetector::writeRegister(uint32_t addr, uint32_t val,
int detPos) {
// single

View File

@ -1526,6 +1526,21 @@ int slsDetector::setReadOutFlags(readOutFlags flag) {
return shm()->roFlags;
}
void slsDetector::setInterruptSubframe(const bool enable) {
int arg = static_cast<int>(enable);
FILE_LOG(logDEBUG1) << "Setting Interrupt subframe to " << arg;
sendToDetector(F_SET_INTERRUPT_SUBFRAME, arg, nullptr);
}
bool slsDetector::getInterruptSubframe() {
int retval = -1;
FILE_LOG(logDEBUG1) << "Getting Interrupt subframe";
sendToDetector(F_GET_INTERRUPT_SUBFRAME, nullptr, retval);
FILE_LOG(logDEBUG1) << "Interrupt subframe: " << retval;
return static_cast<bool>(retval);
}
uint32_t slsDetector::writeRegister(uint32_t addr, uint32_t val) {
uint32_t args[]{addr, val};
uint32_t retval = -1;

View File

@ -383,6 +383,13 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdAdvanced;
++i;
/*! \page config
- <b>interruptsubframe [i]</b> sets/gets the interrupt subframe flag. Setting it to 1 will interrupt the last subframe at the required exposure time. By default, this is disabled and set to 0, ie. it will wait for the last sub frame to finish exposing. Used for EIGER in 32 bit mode only. \c Returns \c (int).
*/
descrToFuncMap[i].m_pFuncName="interruptsubframe";
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAdvanced;
++i;
/*! \page config
- <b>extsig [flag]</b> sets/gets the mode of the external signal. Options: \c off, \c gate_in_active_high, \c gate_in_active_low, \c trigger_in_rising_edge, \c trigger_in_falling_edge,
\c ro_trigger_in_rising_edge, \c ro_trigger_in_falling_edge, \c gate_out_active_high, \c gate_out_active_low, \c trigger_out_rising_edge, \c trigger_out_falling_edge, \c ro_trigger_out_rising_edge,
@ -4737,7 +4744,15 @@ std::string slsDetectorCommand::cmdAdvanced(int narg, const char * const args[],
return std::string("unknown");
} else if (cmd == "extsig") {
} else if (cmd=="interruptsubframe") {
if (action==PUT_ACTION) {
int ival = -1;
if (!sscanf(args[1],"%d",&ival))
return std::string("could not scan interrupt sub frame parameter ") + std::string(args[1]);
myDet->setInterruptSubframe(ival > 0 ? true : false);
}
return std::to_string(myDet->getInterruptSubframe());
} else if (cmd == "extsig") {
externalSignalFlag flag = GET_EXTERNAL_SIGNAL_FLAG;
if (action == PUT_ACTION) {
@ -4858,7 +4873,7 @@ std::string slsDetectorCommand::helpAdvanced(int action) {
os << "extsig mode \t sets the mode of the external signal. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl;
os << "flags mode \t sets the readout flags to mode. can be none, storeinram, tot, continous, parallel, nonparallel, digital, analog_digital, overlow, nooverflow, unknown." << std::endl;
os << "interruptsubframe flag \t sets the interrupt subframe flag. Setting it to 1 will interrupt the last subframe at the required exposure time. By default, this is disabled and set to 0, ie. it will wait for the last sub frame to finish exposing. Used for EIGER in 32 bit mode only." << std::endl;
os << "programfpga f \t programs the fpga with file f (with .pof extension)." << std::endl;
os << "resetfpga f \t resets fpga, f can be any value" << std::endl;
os << "copydetectorserver s p \t copies the detector server s via tftp from pc with hostname p and changes respawn server. Not for Eiger. " << std::endl;
@ -4874,6 +4889,7 @@ std::string slsDetectorCommand::helpAdvanced(int action) {
os << "extsig \t gets the mode of the external signal. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl;
os << "flags \t gets the readout flags. can be none, storeinram, tot, continous, parallel, nonparallel, digital, analog_digital, overflow, nooverflow, unknown" << std::endl;
os << "interruptsubframe \t gets the interrupt subframe flag. Setting it to 1 will interrupt the last subframe at the required exposure time. By default, this is disabled and set to 0, ie. it will wait for the last sub frame to finish exposing. Used for EIGER in 32 bit mode only." << std::endl;
os << "led \t returns led status (0 off, 1 on)" << std::endl;
os << "powerchip \t gets if the chip has been powered on or off" << std::endl;
os << "auto_comp_disable \t Currently not implemented. gets if the automatic comparator diable mode is enabled/disabled" << std::endl;