def decode(cls, msgs, io_chain=0, **kwargs): ''' Convert a list ZMQ messages into packets ''' packets = MultiZMQ_IO.decode(msgs, io_chain=io_chain, address=None, **kwargs) for packet in packets: packet.chip_key = cls.generate_chip_key( **MultiZMQ_IO.parse_chip_key(packet.chip_key)) return packets
def ping(self): ''' Send a ping to the system and return True if the first two bytes of the response are b'OK'. ''' return MultiZMQ_IO.ping()[self._address]
def get_packet_count(self, io_channel): ''' Get the number of packets received, as determined by the number of UART "start" bits processed. ''' return MultiZMQ_IO.get_packet_count( io_channel=io_channel, address=self._address)[self._address]
def set_testpulse_freq(self, divisor): ''' Set the testpulse frequency, computed by dividing the CLK2X frequency by ``divisor``. ''' return MultiZMQ_IO.set_testpulse_freq( divisor=divisor, address=self._address)[self._address]
def set_clock(self, freq_khz, addresses=None): ''' Set the LArPix CLK2X freqency (in kHz). :param freq_khz: CLK2X freq in khz to set ''' return MultiZMQ_IO.set_clock(freq_khz=freq_khz, address=self._address)[self._address]
def multizmq_io_obj(io_config): return MultiZMQ_IO(io_config)
def send(self, packets): for packet in packets: packet.chip_key = MultiZMQ_IO.generate_chip_key( address=self._address, **self.parse_chip_key(packet.chip_key)) MultiZMQ_IO.send(packets)
def __init__(self, address): MultiZMQ_IO.__init__(addresses=[address]) self._address = address
def reset(self): ''' Send a reset pulse to the LArPix ASICs. ''' return MultiZMQ_IO.reset()[self._address]
def empty_queue(self): packets, bytestream = MultiZMQ_IO.empty_queue() for packet in packets: packet.chip_key = self.generate_chip_key( **MultiZMQ_IO.parse_chip_key(packet.chip_key)) return packets, bytestream