示例#1
0
def set_trigmode_reg(skiroc,mode):
    "set the trigger mode of a skiroc"
    if mode!="undef":
        if mode=="ext":
            return common_roc.apply_mask(skiroc,9,common_roc.split_bin(1,1))
        if mode=="int":
            return common_roc.apply_mask(skiroc,9,common_roc.split_bin(0,1))
    return 0,"Unknown mode %s. Supported mode are int or ext"%(mode)
示例#2
0
def set_end_ro_reg(skiroc,end_ro):
    "end the readout set"
    if int(end_ro)==1:
        return common_roc.apply_mask(skiroc,6,common_roc.split_bin(1,1))
    elif int(end_ro)==2:
        return common_roc.apply_mask(skiroc,6,common_roc.split_bin(0,1))
    elif end_ro=="undef":
        return 1,"ok"
    return 0,"invalid value: %s"%(end_ro)
示例#3
0
def set_start_ro_reg(skiroc,start_ro):
    "start the readout set"
    if int(start_ro)==1:
        return common_roc.apply_mask(skiroc,5,common_roc.split_bin(1,1))
    elif int(start_ro)==2:
        return common_roc.apply_mask(skiroc,5,common_roc.split_bin(0,1))
    elif start_ro=="undef":
        return 1,"ok"
    return 0,"invalid value: %s"%(start_ro)
示例#4
0
def set_preamp_gain(maroc3,chan,value):
    return common_roc.apply_mask(maroc3,190+(63-chan)*9,common_roc.split_bin(value,8))
示例#5
0
def set_dacadj(skiroc,chan,dacadj):
    "set the dac adjustment of a channel"
    if dacadj!="undef":
        return common_roc.apply_mask(skiroc,137+int(chan),common_roc.split_bin(int(dacadj),4))
    return 1,"ok"
示例#6
0
def disallow_trig(skiroc,chan):
    "disallow a channel to trig"
    return common_roc.apply_mask(skiroc,73+int(chan),common_roc.split_bin(1,1))
示例#7
0
def unselect_leak_chan(skiroc, chan):
    "unselect the high leakage for a channel"
    return common_roc.apply_mask(skiroc,415+(63-int(chan))*3,common_roc.split_bin(0,1))
示例#8
0
def disable_calib_chan(skiroc, chan):
    "disable the calibration for a channel"
    return common_roc.apply_mask(skiroc, 416+(63-int(chan))*3,common_roc.split_bin(0,1))
示例#9
0
def disable_preamp_chan(skiroc,chan):
    "disable the preamplifier of a channel"
    return common_roc.apply_mask(skiroc,417+(63-int(chan))*3,common_roc.split_bin(1,1))
示例#10
0
def allow_trig(spiroc,chan):
    "allow a channel to trig"
    common_roc.apply_mask(spiroc,73+int(chan),common_roc.split_bin(0,1))
    return 1,"ok"
示例#11
0
def set_dac_data(easiroc, chan, value):
    common_roc.apply_mask(easiroc, 166 + 288 - 9 * (int(chan) + 1) + 1, common_roc.split_bin(dac_data_value, 8))
    return 1, "ok"