コード例 #1
0
ファイル: spi.py プロジェクト: cjbe/artiq
 def __init__(self, dmgr, channel, core_device="core"):
     self.core = dmgr.get(core_device)
     self.ref_period_mu = seconds_to_mu(self.core.coarse_ref_period, self.core)
     self.channel = channel
     self.write_period_mu = numpy.int64(0)
     self.read_period_mu = numpy.int64(0)
     self.xfer_period_mu = numpy.int64(0)
コード例 #2
0
ファイル: spi.py プロジェクト: sjmackenzie/artiq
 def __init__(self, dmgr, channel):
     self.core = dmgr.get("core")
     self.ref_period_mu = seconds_to_mu(self.core.coarse_ref_period, self.core)
     self.channel = channel
     self.write_period_mu = int(0, 64)
     self.read_period_mu = int(0, 64)
     self.xfer_period_mu = int(0, 64)
コード例 #3
0
 def __init__(self, dmgr, channel, core_device="core"):
     self.core = dmgr.get(core_device)
     self.ref_period_mu = seconds_to_mu(self.core.coarse_ref_period,
                                        self.core)
     self.channel = channel
     self.write_period_mu = numpy.int64(0)
     self.read_period_mu = numpy.int64(0)
     self.xfer_period_mu = numpy.int64(0)
コード例 #4
0
    def set(self, values, op=_AD5360_CMD_DATA):
        """Write to several channels and pulse LDAC to update the channels.

        This method does not advance the timeline. Write events are scheduled
        in the past. The DACs will synchronously start changing their output
        levels `now`.

        :param values: List of 16 bit values to write to the channels.
        :param op: Operation to perform, one of :const:`_AD5360_CMD_DATA`,
          :const:`_AD5360_CMD_OFFSET`, :const:`_AD5360_CMD_GAIN`
          (default: :const:`_AD5360_CMD_DATA`).
        """
        # compensate all delays that will be applied
        delay_mu(-len(values) *
                 (self.bus.xfer_period_mu + self.bus.write_period_mu +
                  self.bus.ref_period_mu) - 3 * self.bus.ref_period_mu -
                 seconds_to_mu(1.5 * us))
        for i in range(len(values)):
            self.write_channel(i, values[i], op)
        delay_mu(3 * self.bus.ref_period_mu +  # latency alignment ttl to spi
                 seconds_to_mu(1.5 * us))  # t10 max busy low for one channel
        self.load()
        delay_mu(-2 * self.bus.ref_period_mu)  # load(), t13
コード例 #5
0
ファイル: ad5360.py プロジェクト: amhankin/artiq
    def set(self, values, op=_AD5360_CMD_DATA):
        """Write to several channels and pulse LDAC to update the channels.

        This method does not advance the timeline. Write events are scheduled
        in the past. The DACs will synchronously start changing their output
        levels `now`.

        :param values: List of 16 bit values to write to the channels.
        :param op: Operation to perform, one of :const:`_AD5360_CMD_DATA`,
          :const:`_AD5360_CMD_OFFSET`, :const:`_AD5360_CMD_GAIN`
          (default: :const:`_AD5360_CMD_DATA`).
        """
        # compensate all delays that will be applied
        delay_mu(-len(values)*(self.bus.xfer_period_mu +
                               self.bus.write_period_mu +
                               self.bus.ref_period_mu) -
                 3*self.bus.ref_period_mu -
                 seconds_to_mu(1.5*us))
        for i in range(len(values)):
            self.write_channel(i, values[i], op)
        delay_mu(3*self.bus.ref_period_mu +  # latency alignment ttl to spi
                 seconds_to_mu(1.5*us))  # t10 max busy low for one channel
        self.load()
        delay_mu(-2*self.bus.ref_period_mu)  # load(), t13