powerchip for mythen3

This commit is contained in:
Marie Andrae 2019-11-06 11:50:09 +01:00
parent 705ddb7f42
commit 7de9401bc7
7 changed files with 20 additions and 4 deletions

View File

@ -69,6 +69,8 @@
// #define CONTROL_MMRY_RST_MSK (0x00000001 << CONTROL_MMRY_RST_OFST) // #define CONTROL_MMRY_RST_MSK (0x00000001 << CONTROL_MMRY_RST_OFST)
#define CONTROL_CLR_ACQSTN_FIFO_OFST (14) #define CONTROL_CLR_ACQSTN_FIFO_OFST (14)
#define CONTROL_CLR_ACQSTN_FIFO_MSK (0x00000001 << CONTROL_CLR_ACQSTN_FIFO_OFST) #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 */ /* Pattern IO Control 64 bit register */
#define PATTERN_IO_CTRL_LSB_REG (0x22 * REG_OFFSET + BASE_CONTROL) #define PATTERN_IO_CTRL_LSB_REG (0x22 * REG_OFFSET + BASE_CONTROL)

View File

@ -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 */ /* aquisition */

View File

@ -425,6 +425,7 @@ uint64_t writePatternWord(int addr, uint64_t word);
int setPatternWaitAddress(int level, int addr); int setPatternWaitAddress(int level, int addr);
uint64_t setPatternWaitTime(int level, uint64_t t); uint64_t setPatternWaitTime(int level, uint64_t t);
void setPatternLoop(int level, int *startAddr, int *stopAddr, int *nLoop); void setPatternLoop(int level, int *startAddr, int *stopAddr, int *nLoop);
int powerChip (int on);
#elif GOTTHARD2D #elif GOTTHARD2D

View File

@ -3567,7 +3567,7 @@ int power_chip(int file_des) {
return printSocketReadError(); return printSocketReadError();
FILE_LOG(logDEBUG1, ("Powering chip to %d\n", arg)); FILE_LOG(logDEBUG1, ("Powering chip to %d\n", arg));
#if (!defined(JUNGFRAUD)) && (!defined(MOENCHD)) #if (!defined(JUNGFRAUD)) && (!defined(MOENCHD)) && (!defined(MYTHEN3D))
functionNotImplemented(); functionNotImplemented();
#else #else
// set & get // set & get

View File

@ -885,7 +885,6 @@ class CmdProxy {
std::string Quad(int action); std::string Quad(int action);
/* Jungfrau Specific */ /* Jungfrau Specific */
std::string TemperatureEvent(int action); std::string TemperatureEvent(int action);
std::string PowerChip(int action);
/* Gotthard Specific */ /* Gotthard Specific */
std::string ROI(int action); std::string ROI(int action);
std::string ClearROI(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."); "[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, 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, 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)."); "[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).");

View File

@ -7,6 +7,6 @@
#define APIJUNGFRAU 0x191105 #define APIJUNGFRAU 0x191105
#define APIGOTTHARD 0x191105 #define APIGOTTHARD 0x191105
#define APIGOTTHARD2 0x191105 #define APIGOTTHARD2 0x191105
#define APIMYTHEN3 0x191105
#define APICTB 0x191105 #define APICTB 0x191105
#define APIEIGER 0x191105 #define APIEIGER 0x191105
#define APIMYTHEN3 0x191106