tests: test spi business

This commit is contained in:
Robert Jördens 2016-03-09 15:39:16 +01:00
parent bf188d05bf
commit 58e0e670fc
1 changed files with 24 additions and 0 deletions

View File

@ -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)