0

I am writing GPIO functions in C using standard libraries that come with the raspberry pi, and do not require installing other libraries such as wiringpi.

So I have been using stdlib.h and stdio.h, and writing, and reading the files that describe each GPIO pin using the sysfs interface. I'm just wondering if there are any other standard library interfaces for the raspberry pi i should know about.

j0h
  • 2,473
  • 6
  • 25
  • 34
  • Maybe relevant: http://raspberrypi.stackexchange.com/q/41014/5538 The linux kernel interface (sysfs) is language agnostic by design; as per that Q&A implementing something language specific is trivial and so you may or may not find various things around -- which of course would require "installing other libraries". However, since there is no C standard which specifies a GPIO interface, pretty much by definition the answer here has to be no, there are only the add-on libraries. – goldilocks Sep 27 '16 at 13:53

2 Answers2

3

The sysfs system filesystem access to the GPIO is all that is provided as a standard library from Linux.

There are dozens of third party libraries.

See http://elinux.org/RPi_GPIO_Code_Samples for some of the third party libraries.

joan
  • 71,024
  • 5
  • 73
  • 106
1

AFAIK WiringPi should be included in latest Raspbian. If you have the gpio utility it is there (as gpio is a WiringPi utility).

Milliways
  • 59,890
  • 31
  • 101
  • 209