Merge pull request #344 from slsdetectorgroup/patsetbit

Patsetbit and vref
This commit is contained in:
Dhanya Thattil 2022-01-24 12:43:30 +01:00 committed by GitHub
commit eb715e82cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 57 additions and 55 deletions

View File

@ -21,6 +21,8 @@ This document describes the differences between v6.1.0 and v6.0.0.
- Fixed minor warnings (will fix commandline print of excess packets for missing packets)
- ctb slow adcs and any other adcs (other than temp) goes to the control Server
- fixed patsetbit and patsetmask for moench
- changed default vref of adc9257 to 2V for moench (from 1.33V)

View File

@ -3019,7 +3019,7 @@ class Detector(CppDetectorApi):
@property
@element
def patsetbit(self):
"""[Ctb][Moench][Mythen3] Selects the bits that will have a pattern mask applied to the selected patmask for every pattern.
"""[Ctb][Moench][Mythen3] Sets the mask applied to every pattern to the selected bits.
Example
--------
@ -3036,7 +3036,7 @@ class Detector(CppDetectorApi):
@property
@element
def patmask(self):
"""[Ctb][Moench][Mythen3] Sets the mask applied to every pattern to the selected bits.
"""[Ctb][Moench][Mythen3] Selects the bits that will have a pattern mask applied to the selected patmask for every pattern.
Example
--------

View File

@ -952,42 +952,42 @@ enum detectorSettings setSettings(enum detectorSettings sett) {
switch (sett) {
case G1_HIGHGAIN:
LOG(logINFO, ("Set settings - G1_HIGHGAIN\n"));
setPatternMask(G1_HIGHGAIN_PATMASK);
setPatternBitMask(G1_HIGHGAIN_PATSETBIT);
break;
case G1_LOWGAIN:
LOG(logINFO, ("Set settings - G1_LOWGAIN\n"));
setPatternMask(G1_LOWGAIN_PATMASK);
setPatternBitMask(G1_LOWGAIN_PATSETBIT);
break;
case G2_HIGHCAP_HIGHGAIN:
LOG(logINFO, ("Set settings - G2_HIGHCAP_HIGHGAIN\n"));
setPatternMask(G2_HIGHCAP_HIGHGAIN_PATMASK);
setPatternBitMask(G2_HIGHCAP_HIGHGAIN_PATSETBIT);
break;
case G2_HIGHCAP_LOWGAIN:
LOG(logINFO, ("Set settings - G2_HIGHCAP_LOWGAIN\n"));
setPatternMask(G2_HIGHCAP_LOWGAIN_PATMASK);
setPatternBitMask(G2_HIGHCAP_LOWGAIN_PATSETBIT);
break;
case G2_LOWCAP_HIGHGAIN:
LOG(logINFO, ("Set settings - G2_LOWCAP_HIGHGAIN\n"));
setPatternMask(G2_LOWCAP_HIGHGAIN_PATMASK);
setPatternBitMask(G2_LOWCAP_HIGHGAIN_PATSETBIT);
break;
case G2_LOWCAP_LOWGAIN:
LOG(logINFO, ("Set settings - G2_LOWCAP_LOWGAIN\n"));
setPatternMask(G2_LOWCAP_LOWGAIN_PATMASK);
setPatternBitMask(G2_LOWCAP_LOWGAIN_PATSETBIT);
break;
case G4_HIGHGAIN:
LOG(logINFO, ("Set settings - G4_HIGHGAIN\n"));
setPatternMask(G4_HIGHGAIN_PATMASK);
setPatternBitMask(G4_HIGHGAIN_PATSETBIT);
break;
case G4_LOWGAIN:
LOG(logINFO, ("Set settings - G4_LOWGAIN\n"));
setPatternMask(G4_LOWGAIN_PATMASK);
setPatternBitMask(G4_LOWGAIN_PATSETBIT);
break;
default:
LOG(logERROR,
("This settings is not defined for this detector %d\n", (int)sett));
return -1;
}
setPatternBitMask(DEFAULT_PATSETBIT);
setPatternMask(DEFAULT_PATMASK);
thisSettings = sett;
return getSettings();
@ -995,44 +995,44 @@ enum detectorSettings setSettings(enum detectorSettings sett) {
enum detectorSettings getSettings() {
uint64_t patsetbit = getPatternBitMask();
if (patsetbit != DEFAULT_PATSETBIT) {
uint64_t patmask = getPatternMask();
if (patmask != DEFAULT_PATMASK) {
LOG(logERROR,
("Patsetbit is 0x%llx, and not 0x%llx. Undefined Settings!\n",
patsetbit, DEFAULT_PATSETBIT));
("Patmask is 0x%llx, and not 0x%llx. Undefined Settings!\n",
patmask, DEFAULT_PATMASK));
thisSettings = UNDEFINED;
return thisSettings;
}
uint64_t patsetmask = getPatternMask();
switch (patsetmask) {
case G1_HIGHGAIN_PATMASK:
uint64_t patsetbit = getPatternBitMask();
switch (patsetbit) {
case G1_HIGHGAIN_PATSETBIT:
thisSettings = G1_HIGHGAIN;
break;
case G1_LOWGAIN_PATMASK:
case G1_LOWGAIN_PATSETBIT:
thisSettings = G1_LOWGAIN;
break;
case G2_HIGHCAP_HIGHGAIN_PATMASK:
case G2_HIGHCAP_HIGHGAIN_PATSETBIT:
thisSettings = G2_HIGHCAP_HIGHGAIN;
break;
case G2_HIGHCAP_LOWGAIN_PATMASK:
case G2_HIGHCAP_LOWGAIN_PATSETBIT:
thisSettings = G2_HIGHCAP_LOWGAIN;
break;
case G2_LOWCAP_HIGHGAIN_PATMASK:
case G2_LOWCAP_HIGHGAIN_PATSETBIT:
thisSettings = G2_LOWCAP_HIGHGAIN;
break;
case G2_LOWCAP_LOWGAIN_PATMASK:
case G2_LOWCAP_LOWGAIN_PATSETBIT:
thisSettings = G2_LOWCAP_LOWGAIN;
break;
case G4_HIGHGAIN_PATMASK:
case G4_HIGHGAIN_PATSETBIT:
thisSettings = G4_HIGHGAIN;
break;
case G4_LOWGAIN_PATMASK:
case G4_LOWGAIN_PATSETBIT:
thisSettings = G4_LOWGAIN;
break;
default:
LOG(logERROR,
("Patsetmask is 0x%llx. Undefined Settings!\n", patsetmask));
("Patsetbit is 0x%llx. Undefined Settings!\n", patsetbit));
thisSettings = UNDEFINED;
break;
}

View File

@ -105,15 +105,15 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, NUM_CLOCKS };
#define DEFAULT_SETTINGS (G4_HIGHGAIN)
// settings
#define DEFAULT_PATSETBIT (0x00000C800000800AULL)
#define G1_HIGHGAIN_PATMASK (0x00000C0000008008ULL)
#define G1_LOWGAIN_PATMASK (0x0000040000008000ULL)
#define G2_HIGHCAP_HIGHGAIN_PATMASK (0x0000080000000008ULL)
#define G2_HIGHCAP_LOWGAIN_PATMASK (0x0000000000000000ULL)
#define G2_LOWCAP_HIGHGAIN_PATMASK (0x00000C800000800AULL)
#define G2_LOWCAP_LOWGAIN_PATMASK (0x0000048000008002ULL)
#define G4_HIGHGAIN_PATMASK (0x000008800000000AULL)
#define G4_LOWGAIN_PATMASK (0x0000008000000002ULL)
#define DEFAULT_PATMASK (0x00000C800000800AULL)
#define G1_HIGHGAIN_PATSETBIT (0x00000C0000008008ULL)
#define G1_LOWGAIN_PATSETBIT (0x0000040000008000ULL)
#define G2_HIGHCAP_HIGHGAIN_PATSETBIT (0x0000080000000008ULL)
#define G2_HIGHCAP_LOWGAIN_PATSETBIT (0x0000000000000000ULL)
#define G2_LOWCAP_HIGHGAIN_PATSETBIT (0x00000C800000800AULL)
#define G2_LOWCAP_LOWGAIN_PATSETBIT (0x0000048000008002ULL)
#define G4_HIGHGAIN_PATSETBIT (0x000008800000000AULL)
#define G4_LOWGAIN_PATSETBIT (0x0000008000000002ULL)
#define HIGHVOLTAGE_MIN (60)
#define HIGHVOLTAGE_MAX (200) // min dac val

View File

@ -300,7 +300,7 @@ void AD9257_Configure() {
AD9257_CLK_CH_IFCO_MSK);
// vref
#ifdef GOTTHARDD
#if defined(GOTTHARDD) || defined(MOENCHD)
LOG(logINFO, ("\tVref default at 2.0\n"));
AD9257_SetVrefVoltage(AD9257_VREF_DEFAULT_VAL, 0);
#else

View File

@ -1667,15 +1667,15 @@ class Detector {
/** [CTB][Moench][Mythen3] */
Result<uint64_t> getPatternMask(Positions pos = {});
/** [CTB][Moench][Mythen3] Sets the mask applied to every pattern to the
* selected bits */
/** [CTB][Moench][Mythen3] Selects the bits that will have a pattern mask
* applied to the selected patmask for every pattern. */
void setPatternMask(uint64_t mask, Positions pos = {});
/** [CTB][Moench][Mythen3] */
Result<uint64_t> getPatternBitMask(Positions pos = {}) const;
/** [CTB][Moench][Mythen3] Selects the bits that will have a pattern mask
* applied to the selected patmask for every pattern. */
/** [CTB][Moench][Mythen3] Sets the mask applied to every pattern to the
* selected bits */
void setPatternBitMask(uint64_t mask, Positions pos = {});
/** [Mythen3] */

View File

@ -2164,15 +2164,15 @@ class CmdProxy {
INTEGER_COMMAND_HEX_WIDTH16(
patmask, getPatternMask, setPatternMask, StringTo<uint64_t>,
"[64 bit mask]\n\t[Ctb][Moench][Mythen3] Sets the mask applied to "
"every pattern to the selected bits.");
INTEGER_COMMAND_HEX_WIDTH16(
patsetbit, getPatternBitMask, setPatternBitMask, StringTo<uint64_t>,
"[64 bit mask]\n\t[Ctb][Moench][Mythen3] Selects the bits that will "
"have a pattern mask applied to the selected patmask for every "
"pattern.");
INTEGER_COMMAND_HEX_WIDTH16(
patsetbit, getPatternBitMask, setPatternBitMask, StringTo<uint64_t>,
"[64 bit mask]\n\t[Ctb][Moench][Mythen3] Sets the mask applied to "
"every pattern to the selected bits.");
EXECUTE_SET_COMMAND(patternstart, startPattern,
"\n\t[Mythen3] Starts Pattern");

View File

@ -2,14 +2,14 @@
// Copyright (C) 2021 Contributors to the SLS Detector Package
/** API versions */
#define GITBRANCH "developer"
#define APILIB 0x211125
#define APIRECEIVER 0x211124
#define APIGUI 0x211124
#define APICTB 0x220124
#define APIGOTTHARD 0x220124
#define APIGOTTHARD2 0x220124
#define APIJUNGFRAU 0x220124
#define APIMYTHEN3 0x220124
#define APIMOENCH 0x220124
#define APILIB 0x211125
#define APIRECEIVER 0x211124
#define APIGUI 0x211124
#define APICTB 0x220118
#define APIGOTTHARD 0x220118
#define APIGOTTHARD2 0x220118
#define APIJUNGFRAU 0x220118
#define APIMYTHEN3 0x220118
#define APIMOENCH 0x220118
#define APIEIGER 0x220118
#define APIEIGER 0x220124