Open
Description
Linux kernel gpio subsystem maintainer Linus Walleij presented GPIO descriptors in this presentation:
- Video: GPIO for Engineers and Makers
- Slides: GPIO for Engineers and Makers
Linus W. details kernel-external API changes:
/sys/class/gpio
sysfs interface is marked as deprecated- new character device
/sys/bus/gpiochipN
or/dev/gpiochipN
Linus W. emphasized these points:
The Rules of Linux Userspace GPIO
- You do not access GPIOs from userspace
- YOU DO NOT ACCESS GPIOS FROM USERSPACE
- Read Documentation/gpio/drivers-on-gpio.txt
- Use the character device
Features the Character Device Has
- Discovery mechanism (not magic numbers)
- Cleanup of resources on closing or crashing
- Open Drain / Open Source
- Get and set multiple lines at once
- Good examples: tools/gpio/*Features the Character Device Has
- Discovery mechanism (not magic numbers)
- Cleanup of resources on closing or crashing
- Open Drain / Open Source
- Get and set multiple lines at once
- Good examples: tools/gpio/*