mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-28 09:10:01 +02:00
jungfrau server: incorporated transmission delay
This commit is contained in:
parent
8fc3d97e78
commit
d879379aa4
@ -1146,6 +1146,24 @@ void configurePll() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int setNetworkParameter(enum NETWORKINDEX mode, int value) {
|
||||||
|
if (mode != TXN_FRAME)
|
||||||
|
return -1;\
|
||||||
|
|
||||||
|
if (value >= 0) {
|
||||||
|
printf("\nSetting transmission delay: %d\n", value);
|
||||||
|
bus_w(CONFIG_REG, ((value << CONFIG_TDMA_TIMESLOT_OFST) & CONFIG_TDMA_TIMESLOT_MSK));
|
||||||
|
#ifdef VERBOSE
|
||||||
|
printf("Transmission delay set to %d\n", ((bus_r(CONFIG_REG) & CONFIG_TDMA_TIMESLOT_MSK) >> CONFIG_TDMA_TIMESLOT_OFST));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
return ((bus_r(CONFIG_REG) & CONFIG_TDMA_TIMESLOT_MSK) >> CONFIG_TDMA_TIMESLOT_OFST);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* aquisition */
|
/* aquisition */
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@ enum DACINDEX {VB_COMP, VDD_PROT, VIN_COM, VREF_PRECH, VB_PIXBUF, VB_DS, VREF
|
|||||||
"Force Switch Gain 1", /* FORCESWITCHG1*/ \
|
"Force Switch Gain 1", /* FORCESWITCHG1*/ \
|
||||||
"Force Switch Gain 2" /* FORCESWITCHG2*/ \
|
"Force Switch Gain 2" /* FORCESWITCHG2*/ \
|
||||||
};
|
};
|
||||||
|
enum NETWORKINDEX { TXN_FRAME };
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -89,6 +90,7 @@ enum DACINDEX {VB_COMP, VDD_PROT, VIN_COM, VREF_PRECH, VB_PIXBUF, VB_DS, VREF
|
|||||||
/* Defines in the Firmware */
|
/* Defines in the Firmware */
|
||||||
#define FIX_PATT_VAL (0xACDC2014)
|
#define FIX_PATT_VAL (0xACDC2014)
|
||||||
#define ADC_PORT_INVERT_VAL (0x453b2a9c)
|
#define ADC_PORT_INVERT_VAL (0x453b2a9c)
|
||||||
|
#define MAX_TIMESLOT_VAL (0x1F)
|
||||||
|
|
||||||
|
|
||||||
#define SAMPLE_ADC_HALF_SPEED (SAMPLE_DECMT_FACTOR_2_VAL + SAMPLE_DGTL_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + SAMPLE_ADC_SAMPLE_0_VAL) /* 0x1000 */
|
#define SAMPLE_ADC_HALF_SPEED (SAMPLE_DECMT_FACTOR_2_VAL + SAMPLE_DGTL_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + SAMPLE_ADC_SAMPLE_0_VAL) /* 0x1000 */
|
||||||
|
@ -192,6 +192,8 @@ int setAllTrimbits(int val);
|
|||||||
int getAllTrimbits();
|
int getAllTrimbits();
|
||||||
int getBebFPGATemp();
|
int getBebFPGATemp();
|
||||||
int activate(int enable);
|
int activate(int enable);
|
||||||
|
#endif
|
||||||
|
#if defined(JUNGFRAUD) || defined(EIGERD)
|
||||||
int setNetworkParameter(enum NETWORKINDEX mode, int value);
|
int setNetworkParameter(enum NETWORKINDEX mode, int value);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -83,8 +83,10 @@ int main(int argc, char *argv[]){
|
|||||||
printf("function table assigned \n");
|
printf("function table assigned \n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (b)
|
||||||
printf("\nReady...\n\n");
|
printf("\nControl Server Ready...\n\n");
|
||||||
|
else
|
||||||
|
printf("\nStop Server Ready...\n\n");
|
||||||
|
|
||||||
/* waits for connection */
|
/* waits for connection */
|
||||||
while(retval!=GOODBYE) {
|
while(retval!=GOODBYE) {
|
||||||
|
@ -4405,7 +4405,7 @@ int set_network_parameter(int file_des) {
|
|||||||
int retval=-1;
|
int retval=-1;
|
||||||
sprintf(mess,"set network parameter failed\n");
|
sprintf(mess,"set network parameter failed\n");
|
||||||
|
|
||||||
#ifndef EIGERD
|
#if !defined(EIGERD) && !defined(JUNGFRAUD)
|
||||||
//to receive any arguments
|
//to receive any arguments
|
||||||
while (n > 0)
|
while (n > 0)
|
||||||
n = receiveData(file_des,mess,MAX_STR_LENGTH,OTHER);
|
n = receiveData(file_des,mess,MAX_STR_LENGTH,OTHER);
|
||||||
@ -4426,7 +4426,7 @@ int set_network_parameter(int file_des) {
|
|||||||
if (n < 0) return printSocketReadError();
|
if (n < 0) return printSocketReadError();
|
||||||
|
|
||||||
// execute action
|
// execute action
|
||||||
if (differentClients && lockStatus && value<0) {
|
if (differentClients && lockStatus && value >= 0) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
sprintf(mess,"Detector locked by %s\n",lastClientIP);
|
sprintf(mess,"Detector locked by %s\n",lastClientIP);
|
||||||
cprintf(RED, "Warning: %s", mess);
|
cprintf(RED, "Warning: %s", mess);
|
||||||
@ -4437,17 +4437,27 @@ int set_network_parameter(int file_des) {
|
|||||||
printf("setting network parameter mode %d to %d\n",(int)mode,value);
|
printf("setting network parameter mode %d to %d\n",(int)mode,value);
|
||||||
#endif
|
#endif
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
|
|
||||||
|
#ifdef EIGERD
|
||||||
|
case FLOW_CONTROL_10G:
|
||||||
|
index = FLOWCTRL_10G;
|
||||||
|
break;
|
||||||
case DETECTOR_TXN_DELAY_LEFT:
|
case DETECTOR_TXN_DELAY_LEFT:
|
||||||
index = TXN_LEFT;
|
index = TXN_LEFT;
|
||||||
break;
|
break;
|
||||||
case DETECTOR_TXN_DELAY_RIGHT:
|
case DETECTOR_TXN_DELAY_RIGHT:
|
||||||
index = TXN_RIGHT;
|
index = TXN_RIGHT;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case DETECTOR_TXN_DELAY_FRAME:
|
case DETECTOR_TXN_DELAY_FRAME:
|
||||||
index = TXN_FRAME;
|
index = TXN_FRAME;
|
||||||
break;
|
#ifdef JUNGFRAUD
|
||||||
case FLOW_CONTROL_10G:
|
if (value > MAX_TIMESLOT_VAL) {
|
||||||
index = FLOWCTRL_10G;
|
ret=FAIL;
|
||||||
|
sprintf(mess,"Transmission delay %d should be in range: 0 - 31\n", value);
|
||||||
|
cprintf(RED, "Warning: %s", mess);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user