mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-20 02:40:03 +02:00
jungfrau: new default to asic reg for chipv1.1, filtercells name change, wrongnumberof parameters message change
This commit is contained in:
parent
f7a6160e67
commit
9b321d2ee1
@ -2292,7 +2292,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
@element
|
@element
|
||||||
def filtercell(self):
|
def filtercells(self):
|
||||||
"""
|
"""
|
||||||
[Jungfrau] Set filter capacitor.
|
[Jungfrau] Set filter capacitor.
|
||||||
Note
|
Note
|
||||||
@ -2301,8 +2301,8 @@ class Detector(CppDetectorApi):
|
|||||||
"""
|
"""
|
||||||
return self.getFilterCell()
|
return self.getFilterCell()
|
||||||
|
|
||||||
@filtercell.setter
|
@filtercells.setter
|
||||||
def filtercell(self, value):
|
def filtercells(self, value):
|
||||||
ut.set_using_dict(self.setFilterCell, value)
|
ut.set_using_dict(self.setFilterCell, value)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -452,6 +452,7 @@ Time before end of exposure when comparator is disabled */
|
|||||||
#define ASIC_CTRL_DS_TMR_OFST (8)
|
#define ASIC_CTRL_DS_TMR_OFST (8)
|
||||||
#define ASIC_CTRL_DS_TMR_MSK (0x000000FF << ASIC_CTRL_DS_TMR_OFST)
|
#define ASIC_CTRL_DS_TMR_MSK (0x000000FF << ASIC_CTRL_DS_TMR_OFST)
|
||||||
#define ASIC_CTRL_DS_TMR_VAL ((0x1F << ASIC_CTRL_DS_TMR_OFST) & ASIC_CTRL_DS_TMR_MSK)
|
#define ASIC_CTRL_DS_TMR_VAL ((0x1F << ASIC_CTRL_DS_TMR_OFST) & ASIC_CTRL_DS_TMR_MSK)
|
||||||
|
#define ASIC_CTRL_DS_TMR_CHIP1_1_VAL ((0xFF << ASIC_CTRL_DS_TMR_OFST) & ASIC_CTRL_DS_TMR_MSK)
|
||||||
// tET = (ET + 1) * 25ns (increase timeout range between 2 consecutive storage
|
// tET = (ET + 1) * 25ns (increase timeout range between 2 consecutive storage
|
||||||
// cells)
|
// cells)
|
||||||
#define ASIC_CTRL_EXPSRE_TMR_OFST (16)
|
#define ASIC_CTRL_EXPSRE_TMR_OFST (16)
|
||||||
|
@ -1829,11 +1829,15 @@ int64_t getComparatorDisableTime() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void configureASICTimer() {
|
void configureASICTimer() {
|
||||||
LOG(logINFO, ("Configuring ASIC Timer\n"));
|
|
||||||
bus_w(ASIC_CTRL_REG, (bus_r(ASIC_CTRL_REG) & ~ASIC_CTRL_PRCHRG_TMR_MSK) |
|
bus_w(ASIC_CTRL_REG, (bus_r(ASIC_CTRL_REG) & ~ASIC_CTRL_PRCHRG_TMR_MSK) |
|
||||||
ASIC_CTRL_PRCHRG_TMR_VAL);
|
ASIC_CTRL_PRCHRG_TMR_VAL);
|
||||||
bus_w(ASIC_CTRL_REG, (bus_r(ASIC_CTRL_REG) & ~ASIC_CTRL_DS_TMR_MSK) |
|
|
||||||
ASIC_CTRL_DS_TMR_VAL);
|
uint32_t val = ASIC_CTRL_DS_TMR_VAL;
|
||||||
|
if (getChipVersion() == 11) {
|
||||||
|
val = ASIC_CTRL_DS_TMR_CHIP1_1_VAL;
|
||||||
|
}
|
||||||
|
bus_w(ASIC_CTRL_REG, (bus_r(ASIC_CTRL_REG) & ~ASIC_CTRL_DS_TMR_MSK) | val);
|
||||||
|
LOG(logINFO, ("Configured ASIC Timer [0x%x]\n", bus_r(ASIC_CTRL_REG)));
|
||||||
}
|
}
|
||||||
|
|
||||||
int setReadoutSpeed(int val) {
|
int setReadoutSpeed(int val) {
|
||||||
@ -2213,7 +2217,8 @@ int getFilterCell() {
|
|||||||
// flip all contents of register //TODO FIRMWARE FIX
|
// flip all contents of register //TODO FIRMWARE FIX
|
||||||
regval ^= BIT32_MASK;
|
regval ^= BIT32_MASK;
|
||||||
#endif
|
#endif
|
||||||
uint32_t retval = (regval & CONFIG_V11_FLTR_CLL_MSK) >> CONFIG_V11_FLTR_CLL_OFST;
|
uint32_t retval =
|
||||||
|
(regval & CONFIG_V11_FLTR_CLL_MSK) >> CONFIG_V11_FLTR_CLL_OFST;
|
||||||
// count number of bits = which icell
|
// count number of bits = which icell
|
||||||
return (__builtin_popcount(retval));
|
return (__builtin_popcount(retval));
|
||||||
}
|
}
|
||||||
@ -2341,8 +2346,7 @@ int getNormalCurrentSource() {
|
|||||||
#ifndef VIRTUAL
|
#ifndef VIRTUAL
|
||||||
regval ^= BIT32_MASK;
|
regval ^= BIT32_MASK;
|
||||||
#endif
|
#endif
|
||||||
int low = ((regval &
|
int low = ((regval & CONFIG_V11_STATUS_CRRNT_SRC_LOW_MSK) >>
|
||||||
CONFIG_V11_STATUS_CRRNT_SRC_LOW_MSK) >>
|
|
||||||
CONFIG_V11_STATUS_CRRNT_SRC_LOW_OFST);
|
CONFIG_V11_STATUS_CRRNT_SRC_LOW_OFST);
|
||||||
return (low == 0 ? 1 : 0);
|
return (low == 0 ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
@ -82,8 +82,13 @@ std::map<std::string, std::string> CmdProxy::GetDepreciatedCommands() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CmdProxy::WrongNumberOfParameters(size_t expected) {
|
void CmdProxy::WrongNumberOfParameters(size_t expected) {
|
||||||
|
if (expected == 0) {
|
||||||
|
throw RuntimeError("Command " + cmd +
|
||||||
|
" expected no parameter/s but got " +
|
||||||
|
std::to_string(args.size()) + "\n");
|
||||||
|
}
|
||||||
throw RuntimeError(
|
throw RuntimeError(
|
||||||
"Command " + cmd + " expected <=" + std::to_string(expected) +
|
"Command " + cmd + " expected >=" + std::to_string(expected) +
|
||||||
" parameter/s but got " + std::to_string(args.size()) + "\n");
|
" parameter/s but got " + std::to_string(args.size()) + "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -948,7 +948,7 @@ class CmdProxy {
|
|||||||
{"storagecell_start", &CmdProxy::storagecell_start},
|
{"storagecell_start", &CmdProxy::storagecell_start},
|
||||||
{"storagecell_delay", &CmdProxy::storagecell_delay},
|
{"storagecell_delay", &CmdProxy::storagecell_delay},
|
||||||
{"gainmode", &CmdProxy::gainmode},
|
{"gainmode", &CmdProxy::gainmode},
|
||||||
{"filtercell", &CmdProxy::filtercell},
|
{"filtercells", &CmdProxy::filtercells},
|
||||||
|
|
||||||
/* Gotthard Specific */
|
/* Gotthard Specific */
|
||||||
{"roi", &CmdProxy::ROI},
|
{"roi", &CmdProxy::ROI},
|
||||||
@ -1951,7 +1951,7 @@ class CmdProxy {
|
|||||||
"Jungfrau] Gain mode.\n\tCAUTION: Do not use fixg0 without caution, "
|
"Jungfrau] Gain mode.\n\tCAUTION: Do not use fixg0 without caution, "
|
||||||
"you can damage the detector!!!");
|
"you can damage the detector!!!");
|
||||||
|
|
||||||
INTEGER_COMMAND_VEC_ID(filtercell, getFilterCell, setFilterCell,
|
INTEGER_COMMAND_VEC_ID(filtercells, getFilterCell, setFilterCell,
|
||||||
sls::StringTo<int>,
|
sls::StringTo<int>,
|
||||||
"[0-12]\n\t[Jungfrau] Set Filter Cell. Only for "
|
"[0-12]\n\t[Jungfrau] Set Filter Cell. Only for "
|
||||||
"chipv1.1. Advanced user Command");
|
"chipv1.1. Advanced user Command");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user