mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 23:30:03 +02:00
jungfrauserver: bug fix: settings read correctly, forceswitchg2 mainly
This commit is contained in:
parent
c9675d111a
commit
9f24bb0a98
@ -302,6 +302,8 @@
|
||||
#define DAQ_SETTINGS_MSK (DAQ_HIGH_GAIN_MSK | DAQ_FIX_GAIN_MSK | DAQ_FRCE_SWTCH_GAIN_MSK)
|
||||
#define DAQ_HIGH_GAIN_OFST (0)
|
||||
#define DAQ_HIGH_GAIN_MSK (0x00000001 << DAQ_HIGH_GAIN_OFST)
|
||||
#define DAQ_FIX_GAIN_DYNMC_VAL ((0x0 << DAQ_HIGH_GAIN_OFST) & DAQ_HIGH_GAIN_MSK)
|
||||
#define DAQ_FIX_GAIN_HIGHGAIN_VAL ((0x1 << DAQ_HIGH_GAIN_OFST) & DAQ_HIGH_GAIN_MSK)
|
||||
#define DAQ_FIX_GAIN_OFST (1)
|
||||
#define DAQ_FIX_GAIN_MSK (0x00000003 << DAQ_FIX_GAIN_OFST)
|
||||
#define DAQ_FIX_GAIN_STG_1_VAL ((0x1 << DAQ_FIX_GAIN_OFST) & DAQ_FIX_GAIN_MSK)
|
||||
|
Binary file not shown.
@ -1,9 +1,9 @@
|
||||
Path: slsDetectorsPackage/slsDetectorSoftware/jungfrauDetectorServer
|
||||
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repsitory UUID: 03e781a0ac53cb73af5d00003a131383125ab40f
|
||||
Revision: 141
|
||||
Repsitory UUID: c9675d111a61075ebe4031ec6bdf285a76be0fce
|
||||
Revision: 142
|
||||
Branch: jungfraunew
|
||||
Last Changed Author: Dhanya_Thattil
|
||||
Last Changed Rev: 3776
|
||||
Last Changed Date: 2018-04-23 16:06:57.000000002 +0200 ./RegisterDefs.h
|
||||
Last Changed Rev: 3777
|
||||
Last Changed Date: 2018-04-26 15:44:15.000000002 +0200 ./RegisterDefs.h
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "03e781a0ac53cb73af5d00003a131383125ab40f"
|
||||
#define GITREPUUID "c9675d111a61075ebe4031ec6bdf285a76be0fce"
|
||||
#define GITAUTH "Dhanya_Thattil"
|
||||
#define GITREV 0x3776
|
||||
#define GITDATE 0x20180423
|
||||
#define GITREV 0x3777
|
||||
#define GITDATE 0x20180426
|
||||
#define GITBRANCH "jungfraunew"
|
||||
|
@ -824,7 +824,7 @@ enum detectorSettings setSettings(enum detectorSettings sett, int imod){
|
||||
break;
|
||||
case DYNAMICHG0:
|
||||
bus_w(DAQ_REG, bus_r(DAQ_REG) & ~DAQ_SETTINGS_MSK);
|
||||
bus_w(DAQ_REG, bus_r(DAQ_REG) | DAQ_HIGH_GAIN_MSK);
|
||||
bus_w(DAQ_REG, bus_r(DAQ_REG) | DAQ_FIX_GAIN_HIGHGAIN_VAL);
|
||||
printf("\nConfigured settings - Dyanmic High Gain 0, DAQ Reg: 0x%x\n", bus_r(DAQ_REG));
|
||||
break;
|
||||
case FIXGAIN1:
|
||||
@ -862,37 +862,37 @@ enum detectorSettings setSettings(enum detectorSettings sett, int imod){
|
||||
|
||||
enum detectorSettings getSettings(){
|
||||
|
||||
uint32_t val = bus_r(DAQ_REG);
|
||||
uint32_t val = bus_r(DAQ_REG) & DAQ_SETTINGS_MSK;
|
||||
printf("\nGetting Settings\n Reading DAQ Register :0x%x\n", val);
|
||||
|
||||
if (val & DAQ_FRCE_GAIN_STG_2_VAL) {
|
||||
thisSettings = FORCESWITCHG2;
|
||||
printf("Settings read: FORCESWITCHG2\n");
|
||||
}
|
||||
|
||||
else if (val & DAQ_FRCE_GAIN_STG_1_VAL) {
|
||||
thisSettings = FORCESWITCHG1;
|
||||
printf("Settings read: FORCESWITCHG1\n");
|
||||
}
|
||||
|
||||
else if (val & DAQ_FIX_GAIN_STG_2_VAL) {
|
||||
thisSettings = FIXGAIN2;
|
||||
printf("Settings read: FIXGAIN2\n");
|
||||
}
|
||||
|
||||
else if (val & DAQ_FIX_GAIN_STG_1_VAL) {
|
||||
thisSettings = FIXGAIN1;
|
||||
printf("Settings read: FIXGAIN1\n");
|
||||
}
|
||||
|
||||
else if (val & DAQ_HIGH_GAIN_MSK) {
|
||||
thisSettings = DYNAMICHG0;
|
||||
printf("Settings read: DYNAMICHG0\n");
|
||||
}
|
||||
|
||||
else {
|
||||
thisSettings = DYNAMICGAIN;
|
||||
switch(val) {
|
||||
case DAQ_FIX_GAIN_DYNMC_VAL:
|
||||
thisSettings = DYNAMICGAIN;
|
||||
printf("Settings read: DYNAMICGAIN\n");
|
||||
break;
|
||||
case DAQ_FIX_GAIN_HIGHGAIN_VAL:
|
||||
thisSettings = DYNAMICHG0;
|
||||
printf("Settings read: DYNAMICHG0\n");
|
||||
break;
|
||||
case DAQ_FIX_GAIN_STG_1_VAL:
|
||||
thisSettings = FIXGAIN1;
|
||||
printf("Settings read: FIXGAIN1\n");
|
||||
break;
|
||||
case DAQ_FIX_GAIN_STG_2_VAL:
|
||||
thisSettings = FIXGAIN2;
|
||||
printf("Settings read: FIXGAIN2\n");
|
||||
break;
|
||||
case DAQ_FRCE_GAIN_STG_1_VAL:
|
||||
thisSettings = FORCESWITCHG1;
|
||||
printf("Settings read: FORCESWITCHG1\n");
|
||||
break;
|
||||
case DAQ_FRCE_GAIN_STG_2_VAL:
|
||||
thisSettings = FORCESWITCHG2;
|
||||
printf("Settings read: FORCESWITCHG2\n");
|
||||
break;
|
||||
default:
|
||||
thisSettings = UNDEFINED;
|
||||
printf("Settings read: Undefined. Value read:0x%x\n", val);
|
||||
}
|
||||
|
||||
return thisSettings;
|
||||
|
Loading…
x
Reference in New Issue
Block a user