From eb2ec40b3aa91b09174242a73c557f2718754268 Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Fri, 4 Mar 2016 19:01:29 +0100 Subject: [PATCH] ad5360: un-factor write_channels --- artiq/coredevice/ad5360.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/artiq/coredevice/ad5360.py b/artiq/coredevice/ad5360.py index d70c90e25..701f0d775 100644 --- a/artiq/coredevice/ad5360.py +++ b/artiq/coredevice/ad5360.py @@ -50,8 +50,7 @@ class AD5360: self.core = dmgr.get("core") self.bus = dmgr.get(spi_device) if ldac_device is not None: - ldac = dmgr.get(ldac_device) - self.ldac = ldac + self.ldac = dmgr.get(ldac_device) self.chip_select = chip_select @kernel @@ -78,11 +77,6 @@ class AD5360: value &= 0xffff self.write(op | _AD5360_WRITE_CHANNEL(channel) | value) - @kernel - def write_channels(self, values, op=_AD5360_CMD_DATA): - for i in range(len(values)): - self.write_channel(i, values[i], op) - @kernel def read_channel_sync(self, channel=0, op=_AD5360_READ_X1A): channel &= 0x3f @@ -110,7 +104,8 @@ class AD5360: 3*self.bus.ref_period_mu - seconds_to_mu(1.5*us) - seconds_to_mu(3*us)) - self.write_channels(values, op) + 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()