mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-20 02:40:03 +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)
|
||||
- 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
|
||||
@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
|
||||
--------
|
||||
|
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) {
|
||||
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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Binary file not shown.
@ -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
|
||||
|
@ -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] */
|
||||
|
@ -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");
|
||||
|
||||
|
@ -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 0x220118
|
||||
#define APIGOTTHARD 0x220118
|
||||
#define APIGOTTHARD2 0x220118
|
||||
#define APIJUNGFRAU 0x220118
|
||||
#define APIMYTHEN3 0x220118
|
||||
#define APIMOENCH 0x220118
|
||||
#define APIEIGER 0x220118
|
||||
#define APICTB 0x220124
|
||||
#define APIGOTTHARD 0x220124
|
||||
#define APIGOTTHARD2 0x220124
|
||||
#define APIJUNGFRAU 0x220124
|
||||
#define APIMYTHEN3 0x220124
|
||||
#define APIMOENCH 0x220124
|
||||
|
||||
#define APIEIGER 0x220124
|
||||
|
Loading…
x
Reference in New Issue
Block a user