gpio: userspace tools

Mayur Nande mayur.nan at gmail.com
Mon Sep 3 11:58:33 EDT 2018


On Fri, Aug 31, 2018 at 8:32 AM Subhashini Rao Beerisetty
<subhashbeerisetty at gmail.com> wrote:
>
> Hi All,
>
>
> I’m using v4.4 kernel and I see that gpiochipN are created under /sys/class/gpio. Latest kernel has three tools lsgpio, gpio-hammer and gpio-
> event-mon, all these tools opens the device node under /dev/gpiochipN. Does v4.4 kernel has any similar tools to control GPIO pins by using
> /sys/class/gpio/gpiochipN?
There are no tools available within the kernel source for the
deprecated sysfs interface.

> If not, can someone point me how the GPIO pins were controlled in the older kernel(which supports /sys/class/gpio)?
Google around, you will find a lot of examples to access gpios from
userspace. Here are some good references:
https://github.com/jackmitch/libsoc
https://github.com/Linutronix/libgpio
https://github.com/animalcreek/libgpio
https://developer.ridgerun.com/wiki/index.php/Gpio-int-test.c

It is also straight forward to write your own small interface/library,
although I would recommend using one of the above.
HTH.

Regards
Mayur
>
>
> Thanks
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



More information about the Kernelnewbies mailing list