forked from M-Labs/artiq
1
0
Fork 0

devices: add RTIO support

This commit is contained in:
Sebastien Bourdeauducq 2014-07-20 18:36:17 -06:00
parent 043c4345e5
commit 041540089a
2 changed files with 12 additions and 1 deletions

View File

@ -5,7 +5,8 @@ lt.initialize_all()
_syscalls = [ _syscalls = [
("rpc", "i+:i"), ("rpc", "i+:i"),
("gpio_set", "ii:v") ("gpio_set", "ii:v"),
("rtio_set", "iii:v")
] ]
def _str_to_functype(s): def _str_to_functype(s):

10
artiq/devices/ttl_core.py Normal file
View File

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