Hi Daniel,
Pls. refer the links below to control the GPIO using C :
http://41j.com/blog/2011/09/beagleboard-gpio-input-driverless/
https://github.com/majestik666/Beagle_GPIO
Here, the approach is to control the gpio by mapping the registers using mmap. But, the ideal approach would be to write the gpio driver & control the gpios from the application using the device file. I am planning to write the one and will share it once it is done.
Regards,
Pradeep