artiq/soc/runtime/gpio.c

15 lines
243 B
C
Raw Normal View History

2014-08-28 16:56:48 +08:00
#include <generated/csr.h>
#include "gpio.h"
void gpio_set(int channel, int value)
{
2014-09-05 12:03:22 +08:00
static int csr_value;
2014-08-28 16:56:48 +08:00
2014-09-05 12:03:22 +08:00
if(value)
csr_value |= 1 << channel;
else
csr_value &= ~(1 << channel);
leds_out_write(csr_value);
2014-08-28 16:56:48 +08:00
}