devices: add simple GPIO out

This commit is contained in:
Sebastien Bourdeauducq 2014-07-05 22:45:08 +02:00
parent a8ef4d8b91
commit 37cd4e7e86
1 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,12 @@
from artiq.language.experiment import *
class GPIOOut:
def __init__(self, core, channel=0):
self.core = core
self.channel = channel
kernel_attr_ro = "channel"
@kernel
def set(self, level):
syscall("gpio_set", self.channel, level)