dgpio is a tiny GPIO control library for all linux single board computers in D language.
git clone https://github.com/ozanselte/dgpio.git
cd dgpio
# with dub
sudo dub
# with dmd
cd sources
dmd -lib dgpio.d -oflibdgpio.a
# with gdc
cd sources
gdc -c -o dgpio.o dgpio.d
ar rsc libdgpio.a dgpio.o
import dgpio;
GPIO gpio = new GPIO(17);
gpio.setInput();
bool gpioHigh = gpio.isHigh();
bool gpioLow = gpio.isLow();
assert(gpio.isHigh() != gpio.isLow());
gpio.setOutput();
gpio.setHigh();
assert(gpio.isHigh() == true);
gpio.setLow();
assert(gpio.isHigh() == false);
ubyte gpioPin = gpio.gpio;
bool isInput = gpio.isInput();
bool isOutput = gpio.isOutput();
gpio.deactivate();