def getDaqBSI(): """ Returns BSI of last DAQ transaction. """ cmd = DC.reg_read(DC.MOD_DAQ, DC.DAQ_BSMP_CURR) resp = _controlCmdWrapper(cmd) return resp.reg_io.val
def getSataBSI(): """ Returns BSI of last SATA write. """ cmd = DC.reg_read(DC.MOD_SATA, DC.SATA_W_IDX) resp = _controlCmdWrapper(cmd) return resp.reg_io.val
def isRecording(): """ Returns True if hardware is recording, False otherwise. """ cmd = DC.reg_read(DC.MOD_DAQ, DC.DAQ_SATA_ENABLE) resp = _controlCmdWrapper(cmd) return resp.reg_io.val == 3
def isStreaming(): """ Returns True if hardware is streaming, False otherwise. """ cmd = DC.reg_read(DC.MOD_DAQ, DC.DAQ_UDP_ENABLE) resp = _controlCmdWrapper(cmd) return resp.reg_io.val == 1
def getChipsAlive(): """ Returns a list of indices of live Intan chips, by reading the bitmask in hardware register (3,4) """ cmd = DC.reg_read(DC.MOD_DAQ, DC.DAQ_CHIP_ALIVE) resp = _controlCmdWrapper(cmd) mask = resp.reg_io.val return [i for i in range(32) if (mask & (0x1 << i))]
def _doRegRead(module, address): mutexLocker = QtCore.QMutexLocker(DAEMON_MUTEX) resp = DC.do_control_cmd(DC.reg_read(module, address), control_socket=DAEMON_SOCK) if resp: if resp.type == DC.ControlResponse.REG_IO: return resp.reg_io.val elif resp.type == DC.ControlResponse.ERR: raise hwifError(1, resp.err.code) else: raise hwifError(2)
def getSampleType(): """ Returns streaming type: 'boardsample' or 'subsample' """ cmd = DC.reg_read(DC.MOD_DAQ, DC.DAQ_UDP_MODE) resp = _controlCmdWrapper(cmd) val = resp.reg_io.val if val == 0: return 'subsample' elif val == 1: return 'boardsample' else: return 'unknown'