mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-24 19:04:02 +08:00
devices: add simple GPIO out
This commit is contained in:
parent
a8ef4d8b91
commit
37cd4e7e86
12
artiq/devices/gpio_core.py
Normal file
12
artiq/devices/gpio_core.py
Normal 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)
|
Loading…
Reference in New Issue
Block a user