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
blog:gpio_on_arch_linux_arm_for_raspberry_pi_3_aarch64 [2019/02/10 04:34]
sam [Talking to GPIO]
blog:gpio_on_arch_linux_arm_for_raspberry_pi_3_aarch64 [2019/02/12 21:33] (current)
sam
Line 13: Line 13:
 I started looking at fixing the library, but the work required was large enough that just polling the sysfs system started to look like the lazier method after all, when lo and behold: [[https://​www.kernel.org/​doc/​Documentation/​gpio/​sysfs.txt|sysfs for gpio]] is deprecated and is being [[https://​github.com/​rust-embedded/​rust-sysfs-gpio/​issues/​38|removed next year]]. ​ In it's place is GPIO chips as a character device. ​  ​That'​s nice, but how to I talk to it? I started looking at fixing the library, but the work required was large enough that just polling the sysfs system started to look like the lazier method after all, when lo and behold: [[https://​www.kernel.org/​doc/​Documentation/​gpio/​sysfs.txt|sysfs for gpio]] is deprecated and is being [[https://​github.com/​rust-embedded/​rust-sysfs-gpio/​issues/​38|removed next year]]. ​ In it's place is GPIO chips as a character device. ​  ​That'​s nice, but how to I talk to it?
  
-That's the good part.   ​Apparently,​ the preferred way to talk to it is with a library called [[https://​git.kernel.org/​pub/​scm/​libs/​libgpiod/​libgpiod.git/​|libgpiod]],​ which stands for (lib) GPIO Device, and isn't some weird sort of library/​daemon stunt like one finds in libvirtd. ​  ​It's apparently super easy to talk to, but it's really new, was only recently accepted as a kernel project, and is still evolving. ​  Also, not much in the way of documentation as I've been able to find.  Even so, it's in  +That's the good part.   ​Apparently,​ the preferred way to talk to it is with a library called [[https://​git.kernel.org/​pub/​scm/​libs/​libgpiod/​libgpiod.git/​|libgpiod]],​ which stands for (lib) GPIO Device, and isn't some weird sort of library/​daemon stunt like one finds in libvirtd. ​ It is already in  
-[[https://​aur.archlinux.org/​packages/​libgpiod-git/​|AUR]] so installing it was dead simple.+[[https://​aur.archlinux.org/​packages/​libgpiod-git/​|AUR]] so installing it was dead simple.  ​It's apparently super easy to talk to, but it's really new, was only recently accepted as a kernel project, and is still evolving. ​  Also, not much in the way of documentation as I've been able to find. 
  
-Well, except for [[https://​framagit.org/​cpb/​example-programs-using-libgpiod|these examples]] I found. ​  They make it pretty clear that libgpiod is pretty easy to use.   Shame I don't speak French.+Well, except for [[https://​framagit.org/​cpb/​example-programs-using-libgpiod|these examples]] I found. ​  They make it pretty clear that libgpiod is pretty easy to use.   Shame I don't speak French.  Also the header files turned out to be pretty well documented.
  
 ===== Pull me Up, Pull me Down ===== ===== Pull me Up, Pull me Down =====
Line 33: Line 33:
  
 It comes from [[https://​docs.microsoft.com/​en-us/​windows/​iot-core/​learn-about-hardware/​pinmappings/​pinmappingsrpi|Microsoft]],​ of all places. It comes from [[https://​docs.microsoft.com/​en-us/​windows/​iot-core/​learn-about-hardware/​pinmappings/​pinmappingsrpi|Microsoft]],​ of all places.
 +
 +
 +===== Notes to Self =====
 +
 +  * For whatever reason, XFS doesn'​t work well on an RPi with an SD card.