forked from M-Labs/artiq
1
0
Fork 0

ad5360: add batched zero-length multi-channel set()

This commit is contained in:
Robert Jördens 2016-03-04 18:14:24 +01:00
parent 4ae3ca5f23
commit 710717ca9b
1 changed files with 12 additions and 0 deletions

View File

@ -98,3 +98,15 @@ class AD5360:
self.ldac.off() self.ldac.off()
delay_mu(3*self.bus.ref_period_mu) delay_mu(3*self.bus.ref_period_mu)
self.ldac.on() self.ldac.on()
@kernel
def set(self, values, op=_AD5360_CMD_DATA):
# write() compensation
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) # latency alignment
self.write_channels(values, op)
delay_mu(3*self.bus.ref_period_mu) # latency alignment
self.load()
delay_mu(-3*self.bus.ref_period_mu) # load() compensation