Beispiel #1
0
 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
Beispiel #2
0
    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]
Beispiel #3
0
    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]
Beispiel #4
0
    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]
Beispiel #5
0
    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)
Beispiel #7
0
 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)
Beispiel #8
0
 def __init__(self, address):
     MultiZMQ_IO.__init__(addresses=[address])
     self._address = address
Beispiel #9
0
    def reset(self):
        '''
        Send a reset pulse to the LArPix ASICs.

        '''
        return MultiZMQ_IO.reset()[self._address]
Beispiel #10
0
 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