embarassingly, this is not getting picked up. try one more time. so we have gpio Reference: /n/atom/patch/applied/pigpio Date: Sun Jan 10 20:03:43 CET 2016 Signed-off-by: quanstro@quanstro.net --- /sys/src/9/bcm/gpio.c Thu Jan 1 00:00:00 1970 +++ /sys/src/9/bcm/gpio.c Sun Jan 10 20:03:33 2016 @@ -0,0 +1,95 @@ +/* + * Raspberry Pi GPIO support + */ + +#include "u.h" +#include "../port/lib.h" +#include "../port/error.h" +#include "mem.h" +#include "dat.h" +#include "fns.h" +#include "io.h" + +#define GPIOREGS (VIRTIO+0x200000) + +/* GPIO regs */ +enum { + Fsel0 = 0x00>>2, + FuncMask= 0x7, + Set0 = 0x1c>>2, + Clr0 = 0x28>>2, + Lev0 = 0x34>>2, + PUD = 0x94>>2, + Off = 0x0, + Pulldown= 0x1, + Pullup = 0x2, + PUDclk0 = 0x98>>2, + PUDclk1 = 0x9c>>2, +}; + +void +gpiosel(uint pin, int func) +{ + u32int *gp, *fsel; + int off; + + gp = (u32int*)GPIOREGS; + fsel = &gp[Fsel0 + pin/10]; + off = (pin % 10) * 3; + *fsel = (*fsel & ~(FuncMask<