diff --git a/slsDetectorSoftware/eigerDetectorServer/Beb.c b/slsDetectorSoftware/eigerDetectorServer/Beb.c index 8ed632faa..7138c706f 100644 --- a/slsDetectorSoftware/eigerDetectorServer/Beb.c +++ b/slsDetectorSoftware/eigerDetectorServer/Beb.c @@ -267,6 +267,35 @@ int Beb_Activate(int enable){ return ret; } + +int Beb_SetTransmissionDelay(int delay){ + //mapping new memory + u_int32_t baseaddr, value = 0; + + //open file pointer + int fd = Beb_open(XPAR_PLB_GPIO_SYS_BASEADDR,&baseaddr); + if(fd < 0){ + cprintf(BG_RED,"Deactivate FAIL\n"); + return -1; + } + else{ + if(delay > -1){ + value = Beb_Read32(baseaddr, TXM_DELAY_LEFT_OFFSET); + cprintf(BLUE, "Transmission Delay value before:%d\n",value); + Beb_Write32(baseaddr, TXM_DELAY_LEFT_OFFSET,delay); + } + + value = Beb_Read32(baseaddr, TXM_DELAY_LEFT_OFFSET); + cprintf(BLUE,"Transmission Delay value:%d\n", value); + } + //close file pointer + if(fd > 0) + Beb_close(fd); + + return 0; +} + + int Beb_ResetToHardwareSettings(){ //mapping new memory u_int32_t baseaddr, value = 0, ret = 1; diff --git a/slsDetectorSoftware/eigerDetectorServer/Beb.h b/slsDetectorSoftware/eigerDetectorServer/Beb.h index 1948eee9d..6e4fee3a1 100644 --- a/slsDetectorSoftware/eigerDetectorServer/Beb.h +++ b/slsDetectorSoftware/eigerDetectorServer/Beb.h @@ -51,6 +51,7 @@ struct BebInfo{ int Beb_SetMasterViaSoftware(); int Beb_SetSlaveViaSoftware(); int Beb_Activate(int enable); + int Beb_SetTransmissionDelay(int delay); int Beb_ResetToHardwareSettings(); u_int32_t Beb_GetFirmwareRevision(); u_int32_t Beb_GetFirmwareSoftwareAPIVersion(); diff --git a/slsDetectorSoftware/eigerDetectorServer/FebRegisterDefs.h b/slsDetectorSoftware/eigerDetectorServer/FebRegisterDefs.h index 961e7b170..8ecd6cfc2 100644 --- a/slsDetectorSoftware/eigerDetectorServer/FebRegisterDefs.h +++ b/slsDetectorSoftware/eigerDetectorServer/FebRegisterDefs.h @@ -122,6 +122,8 @@ #define OVERWRITE_HARDWARE_BIT 0x2 #define DEACTIVATE_BIT 0x4 +#define TXM_DELAY_LEFT_OFFSET 0x180 + //command memory #define LEFT_OFFSET 0x0 #define RIGHT_OFFSET 0x100 diff --git a/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c b/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c index 82db02cf4..3b744c08a 100644 --- a/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c @@ -741,6 +741,7 @@ enum detectorSettings getSettings(){ } int startReceiver(int d){ + printf("Going to prepare for acquisition with counter_bit:%d\n",Feb_Control_Get_Counter_Bit()); Feb_Control_PrepareForAcquisition(); printf("Going to reset Frame Number\n");