forked from M-Labs/artiq
coredevice.spi: kernel invariants and style
This commit is contained in:
parent
555b3c38c1
commit
0838981bed
|
@ -56,9 +56,14 @@ class SPIMaster:
|
||||||
|
|
||||||
:param channel: RTIO channel number of the SPI bus to control.
|
: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"):
|
def __init__(self, dmgr, channel, core_device="core"):
|
||||||
self.core = dmgr.get(core_device)
|
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.channel = channel
|
||||||
self.write_period_mu = numpy.int64(0)
|
self.write_period_mu = numpy.int64(0)
|
||||||
self.read_period_mu = numpy.int64(0)
|
self.read_period_mu = numpy.int64(0)
|
||||||
|
|
Loading…
Reference in New Issue