diff --git a/artiq/devices/runtime.py b/artiq/devices/runtime.py index 2563abb12..3b9330201 100644 --- a/artiq/devices/runtime.py +++ b/artiq/devices/runtime.py @@ -5,7 +5,8 @@ lt.initialize_all() _syscalls = [ ("rpc", "i+:i"), - ("gpio_set", "ii:v") + ("gpio_set", "ii:v"), + ("rtio_set", "iii:v") ] def _str_to_functype(s): diff --git a/artiq/devices/ttl_core.py b/artiq/devices/ttl_core.py new file mode 100644 index 000000000..eda921c1d --- /dev/null +++ b/artiq/devices/ttl_core.py @@ -0,0 +1,10 @@ +from artiq.language.core import * + +class TTLOut(MPO): + parameters = "channel" + + @kernel + def pulse(self, duration): + syscall("rtio_set", now(), self.channel, 1) + delay(duration) + syscall("rtio_set", now(), self.channel, 0)