mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
adcinvert for jungfrau, gui for jungfrau dacs
This commit is contained in:
Binary file not shown.
@ -525,7 +525,21 @@ int setDynamicRange(int dr){
|
||||
return DYNAMIC_RANGE;
|
||||
}
|
||||
|
||||
void setADCInvertRegister(uint32_t val) {
|
||||
FILE_LOG(logINFO, ("Setting ADC Port Invert Reg to 0x%x\n", val));
|
||||
uint32_t defaultValue = (isHardwareVersion2() ? ADC_PORT_INVERT_BOARD2_VAL : ADC_PORT_INVERT_VAL);
|
||||
uint32_t changeValue = defaultValue ^ val;
|
||||
FILE_LOG(logINFO, ("\t default: 0x%x, final:0x%x\n", defaultValue, changeValue));
|
||||
bus_w(ADC_PORT_INVERT_REG, changeValue);
|
||||
}
|
||||
|
||||
uint32_t getADCInvertRegister() {
|
||||
uint32_t readValue = bus_r(ADC_PORT_INVERT_REG);
|
||||
int32_t defaultValue = (isHardwareVersion2() ? ADC_PORT_INVERT_BOARD2_VAL : ADC_PORT_INVERT_VAL);
|
||||
uint32_t val = defaultValue ^ readValue;
|
||||
FILE_LOG(logDEBUG1, ("\tread:0x%x, default:0x%x returned:0x%x\n", readValue, defaultValue, val));
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
/* parameters - speed, readout */
|
||||
|
Binary file not shown.
@ -33,7 +33,7 @@
|
||||
/** Other Definitions */
|
||||
#define BIT16_MASK (0xFFFF)
|
||||
|
||||
#define DAC_NAMES "vcassh", "vth2", "vshaper", "vshaperneg", "vipreout", "vth3", "vth1", "vicin", "vcas", "vpreamp", "vph", "vipre", "viinsh", "vpl", "vtrim", "vdcsh"
|
||||
#define DAC_NAMES "vcassh", "vth2", "vshaper", "vshaperneg", "vipre_out", "vth3", "vth1", "vicin", "vcas", "vpreamp", "vph", "vipre", "viinsh", "vpl", "vtrim", "vdcsh"
|
||||
/* Enums */
|
||||
enum CLKINDEX {RUN_CLK, TICK_CLK, SAMPLING_CLK, NUM_CLOCKS};
|
||||
enum DACINDEX {M_CASSH, M_VTH2, M_VRFSH, M_VRFSHNPOL, M_VIPRE_OUT, M_VTH3, M_VTH1, M_VICIN, M_CAS, M_VRF, M_VPH, M_VIPRE, M_VIINSH, M_VPL, M_VTRIM, M_VDCSH};
|
||||
|
@ -135,6 +135,10 @@ int setDynamicRange(int dr);
|
||||
int setROI(ROI arg);
|
||||
ROI getROI();
|
||||
#endif
|
||||
#ifdef JUNGFRAUD
|
||||
void setADCInvertRegister(uint32_t val);
|
||||
uint32_t getADCInvertRegister();
|
||||
#endif
|
||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
||||
int setADCEnableMask(uint32_t mask);
|
||||
uint32_t getADCEnableMask();
|
||||
|
@ -953,30 +953,30 @@ int set_dac(int file_des) {
|
||||
#elif JUNGFRAUD
|
||||
case HIGH_VOLTAGE:
|
||||
break;
|
||||
case VB_DS:
|
||||
serverDacIndex = J_VB_DS;
|
||||
break;
|
||||
case VB_COMP:
|
||||
serverDacIndex = J_VB_COMP;
|
||||
break;
|
||||
case VDD_PROT:
|
||||
serverDacIndex = J_VDD_PROT;
|
||||
break;
|
||||
case VIN_COM:
|
||||
serverDacIndex = J_VIN_COM;
|
||||
break;
|
||||
case VREF_PRECH:
|
||||
serverDacIndex = J_VREF_PRECH;
|
||||
break;
|
||||
case VB_PIXBUF:
|
||||
serverDacIndex = J_VB_PIXBUF;
|
||||
break;
|
||||
case VB_DS:
|
||||
serverDacIndex = J_VB_DS;
|
||||
break;
|
||||
case VREF_DS:
|
||||
serverDacIndex = J_VREF_DS;
|
||||
break;
|
||||
case VREF_COMP:
|
||||
serverDacIndex = J_VREF_COMP;
|
||||
break;
|
||||
case VREF_PRECH:
|
||||
serverDacIndex = J_VREF_PRECH;
|
||||
break;
|
||||
case VIN_COM:
|
||||
serverDacIndex = J_VIN_COM;
|
||||
break;
|
||||
case VDD_PROT:
|
||||
serverDacIndex = J_VDD_PROT;
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
@ -3829,7 +3829,7 @@ int set_adc_invert(int file_des) {
|
||||
return printSocketReadError();
|
||||
FILE_LOG(logDEBUG1, ("Seting ADC Invert to %u\n", arg));
|
||||
|
||||
#if (!defined(MOENCHD)) && (!defined(CHIPTESTBOARDD))
|
||||
#if (!defined(MOENCHD)) && (!defined(CHIPTESTBOARDD)) && (!defined(JUNGFRAUD))
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// only set
|
||||
@ -3854,7 +3854,7 @@ int get_adc_invert(int file_des) {
|
||||
|
||||
FILE_LOG(logDEBUG1, ("Getting ADC Invert register \n"));
|
||||
|
||||
#if (!defined(MOENCHD)) && (!defined(CHIPTESTBOARDD))
|
||||
#if (!defined(MOENCHD)) && (!defined(CHIPTESTBOARDD)) && (!defined(JUNGFRAUD))
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// get
|
||||
|
Reference in New Issue
Block a user