diff --git a/slsDetectorServers/mythen3DetectorServer/RegisterDefs.h b/slsDetectorServers/mythen3DetectorServer/RegisterDefs.h index e1bfe9600..43e42df35 100644 --- a/slsDetectorServers/mythen3DetectorServer/RegisterDefs.h +++ b/slsDetectorServers/mythen3DetectorServer/RegisterDefs.h @@ -69,6 +69,8 @@ // #define CONTROL_MMRY_RST_MSK (0x00000001 << CONTROL_MMRY_RST_OFST) #define CONTROL_CLR_ACQSTN_FIFO_OFST (14) #define CONTROL_CLR_ACQSTN_FIFO_MSK (0x00000001 << CONTROL_CLR_ACQSTN_FIFO_OFST) +#define CONTROL_PWR_CHIP_OFST (31) +#define CONTROL_PWR_CHIP_MSK (0x00000001 << CONTROL_PWR_CHIP_OFST) /* Pattern IO Control 64 bit register */ #define PATTERN_IO_CTRL_LSB_REG (0x22 * REG_OFFSET + BASE_CONTROL) diff --git a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer index 064578eb3..1ad780daa 100755 Binary files a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer and b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer differ diff --git a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c index e39a8e193..3c8324b8c 100644 --- a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c @@ -888,6 +888,20 @@ void setPatternLoop(int level, int *startAddr, int *stopAddr, int *nLoop) { } } +int powerChip (int on){ + if(on != -1){ + if(on){ + FILE_LOG(logINFO, ("Powering chip: on\n")); + bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_PWR_CHIP_MSK); + } + else{ + FILE_LOG(logINFO, ("Powering chip: off\n")); + bus_w(CONTROL_REG, bus_r(CONTROL_REG) & ~CONTROL_PWR_CHIP_MSK); + } + } + + return ((bus_r(CONTROL_REG) & CONTROL_PWR_CHIP_MSK) >> CONTROL_PWR_CHIP_OFST); +} /* aquisition */ diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h index 9df9c8c35..573ab450c 100755 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h @@ -425,6 +425,7 @@ uint64_t writePatternWord(int addr, uint64_t word); int setPatternWaitAddress(int level, int addr); uint64_t setPatternWaitTime(int level, uint64_t t); void setPatternLoop(int level, int *startAddr, int *stopAddr, int *nLoop); +int powerChip (int on); #elif GOTTHARD2D diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index 81751b921..4742f2138 100755 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -3567,7 +3567,7 @@ int power_chip(int file_des) { return printSocketReadError(); FILE_LOG(logDEBUG1, ("Powering chip to %d\n", arg)); -#if (!defined(JUNGFRAUD)) && (!defined(MOENCHD)) +#if (!defined(JUNGFRAUD)) && (!defined(MOENCHD)) && (!defined(MYTHEN3D)) functionNotImplemented(); #else // set & get diff --git a/slsDetectorSoftware/include/CmdProxy.h b/slsDetectorSoftware/include/CmdProxy.h index 4825f5c1a..34df8be8b 100644 --- a/slsDetectorSoftware/include/CmdProxy.h +++ b/slsDetectorSoftware/include/CmdProxy.h @@ -885,7 +885,6 @@ class CmdProxy { std::string Quad(int action); /* Jungfrau Specific */ std::string TemperatureEvent(int action); - std::string PowerChip(int action); /* Gotthard Specific */ std::string ROI(int action); std::string ClearROI(int action); @@ -1424,7 +1423,7 @@ class CmdProxy { "[0, 1]\n\t[Jungfrau] Temperature control enable. Default is 0 (disabled). If temperature crosses threshold temperature and temperature control is enabled, power to chip will be switched off and temperature event occurs. To power on chip again, temperature has to be less than threshold temperature and temperature event has to be cleared."); INTEGER_COMMAND(powerchip, getPowerChip, setPowerChip, std::stoi, - "[0, 1]\n\t[Jungfrau] Power the chip. Default 0. Get will return power status. Can be off if temperature event occured (temperature over temp_threshold with temp_control enabled."); + "[0, 1]\n\t[Jungfrau][Mythen3] Power the chip. Default 0. \n\t[Jungfrau] Get will return power status. Can be off if temperature event occured (temperature over temp_threshold with temp_control enabled."); INTEGER_COMMAND(auto_comp_disable, getAutoCompDisable, setAutoCompDisable, std::stoi, "[0, 1]\n\t[Jungfrau] Auto comparator disable mode. Default 0 or this mode disabled(comparator enabled throughout). 1 enables mode. 0 disables mode. This mode disables the on-chip gain switching comparator automatically after 93.75% of exposure time (only for longer than 100us)."); diff --git a/slsSupportLib/include/versionAPI.h b/slsSupportLib/include/versionAPI.h index 494a84592..30c70c65c 100644 --- a/slsSupportLib/include/versionAPI.h +++ b/slsSupportLib/include/versionAPI.h @@ -7,6 +7,6 @@ #define APIJUNGFRAU 0x191105 #define APIGOTTHARD 0x191105 #define APIGOTTHARD2 0x191105 -#define APIMYTHEN3 0x191105 #define APICTB 0x191105 #define APIEIGER 0x191105 +#define APIMYTHEN3 0x191106