artiq/artiq/coredevice/gpio.py
Sebastien Bourdeauducq 2a843ea436 language: replace AutoContext 'parameter' string with abstract attributes
This allows specifying default values for parameters, and other data.
2014-12-02 17:19:05 +08:00

15 lines
287 B
Python

from artiq.language.core import *
from artiq.language.context import *
class GPIOOut(AutoContext):
channel = Parameter()
@kernel
def on(self):
syscall("gpio_set", self.channel, True)
@kernel
def off(self):
syscall("gpio_set", self.channel, False)