jungfrau: flip rows and partial readout only available for hw2.0

This commit is contained in:
maliakal_d 2021-11-24 14:44:42 +01:00
parent bcf0922b8d
commit eff4ba01b9
10 changed files with 34 additions and 4 deletions

View File

@ -67,6 +67,9 @@ This document describes the differences between v6.0.1 and v6.0.0.
2. [Gotthard2][Mythen3]
Verifies kernel version at server start up.
3. [Jungfrau]
Verifies HW2.0 before trying to set read n rows or flip rows.
Client
------
@ -85,6 +88,11 @@ This document describes the differences between v6.0.1 and v6.0.0.
1. Setting receiver hostname to "none" threw an exception. Fixed.
2. [Jungfrau]
Since the server verifies HW2.0 for number of rows before trying to set it,
the receiver now does not show incorrect missing packets stemming from this
issue.
3. Firmware Requirements

View File

@ -501,12 +501,14 @@ void setupDetector() {
// temp threshold and reset event
setThresholdTemperature(DEFAULT_TMP_THRSHLD);
setTemperatureEvent(0);
setFlipRows(DEFAULT_FLIP_ROWS);
if (getChipVersion() == 11) {
setFilterResistor(DEFAULT_FILTER_RESISTOR);
setNumberOfFilterCells(DEFAULT_FILTER_CELL);
}
setReadNRows(MAX_ROWS_PER_READOUT);
if (!isHardwareVersion2()) {
setFlipRows(DEFAULT_FLIP_ROWS);
setReadNRows(MAX_ROWS_PER_READOUT);
}
}
int resetToDefaultDacs(int hardReset) {
@ -1671,6 +1673,11 @@ int setReadNRows(int value) {
LOG(logERROR, ("Invalid number of rows %d\n", value));
return FAIL;
}
if (isHardwareVersion2()) {
LOG(logERROR, ("Could not set number of rows. Only available for "
"Hardware Board version 2.0.\n"));
return FAIL;
}
// regval is numpackets - 1
int regval = (value / READ_N_ROWS_MULTIPLE) - 1;
@ -1679,7 +1686,6 @@ int setReadNRows(int value) {
bus_w(addr, bus_r(addr) & ~READ_N_ROWS_NUM_ROWS_MSK);
bus_w(addr, bus_r(addr) | ((regval << READ_N_ROWS_NUM_ROWS_OFST) &
READ_N_ROWS_NUM_ROWS_MSK));
if (value == MAX_ROWS_PER_READOUT) {
LOG(logINFO, ("Disabling Partial Readout (#rows)\n"));
bus_w(addr, bus_r(addr) & ~READ_N_ROWS_ENBL_MSK);
@ -1691,6 +1697,10 @@ int setReadNRows(int value) {
}
int getReadNRows() {
// cannot set it in old board
if (isHardwareVersion2()) {
return MAX_ROWS_PER_READOUT;
}
int enable = (bus_r(READ_N_ROWS_REG) & READ_N_ROWS_ENBL_MSK);
int regval = ((bus_r(READ_N_ROWS_REG) & READ_N_ROWS_NUM_ROWS_MSK) >>
READ_N_ROWS_NUM_ROWS_OFST);
@ -2163,6 +2173,11 @@ int getFlipRows() {
}
void setFlipRows(int arg) {
if (isHardwareVersion2()) {
LOG(logERROR, ("Could not set flip rows. Only available for "
"Hardware Board version 2.0.\n"));
return;
}
if (arg >= 0) {
if (arg == 0) {
LOG(logINFO, ("Switching off bottom row flipping\n"));

View File

@ -4663,6 +4663,13 @@ int set_read_n_rows(int file_des) {
"of %d\n",
arg, READ_N_ROWS_MULTIPLE);
LOG(logERROR, (mess));
}
// only for HW 2.0 (version = 3)
else if (isHardwareVersion2()) {
ret = FAIL;
strcpy(mess, "Could not set number of rows. Only available for "
"Hardware Board version 2.0.\n");
LOG(logERROR, (mess));
} else
#endif
{
@ -4702,7 +4709,7 @@ int get_read_n_rows(int file_des) {
retval = getReadNRows();
if (retval == -1) {
ret = FAIL;
sprintf(mess, "Could not get numbr of rows. \n");
sprintf(mess, "Could not get number of rows. \n");
LOG(logERROR, (mess));
} else {
LOG(logDEBUG1, ("number of rows retval: %u\n", retval));