A quick Google search leads me to How to Control GPIO Hardware from C or C++ | ICS, which tells me that the GPIO pins are simply controlled through the filesystem. Translating the code there gives something like below. Not tested (I have a Pi, but nothing
to connect to the GPIO pins directly ready ).
open('/sys/class/gpio/export', write, Out1),
open('/sys/class/gpio24/direction', write, Out2),
open('/sys/class/gpio/gpio24/value', write, Out3),
blink(N, Out) :-
N > 0,
N2 is N - 1,