Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docs:techref:hardware:port.gpio [2022/01/31 18:40] – [Pin Multiplexing] fix code danitooldocs:techref:hardware:port.gpio [2023/07/20 01:47] (current) – Add info box about gpiod-tools, gpio sysfs has been marked obsolete and won't work correctly djfe
Line 56: Line 56:
  
 ===== Software ===== ===== Software =====
 +<WRAP round info 100%>
 +**The GPIO SYSFS interface has been marked as obsolete in 2015. I couldn't get the following scripts to work. This page needs an overhaul.**
 +
 +The new interface is the linux GPIO character device. One way to access it is [[https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/tree/README|libgpiod]].
 +
 +You can install it with the [[:packages:pkgdata:gpiod-tools]] package like this:
 +
 +<code bash>opkg update
 +opkg install gpiod-tools</code>
 +
 +A good article on how to use the new CLI and why we should move on: [[https://www.thegoodpenguin.co.uk/blog/stop-using-sys-class-gpio-its-deprecated/|Stop using /sys/class/gpio – it’s deprecated]]
 +
 +The biggest differences are:
 +  * The new interface isn't stateless like the old one. Processes are able to take exclusive control over a gpio line now
 +  * There is a character device /dev/gpiochipX for each gpio chip found in the system
 +  * TODO
 +As I said: This page needs an overhaul. This info box is just to prevent people from wasting their time on a deprecated ABI.
 +</WRAP>
 +
 In linux GPIOs can be accessed through GPIO SYSFS interface: **/sys/class/gpio/** In linux GPIOs can be accessed through GPIO SYSFS interface: **/sys/class/gpio/**
  
Line 329: Line 348:
   - Compare the changed GPIO value which corresponding to the button held   - Compare the changed GPIO value which corresponding to the button held
 ===== Links ===== ===== Links =====
-  * [[http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/gpio|Kernel gpio documentation]]+  * [[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/driver-api/gpio|Kernel gpio documentation]]
   * [[http://www.mjmwired.net/kernel/Documentation/gpio.txt|other kernel gpio doc]]   * [[http://www.mjmwired.net/kernel/Documentation/gpio.txt|other kernel gpio doc]]
  
  • Last modified: 2022/01/31 18:40
  • by danitool