forked from M-Labs/artiq
1
0
Fork 0

coredevice.spi: kernel invariants and style

This commit is contained in:
Robert Jördens 2017-04-07 23:45:46 +02:00
parent 555b3c38c1
commit 0838981bed
1 changed files with 6 additions and 1 deletions

View File

@ -56,9 +56,14 @@ class SPIMaster:
:param channel: RTIO channel number of the SPI bus to control.
"""
kernel_invariants = {"core", "ref_period_mu", "channel"}
def __init__(self, dmgr, channel, core_device="core"):
self.core = dmgr.get(core_device)
self.ref_period_mu = self.core.seconds_to_mu(self.core.coarse_ref_period)
self.ref_period_mu = self.core.seconds_to_mu(
self.core.coarse_ref_period)
assert self.ref_period_mu == self.core.ref_multiplier
self.channel = channel
self.write_period_mu = numpy.int64(0)
self.read_period_mu = numpy.int64(0)