mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 19:30:03 +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
|
// write same values to configure selection
|
||||||
// if (chip was powered off earlier)
|
// 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_LSB_REG, bus_r(CRRNT_SRC_COL_LSB_REG));
|
||||||
bus_w(CRRNT_SRC_COL_MSB_REG, bus_r(CRRNT_SRC_COL_MSB_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) {
|
void enableCurrentSource(int fix, uint64_t select, int normal) {
|
||||||
|
disableCurrentSource();
|
||||||
|
|
||||||
if (getChipVersion() == 11) {
|
if (getChipVersion() == 11) {
|
||||||
LOG(logINFO, ("Enabling current source [fix:%d, select:%lld]\n", fix,
|
LOG(logINFO, ("Enabling current source [fix:%d, select:0x%lx]\n", fix,
|
||||||
(long long int)select));
|
(long unsigned int)select));
|
||||||
} else {
|
} else {
|
||||||
LOG(logINFO,
|
LOG(logINFO,
|
||||||
("Enabling current source [fix:%d, select:0x%llx, normal:%d]\n",
|
("Enabling current source [fix:%d, select:%ld, normal:%d]\n",
|
||||||
fix, (long long int)select, normal));
|
fix, (long int)select, normal));
|
||||||
}
|
}
|
||||||
disableCurrentSource();
|
|
||||||
// fix
|
// fix
|
||||||
if (fix) {
|
if (fix) {
|
||||||
LOG(logINFO, ("\tEnabling fix\n"));
|
LOG(logINFO, ("\tEnabling fix\n"));
|
||||||
@ -2247,7 +2248,7 @@ void enableCurrentSource(int fix, uint64_t select, int normal) {
|
|||||||
}
|
}
|
||||||
if (getChipVersion() == 10) {
|
if (getChipVersion() == 10) {
|
||||||
// select
|
// 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) & ~DAQ_CRRNT_SRC_CLMN_SLCT_MSK);
|
||||||
bus_w(DAQ_REG,
|
bus_w(DAQ_REG,
|
||||||
bus_r(DAQ_REG) | ((select << DAQ_CRRNT_SRC_CLMN_SLCT_OFST) &
|
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 {
|
} else {
|
||||||
// select
|
// 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);
|
set64BitReg(select, CRRNT_SRC_COL_LSB_REG, CRRNT_SRC_COL_MSB_REG);
|
||||||
// normal
|
// normal
|
||||||
if (normal) {
|
if (normal) {
|
||||||
|
@ -6695,7 +6695,7 @@ int set_current_source(int file_des) {
|
|||||||
int fix = args[1];
|
int fix = args[1];
|
||||||
int normal = args[2];
|
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",
|
"normal:%d]\n",
|
||||||
enable, fix, (long long int)select, normal));
|
enable, fix, (long long int)select, normal));
|
||||||
|
|
||||||
|
@ -977,7 +977,7 @@ std::string CmdProxy::CurrentSource(int action) {
|
|||||||
}
|
}
|
||||||
if (args.size() == 3) {
|
if (args.size() == 3) {
|
||||||
det->setCurrentSource(defs::currentSrcParameters(
|
det->setCurrentSource(defs::currentSrcParameters(
|
||||||
fix, StringTo<int64_t>(args[2])));
|
fix, StringTo<uint64_t>(args[2])));
|
||||||
} else if (args.size() == 4) {
|
} else if (args.size() == 4) {
|
||||||
bool normalCurrent = false;
|
bool normalCurrent = false;
|
||||||
if (args[3] == "normal") {
|
if (args[3] == "normal") {
|
||||||
@ -989,7 +989,7 @@ std::string CmdProxy::CurrentSource(int action) {
|
|||||||
". Did you mean normal or low?");
|
". Did you mean normal or low?");
|
||||||
}
|
}
|
||||||
det->setCurrentSource(defs::currentSrcParameters(
|
det->setCurrentSource(defs::currentSrcParameters(
|
||||||
fix, StringTo<int64_t>(args[2]), normalCurrent));
|
fix, StringTo<uint64_t>(args[2]), normalCurrent));
|
||||||
} else {
|
} else {
|
||||||
throw sls::RuntimeError(
|
throw sls::RuntimeError(
|
||||||
"Invalid number of parareters for this command.");
|
"Invalid number of parareters for this command.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user