From 37cd4e7e86097951b17946cb16e10d7f632a8ae0 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 5 Jul 2014 22:45:08 +0200 Subject: [PATCH] devices: add simple GPIO out --- artiq/devices/gpio_core.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 artiq/devices/gpio_core.py diff --git a/artiq/devices/gpio_core.py b/artiq/devices/gpio_core.py new file mode 100644 index 000000000..e457ec0a2 --- /dev/null +++ b/artiq/devices/gpio_core.py @@ -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)