mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-21 09:08:00 +02:00
jungfrau server: added deg and maxadcphaseshift, ctb & moench server: set adc phase like jungfrau that positive shift is positive, moved conversion between shift to degrees to the common function. receiver: removed unused variables
This commit is contained in:
@ -137,7 +137,7 @@ void ALTERA_PLL_ResetPLLAndReconfiguration () {
|
||||
* @param val value
|
||||
*/
|
||||
void ALTERA_PLL_SetPllReconfigReg(uint32_t reg, uint32_t val) {
|
||||
FILE_LOG(logINFO, ("Setting PLL Reconfig Reg, reg:0x%x, val:0x%x)\n", reg, val));
|
||||
FILE_LOG(logDEBUG1, ("Setting PLL Reconfig Reg, reg:0x%x, val:0x%x)\n", reg, val));
|
||||
|
||||
FILE_LOG(logDEBUG2, ("pllparamreg:0x%x pllcontrolreg:0x%x addrofst:%d addrmsk:0x%x wrmask:0x%x\n",
|
||||
ALTERA_PLL_Param_Reg, ALTERA_PLL_Cntrl_Reg, ALTERA_PLL_Cntrl_AddrOfst, ALTERA_PLL_Cntrl_AddrMask, ALTERA_PLL_Cntrl_WrPrmtrMask));
|
||||
@ -198,7 +198,7 @@ void ALTERA_PLL_SetModePolling() {
|
||||
* @param frequency set
|
||||
*/
|
||||
int ALTERA_PLL_SetOuputFrequency (int clkIndex, int pllVCOFreqMhz, int value) {
|
||||
FILE_LOG(logINFO, ("\tC%d: Setting output frequency to %d (pllvcofreq: %dMhz)\n", clkIndex, value, pllVCOFreqMhz));
|
||||
FILE_LOG(logDEBUG1, ("C%d: Setting output frequency to %d (pllvcofreq: %dMhz)\n", clkIndex, value, pllVCOFreqMhz));
|
||||
|
||||
// calculate output frequency
|
||||
float total_div = (float)pllVCOFreqMhz / (float)value;
|
||||
@ -225,7 +225,13 @@ int ALTERA_PLL_SetOuputFrequency (int clkIndex, int pllVCOFreqMhz, int value) {
|
||||
// write frequency (post-scale output counter C)
|
||||
ALTERA_PLL_SetPllReconfigReg(ALTERA_PLL_C_COUNTER_REG, val);
|
||||
|
||||
return (pllVCOFreqMhz / (low_count + high_count));
|
||||
/*double temp = ((double)pllVCOFreqMhz / (double)(low_count + high_count));
|
||||
if ((temp - (int)temp) > 0.0001) {
|
||||
temp += 0.5;
|
||||
}
|
||||
return (int)temp;
|
||||
*/
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
|
@ -115,7 +115,7 @@ ROI* setROI(int n, ROI arg[], int *retvalsize, int *ret);
|
||||
#endif
|
||||
|
||||
// parameters - readout
|
||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(JUNGFRAUD)
|
||||
void setSpeed(enum speedVariable ind, int val, int mode);
|
||||
int getSpeed(enum speedVariable ind, int mode);
|
||||
#else
|
||||
@ -283,11 +283,10 @@ int autoCompDisable(int on);
|
||||
void configureASICTimer();
|
||||
void setClockDivider(int val);
|
||||
int getClockDivider();
|
||||
int setAdcPhase(int st);
|
||||
int getPhase();
|
||||
void resetPLL();
|
||||
u_int32_t setPllReconfigReg(u_int32_t reg, u_int32_t val);
|
||||
void configurePll();
|
||||
void setAdcPhase(int val, int degrees);
|
||||
int getPhase(int degrees);
|
||||
int getMaxPhaseShift();
|
||||
int validatePhaseinDegrees(int val, int retval);
|
||||
int setThresholdTemperature(int val);
|
||||
int setTemperatureControl(int val);
|
||||
int setTemperatureEvent(int val);
|
||||
|
@ -1957,6 +1957,7 @@ int set_speed(int file_des) {
|
||||
#ifdef JUNGFRAUD
|
||||
case ADC_PHASE:
|
||||
case CLOCK_DIVIDER:
|
||||
case MAX_ADC_PHASE_SHIFT:
|
||||
#elif CHIPTESTBOARDD
|
||||
case ADC_PHASE:
|
||||
case DBIT_PHASE:
|
||||
@ -1987,7 +1988,7 @@ int set_speed(int file_des) {
|
||||
modeNotImplemented(speedName, (int)ind);
|
||||
break;
|
||||
}
|
||||
#if (!defined(CHIPTESTBOARDD)) && (!defined(MOENCHD))
|
||||
#if (!defined(CHIPTESTBOARDD)) && (!defined(MOENCHD)) && (!defined(JUNGFRAUD))
|
||||
if (ret == OK && mode == 1) {
|
||||
ret = FAIL;
|
||||
strcpy(mess, "deg is not defined for this detector.\n");
|
||||
@ -1998,14 +1999,14 @@ int set_speed(int file_des) {
|
||||
if (ret == OK) {
|
||||
// set
|
||||
if ((val != -1) && (Server_VerifyLock() == OK)) {
|
||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(JUNGFRAUD)
|
||||
setSpeed(ind, val, mode);
|
||||
#else
|
||||
setSpeed(ind, val);
|
||||
#endif
|
||||
}
|
||||
// get
|
||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(JUNGFRAUD)
|
||||
retval = getSpeed(ind, mode);
|
||||
#else
|
||||
retval = getSpeed(ind);
|
||||
@ -2015,9 +2016,13 @@ int set_speed(int file_des) {
|
||||
char validateName[20] = {0};
|
||||
sprintf(validateName, "set %s", speedName);
|
||||
#ifndef GOTTHARDD
|
||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(JUNGFRAUD)
|
||||
if (ind == ADC_PHASE || ind == DBIT_PHASE && mode == 1) {
|
||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
||||
ret = validatePhaseinDegrees(ind, val, retval);
|
||||
#else
|
||||
ret = validatePhaseinDegrees(val, retval);
|
||||
#endif
|
||||
if (ret == FAIL) {
|
||||
sprintf(mess, "Could not set %s. Set %s, got %s\n", validateName);
|
||||
FILE_LOG(logERROR,(mess));
|
||||
|
Reference in New Issue
Block a user