mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-19 18:40:01 +02:00
fix for current source 64 bit select mask for chipv1.1
This commit is contained in:
parent
519b09fcad
commit
4367a39b98
@ -1756,7 +1756,7 @@ void configureChip() {
|
||||
|
||||
// write same values to configure selection
|
||||
// if (chip was powered off earlier)
|
||||
LOG(logINFO, ("\tSetting default values for selection\n"))
|
||||
LOG(logINFO, ("\tRewriting values for selection\n"))
|
||||
bus_w(CRRNT_SRC_COL_LSB_REG, bus_r(CRRNT_SRC_COL_LSB_REG));
|
||||
bus_w(CRRNT_SRC_COL_MSB_REG, bus_r(CRRNT_SRC_COL_MSB_REG));
|
||||
|
||||
@ -2228,15 +2228,16 @@ void disableCurrentSource() {
|
||||
}
|
||||
|
||||
void enableCurrentSource(int fix, uint64_t select, int normal) {
|
||||
disableCurrentSource();
|
||||
|
||||
if (getChipVersion() == 11) {
|
||||
LOG(logINFO, ("Enabling current source [fix:%d, select:%lld]\n", fix,
|
||||
(long long int)select));
|
||||
LOG(logINFO, ("Enabling current source [fix:%d, select:0x%lx]\n", fix,
|
||||
(long unsigned int)select));
|
||||
} else {
|
||||
LOG(logINFO,
|
||||
("Enabling current source [fix:%d, select:0x%llx, normal:%d]\n",
|
||||
fix, (long long int)select, normal));
|
||||
("Enabling current source [fix:%d, select:%ld, normal:%d]\n",
|
||||
fix, (long int)select, normal));
|
||||
}
|
||||
disableCurrentSource();
|
||||
// fix
|
||||
if (fix) {
|
||||
LOG(logINFO, ("\tEnabling fix\n"));
|
||||
@ -2247,7 +2248,7 @@ void enableCurrentSource(int fix, uint64_t select, int normal) {
|
||||
}
|
||||
if (getChipVersion() == 10) {
|
||||
// select
|
||||
LOG(logINFO, ("\tSetting selection\n"))
|
||||
LOG(logINFO, ("\tSetting selection to %ld\n", (long int)select));
|
||||
bus_w(DAQ_REG, bus_r(DAQ_REG) & ~DAQ_CRRNT_SRC_CLMN_SLCT_MSK);
|
||||
bus_w(DAQ_REG,
|
||||
bus_r(DAQ_REG) | ((select << DAQ_CRRNT_SRC_CLMN_SLCT_OFST) &
|
||||
@ -2255,7 +2256,7 @@ void enableCurrentSource(int fix, uint64_t select, int normal) {
|
||||
|
||||
} else {
|
||||
// select
|
||||
LOG(logINFO, ("\tSetting selection\n"))
|
||||
LOG(logINFO, ("\tSetting selection to 0x%lx\n", (long unsigned int)select));
|
||||
set64BitReg(select, CRRNT_SRC_COL_LSB_REG, CRRNT_SRC_COL_MSB_REG);
|
||||
// normal
|
||||
if (normal) {
|
||||
|
@ -6695,7 +6695,7 @@ int set_current_source(int file_des) {
|
||||
int fix = args[1];
|
||||
int normal = args[2];
|
||||
|
||||
LOG(logINFOBLUE, ("Setting current source [enable:%d, fix:%d, select:%lld, "
|
||||
LOG(logDEBUG1, ("Setting current source [enable:%d, fix:%d, select:%lld, "
|
||||
"normal:%d]\n",
|
||||
enable, fix, (long long int)select, normal));
|
||||
|
||||
|
@ -977,7 +977,7 @@ std::string CmdProxy::CurrentSource(int action) {
|
||||
}
|
||||
if (args.size() == 3) {
|
||||
det->setCurrentSource(defs::currentSrcParameters(
|
||||
fix, StringTo<int64_t>(args[2])));
|
||||
fix, StringTo<uint64_t>(args[2])));
|
||||
} else if (args.size() == 4) {
|
||||
bool normalCurrent = false;
|
||||
if (args[3] == "normal") {
|
||||
@ -989,7 +989,7 @@ std::string CmdProxy::CurrentSource(int action) {
|
||||
". Did you mean normal or low?");
|
||||
}
|
||||
det->setCurrentSource(defs::currentSrcParameters(
|
||||
fix, StringTo<int64_t>(args[2]), normalCurrent));
|
||||
fix, StringTo<uint64_t>(args[2]), normalCurrent));
|
||||
} else {
|
||||
throw sls::RuntimeError(
|
||||
"Invalid number of parareters for this command.");
|
||||
|
Loading…
x
Reference in New Issue
Block a user