<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Gpio on Lloyd Rochester's Geek Blog</title><link>https://lloydroc.github.io/tags/gpio/</link><description>Recent content in Gpio on Lloyd Rochester's Geek Blog</description><generator>Hugo</generator><language>en</language><copyright>Copyright © 2025, Lloyd Rochester.</copyright><lastBuildDate>Mon, 17 May 2021 00:00:00 +0000</lastBuildDate><atom:link href="https://lloydroc.github.io/tags/gpio/index.xml" rel="self" type="application/rss+xml"/><item><title>Using libgpiod to detect input events</title><link>https://lloydroc.github.io/post/hardware/libgpiod-event-rpi/</link><pubDate>Mon, 17 May 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/libgpiod-event-rpi/</guid><description>&lt;h1 id="hahahugoshortcode61s0hbhb">Using libgpiod to detect input events&lt;/h1>
&lt;p>One of the most fundamental requirements for GPIO is the ability to execute user defined code when an &lt;em>external event&lt;/em> has happened. This is typically done when a GPIO pin, configured as an input, changes from high-to-low, or low-to-high. In this case we detect on the falling edge or rising edge of this pin change. For example a sensor we communicate through GPIO has data ready. In the micro-controller world this is called as an interrupt where the CPU will change it program counter and handle the interrupt. The interrupt makes sense when we have no Operating System. In the case of Linux and the Raspberry Pi it&amp;rsquo;s not an interrupt but considered an &lt;em>event&lt;/em> as we likely have in interrupt deep inside the kernel code, however, we&amp;rsquo;re several levels of abstraction past this. Unix has the &amp;ldquo;Universal File Model&amp;rdquo; so this input pin is mapped to a file. With Unix we have many multiple ways to know if &amp;ldquo;events&amp;rdquo; have happened to this file. Examples of events are that the file is ready for reading, writing, or other events have happened.&lt;/p></description></item><item><title>The new GPIO Interface on the Raspberry PI: libgpiod</title><link>https://lloydroc.github.io/post/hardware/libgpiod-intro-rpi/</link><pubDate>Sun, 02 May 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/libgpiod-intro-rpi/</guid><description>&lt;h1 id="hahahugoshortcode64s0hbhb">The new GPIO Interface on the Raspberry PI: libgpiod&lt;/h1>
&lt;p>Allegedly, The &lt;a href="https://www.kernel.org/doc/html/latest/admin-guide/gpio/sysfs.html">GPIO Sysfs Interface&lt;/a> is deprecated. The deprecated Sysfs would interact with GPIO using the &lt;code>/sys/class/gpio&lt;/code> pseudo-filesytem. The Application Binary Interface - ABI - provides a character device based device driver and tools. The ABI is the new way to interact with GPIO on the Raspberry Pi. I really don&amp;rsquo;t like the name ABI, as it&amp;rsquo;s WAY too generic of a name. Rather, I believe the proper name for this project is &lt;code>libgpiod&lt;/code>.&lt;/p></description></item></channel></rss>