mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 03:10:02 +02:00
Merge pull request #344 from slsdetectorgroup/patsetbit
Patsetbit and vref
This commit is contained in:
commit
eb715e82cb
@ -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)
|
- 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
|
- 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)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -3019,7 +3019,7 @@ class Detector(CppDetectorApi):
|
|||||||
@property
|
@property
|
||||||
@element
|
@element
|
||||||
def patsetbit(self):
|
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
|
Example
|
||||||
--------
|
--------
|
||||||
@ -3036,7 +3036,7 @@ class Detector(CppDetectorApi):
|
|||||||
@property
|
@property
|
||||||
@element
|
@element
|
||||||
def patmask(self):
|
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
|
Example
|
||||||
--------
|
--------
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -952,42 +952,42 @@ enum detectorSettings setSettings(enum detectorSettings sett) {
|
|||||||
switch (sett) {
|
switch (sett) {
|
||||||
case G1_HIGHGAIN:
|
case G1_HIGHGAIN:
|
||||||
LOG(logINFO, ("Set settings - G1_HIGHGAIN\n"));
|
LOG(logINFO, ("Set settings - G1_HIGHGAIN\n"));
|
||||||
setPatternMask(G1_HIGHGAIN_PATMASK);
|
setPatternBitMask(G1_HIGHGAIN_PATSETBIT);
|
||||||
break;
|
break;
|
||||||
case G1_LOWGAIN:
|
case G1_LOWGAIN:
|
||||||
LOG(logINFO, ("Set settings - G1_LOWGAIN\n"));
|
LOG(logINFO, ("Set settings - G1_LOWGAIN\n"));
|
||||||
setPatternMask(G1_LOWGAIN_PATMASK);
|
setPatternBitMask(G1_LOWGAIN_PATSETBIT);
|
||||||
break;
|
break;
|
||||||
case G2_HIGHCAP_HIGHGAIN:
|
case G2_HIGHCAP_HIGHGAIN:
|
||||||
LOG(logINFO, ("Set settings - G2_HIGHCAP_HIGHGAIN\n"));
|
LOG(logINFO, ("Set settings - G2_HIGHCAP_HIGHGAIN\n"));
|
||||||
setPatternMask(G2_HIGHCAP_HIGHGAIN_PATMASK);
|
setPatternBitMask(G2_HIGHCAP_HIGHGAIN_PATSETBIT);
|
||||||
break;
|
break;
|
||||||
case G2_HIGHCAP_LOWGAIN:
|
case G2_HIGHCAP_LOWGAIN:
|
||||||
LOG(logINFO, ("Set settings - G2_HIGHCAP_LOWGAIN\n"));
|
LOG(logINFO, ("Set settings - G2_HIGHCAP_LOWGAIN\n"));
|
||||||
setPatternMask(G2_HIGHCAP_LOWGAIN_PATMASK);
|
setPatternBitMask(G2_HIGHCAP_LOWGAIN_PATSETBIT);
|
||||||
break;
|
break;
|
||||||
case G2_LOWCAP_HIGHGAIN:
|
case G2_LOWCAP_HIGHGAIN:
|
||||||
LOG(logINFO, ("Set settings - G2_LOWCAP_HIGHGAIN\n"));
|
LOG(logINFO, ("Set settings - G2_LOWCAP_HIGHGAIN\n"));
|
||||||
setPatternMask(G2_LOWCAP_HIGHGAIN_PATMASK);
|
setPatternBitMask(G2_LOWCAP_HIGHGAIN_PATSETBIT);
|
||||||
break;
|
break;
|
||||||
case G2_LOWCAP_LOWGAIN:
|
case G2_LOWCAP_LOWGAIN:
|
||||||
LOG(logINFO, ("Set settings - G2_LOWCAP_LOWGAIN\n"));
|
LOG(logINFO, ("Set settings - G2_LOWCAP_LOWGAIN\n"));
|
||||||
setPatternMask(G2_LOWCAP_LOWGAIN_PATMASK);
|
setPatternBitMask(G2_LOWCAP_LOWGAIN_PATSETBIT);
|
||||||
break;
|
break;
|
||||||
case G4_HIGHGAIN:
|
case G4_HIGHGAIN:
|
||||||
LOG(logINFO, ("Set settings - G4_HIGHGAIN\n"));
|
LOG(logINFO, ("Set settings - G4_HIGHGAIN\n"));
|
||||||
setPatternMask(G4_HIGHGAIN_PATMASK);
|
setPatternBitMask(G4_HIGHGAIN_PATSETBIT);
|
||||||
break;
|
break;
|
||||||
case G4_LOWGAIN:
|
case G4_LOWGAIN:
|
||||||
LOG(logINFO, ("Set settings - G4_LOWGAIN\n"));
|
LOG(logINFO, ("Set settings - G4_LOWGAIN\n"));
|
||||||
setPatternMask(G4_LOWGAIN_PATMASK);
|
setPatternBitMask(G4_LOWGAIN_PATSETBIT);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG(logERROR,
|
LOG(logERROR,
|
||||||
("This settings is not defined for this detector %d\n", (int)sett));
|
("This settings is not defined for this detector %d\n", (int)sett));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
setPatternBitMask(DEFAULT_PATSETBIT);
|
setPatternMask(DEFAULT_PATMASK);
|
||||||
thisSettings = sett;
|
thisSettings = sett;
|
||||||
|
|
||||||
return getSettings();
|
return getSettings();
|
||||||
@ -995,44 +995,44 @@ enum detectorSettings setSettings(enum detectorSettings sett) {
|
|||||||
|
|
||||||
enum detectorSettings getSettings() {
|
enum detectorSettings getSettings() {
|
||||||
|
|
||||||
uint64_t patsetbit = getPatternBitMask();
|
uint64_t patmask = getPatternMask();
|
||||||
if (patsetbit != DEFAULT_PATSETBIT) {
|
if (patmask != DEFAULT_PATMASK) {
|
||||||
LOG(logERROR,
|
LOG(logERROR,
|
||||||
("Patsetbit is 0x%llx, and not 0x%llx. Undefined Settings!\n",
|
("Patmask is 0x%llx, and not 0x%llx. Undefined Settings!\n",
|
||||||
patsetbit, DEFAULT_PATSETBIT));
|
patmask, DEFAULT_PATMASK));
|
||||||
thisSettings = UNDEFINED;
|
thisSettings = UNDEFINED;
|
||||||
return thisSettings;
|
return thisSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t patsetmask = getPatternMask();
|
uint64_t patsetbit = getPatternBitMask();
|
||||||
switch (patsetmask) {
|
switch (patsetbit) {
|
||||||
case G1_HIGHGAIN_PATMASK:
|
case G1_HIGHGAIN_PATSETBIT:
|
||||||
thisSettings = G1_HIGHGAIN;
|
thisSettings = G1_HIGHGAIN;
|
||||||
break;
|
break;
|
||||||
case G1_LOWGAIN_PATMASK:
|
case G1_LOWGAIN_PATSETBIT:
|
||||||
thisSettings = G1_LOWGAIN;
|
thisSettings = G1_LOWGAIN;
|
||||||
break;
|
break;
|
||||||
case G2_HIGHCAP_HIGHGAIN_PATMASK:
|
case G2_HIGHCAP_HIGHGAIN_PATSETBIT:
|
||||||
thisSettings = G2_HIGHCAP_HIGHGAIN;
|
thisSettings = G2_HIGHCAP_HIGHGAIN;
|
||||||
break;
|
break;
|
||||||
case G2_HIGHCAP_LOWGAIN_PATMASK:
|
case G2_HIGHCAP_LOWGAIN_PATSETBIT:
|
||||||
thisSettings = G2_HIGHCAP_LOWGAIN;
|
thisSettings = G2_HIGHCAP_LOWGAIN;
|
||||||
break;
|
break;
|
||||||
case G2_LOWCAP_HIGHGAIN_PATMASK:
|
case G2_LOWCAP_HIGHGAIN_PATSETBIT:
|
||||||
thisSettings = G2_LOWCAP_HIGHGAIN;
|
thisSettings = G2_LOWCAP_HIGHGAIN;
|
||||||
break;
|
break;
|
||||||
case G2_LOWCAP_LOWGAIN_PATMASK:
|
case G2_LOWCAP_LOWGAIN_PATSETBIT:
|
||||||
thisSettings = G2_LOWCAP_LOWGAIN;
|
thisSettings = G2_LOWCAP_LOWGAIN;
|
||||||
break;
|
break;
|
||||||
case G4_HIGHGAIN_PATMASK:
|
case G4_HIGHGAIN_PATSETBIT:
|
||||||
thisSettings = G4_HIGHGAIN;
|
thisSettings = G4_HIGHGAIN;
|
||||||
break;
|
break;
|
||||||
case G4_LOWGAIN_PATMASK:
|
case G4_LOWGAIN_PATSETBIT:
|
||||||
thisSettings = G4_LOWGAIN;
|
thisSettings = G4_LOWGAIN;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG(logERROR,
|
LOG(logERROR,
|
||||||
("Patsetmask is 0x%llx. Undefined Settings!\n", patsetmask));
|
("Patsetbit is 0x%llx. Undefined Settings!\n", patsetbit));
|
||||||
thisSettings = UNDEFINED;
|
thisSettings = UNDEFINED;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -105,15 +105,15 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, NUM_CLOCKS };
|
|||||||
#define DEFAULT_SETTINGS (G4_HIGHGAIN)
|
#define DEFAULT_SETTINGS (G4_HIGHGAIN)
|
||||||
|
|
||||||
// settings
|
// settings
|
||||||
#define DEFAULT_PATSETBIT (0x00000C800000800AULL)
|
#define DEFAULT_PATMASK (0x00000C800000800AULL)
|
||||||
#define G1_HIGHGAIN_PATMASK (0x00000C0000008008ULL)
|
#define G1_HIGHGAIN_PATSETBIT (0x00000C0000008008ULL)
|
||||||
#define G1_LOWGAIN_PATMASK (0x0000040000008000ULL)
|
#define G1_LOWGAIN_PATSETBIT (0x0000040000008000ULL)
|
||||||
#define G2_HIGHCAP_HIGHGAIN_PATMASK (0x0000080000000008ULL)
|
#define G2_HIGHCAP_HIGHGAIN_PATSETBIT (0x0000080000000008ULL)
|
||||||
#define G2_HIGHCAP_LOWGAIN_PATMASK (0x0000000000000000ULL)
|
#define G2_HIGHCAP_LOWGAIN_PATSETBIT (0x0000000000000000ULL)
|
||||||
#define G2_LOWCAP_HIGHGAIN_PATMASK (0x00000C800000800AULL)
|
#define G2_LOWCAP_HIGHGAIN_PATSETBIT (0x00000C800000800AULL)
|
||||||
#define G2_LOWCAP_LOWGAIN_PATMASK (0x0000048000008002ULL)
|
#define G2_LOWCAP_LOWGAIN_PATSETBIT (0x0000048000008002ULL)
|
||||||
#define G4_HIGHGAIN_PATMASK (0x000008800000000AULL)
|
#define G4_HIGHGAIN_PATSETBIT (0x000008800000000AULL)
|
||||||
#define G4_LOWGAIN_PATMASK (0x0000008000000002ULL)
|
#define G4_LOWGAIN_PATSETBIT (0x0000008000000002ULL)
|
||||||
|
|
||||||
#define HIGHVOLTAGE_MIN (60)
|
#define HIGHVOLTAGE_MIN (60)
|
||||||
#define HIGHVOLTAGE_MAX (200) // min dac val
|
#define HIGHVOLTAGE_MAX (200) // min dac val
|
||||||
|
Binary file not shown.
@ -300,7 +300,7 @@ void AD9257_Configure() {
|
|||||||
AD9257_CLK_CH_IFCO_MSK);
|
AD9257_CLK_CH_IFCO_MSK);
|
||||||
|
|
||||||
// vref
|
// vref
|
||||||
#ifdef GOTTHARDD
|
#if defined(GOTTHARDD) || defined(MOENCHD)
|
||||||
LOG(logINFO, ("\tVref default at 2.0\n"));
|
LOG(logINFO, ("\tVref default at 2.0\n"));
|
||||||
AD9257_SetVrefVoltage(AD9257_VREF_DEFAULT_VAL, 0);
|
AD9257_SetVrefVoltage(AD9257_VREF_DEFAULT_VAL, 0);
|
||||||
#else
|
#else
|
||||||
|
@ -1667,15 +1667,15 @@ class Detector {
|
|||||||
/** [CTB][Moench][Mythen3] */
|
/** [CTB][Moench][Mythen3] */
|
||||||
Result<uint64_t> getPatternMask(Positions pos = {});
|
Result<uint64_t> getPatternMask(Positions pos = {});
|
||||||
|
|
||||||
/** [CTB][Moench][Mythen3] Sets the mask applied to every pattern to the
|
/** [CTB][Moench][Mythen3] Selects the bits that will have a pattern mask
|
||||||
* selected bits */
|
* applied to the selected patmask for every pattern. */
|
||||||
void setPatternMask(uint64_t mask, Positions pos = {});
|
void setPatternMask(uint64_t mask, Positions pos = {});
|
||||||
|
|
||||||
/** [CTB][Moench][Mythen3] */
|
/** [CTB][Moench][Mythen3] */
|
||||||
Result<uint64_t> getPatternBitMask(Positions pos = {}) const;
|
Result<uint64_t> getPatternBitMask(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [CTB][Moench][Mythen3] Selects the bits that will have a pattern mask
|
/** [CTB][Moench][Mythen3] Sets the mask applied to every pattern to the
|
||||||
* applied to the selected patmask for every pattern. */
|
* selected bits */
|
||||||
void setPatternBitMask(uint64_t mask, Positions pos = {});
|
void setPatternBitMask(uint64_t mask, Positions pos = {});
|
||||||
|
|
||||||
/** [Mythen3] */
|
/** [Mythen3] */
|
||||||
|
@ -2164,15 +2164,15 @@ class CmdProxy {
|
|||||||
|
|
||||||
INTEGER_COMMAND_HEX_WIDTH16(
|
INTEGER_COMMAND_HEX_WIDTH16(
|
||||||
patmask, getPatternMask, setPatternMask, StringTo<uint64_t>,
|
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 "
|
"[64 bit mask]\n\t[Ctb][Moench][Mythen3] Selects the bits that will "
|
||||||
"have a pattern mask applied to the selected patmask for every "
|
"have a pattern mask applied to the selected patmask for every "
|
||||||
"pattern.");
|
"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,
|
EXECUTE_SET_COMMAND(patternstart, startPattern,
|
||||||
"\n\t[Mythen3] Starts Pattern");
|
"\n\t[Mythen3] Starts Pattern");
|
||||||
|
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||||
/** API versions */
|
/** API versions */
|
||||||
#define GITBRANCH "developer"
|
#define GITBRANCH "developer"
|
||||||
|
|
||||||
#define APILIB 0x211125
|
#define APILIB 0x211125
|
||||||
#define APIRECEIVER 0x211124
|
#define APIRECEIVER 0x211124
|
||||||
#define APIGUI 0x211124
|
#define APIGUI 0x211124
|
||||||
#define APICTB 0x220118
|
#define APICTB 0x220124
|
||||||
#define APIGOTTHARD 0x220118
|
#define APIGOTTHARD 0x220124
|
||||||
#define APIGOTTHARD2 0x220118
|
#define APIGOTTHARD2 0x220124
|
||||||
#define APIJUNGFRAU 0x220118
|
#define APIJUNGFRAU 0x220124
|
||||||
#define APIMYTHEN3 0x220118
|
#define APIMYTHEN3 0x220124
|
||||||
#define APIMOENCH 0x220118
|
#define APIMOENCH 0x220124
|
||||||
#define APIEIGER 0x220118
|
|
||||||
|
#define APIEIGER 0x220124
|
||||||
|
Loading…
x
Reference in New Issue
Block a user