mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-07 10:30:41 +02:00
ctb server: hv select is actually internal hv select
This commit is contained in:
parent
3bb0daeefb
commit
e16b857ba2
@ -439,8 +439,8 @@
|
||||
|
||||
#define POWER_ENBL_VLTG_RGLTR_OFST (16)
|
||||
#define POWER_ENBL_VLTG_RGLTR_MSK (0x0000001F << POWER_ENBL_VLTG_RGLTR_OFST)
|
||||
#define POWER_HV_SLCT_OFST (31)
|
||||
#define POWER_HV_SLCT_MSK (0x00000001 << POWER_HV_SLCT_OFST)
|
||||
#define POWER_HV_INTERNAL_SLCT_OFST (31)
|
||||
#define POWER_HV_INTERNAL_SLCT_MSK (0x00000001 << POWER_HV_INTERNAL_SLCT_OFST)
|
||||
|
||||
/* Number of Words RW register TODO */
|
||||
#define NUMBER_OF_WORDS_REG (0x5F << MEM_MAP_SHIFT)
|
||||
|
@ -1422,14 +1422,14 @@ int setHighVoltage(int val){
|
||||
FILE_LOG(logINFO, ("Setting High voltage: %d V\n", val));
|
||||
uint32_t addr = POWER_REG;
|
||||
|
||||
// switch off high voltage
|
||||
bus_w(addr, bus_r(addr) & (~POWER_HV_SLCT_MSK));
|
||||
// switch to external high voltage
|
||||
bus_w(addr, bus_r(addr) & (~POWER_HV_INTERNAL_SLCT_OFST));
|
||||
|
||||
MAX1932_Set(val);
|
||||
|
||||
// switch on high voltage if val > 0
|
||||
// switch on internal high voltage, if set
|
||||
if (val > 0)
|
||||
bus_w(addr, bus_r(addr) | POWER_HV_SLCT_MSK);
|
||||
bus_w(addr, bus_r(addr) | POWER_HV_INTERNAL_SLCT_OFST);
|
||||
|
||||
highvoltage = val;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user