mirror of https://github.com/m-labs/artiq.git
tests: test spi business
This commit is contained in:
parent
bf188d05bf
commit
58e0e670fc
|
@ -0,0 +1,24 @@
|
||||||
|
from artiq.experiment import *
|
||||||
|
from artiq.test.hardware_testbench import ExperimentCase
|
||||||
|
|
||||||
|
|
||||||
|
class Busy(EnvExperiment):
|
||||||
|
def build(self):
|
||||||
|
self.setattr_device("core")
|
||||||
|
self.setattr_device("spi0")
|
||||||
|
self.setattr_device("led")
|
||||||
|
|
||||||
|
@kernel
|
||||||
|
def run(self):
|
||||||
|
self.spi0.set_config_mu()
|
||||||
|
delay(-8*ns)
|
||||||
|
self.spi0.set_config_mu() # causes the error
|
||||||
|
self.led.on()
|
||||||
|
self.led.sync() # registers the error
|
||||||
|
self.core.break_realtime()
|
||||||
|
self.spi0.set_config_mu() # raises the error
|
||||||
|
|
||||||
|
|
||||||
|
class SPITest(ExperimentCase):
|
||||||
|
def test_busy(self):
|
||||||
|
self.execute(Busy)
|
Loading…
Reference in New Issue