{"id":56,"date":"2013-03-26T14:34:07","date_gmt":"2013-03-26T14:34:07","guid":{"rendered":"http:\/\/nofl.biz\/blog\/?p=56"},"modified":"2013-03-26T14:34:07","modified_gmt":"2013-03-26T14:34:07","slug":"raspberry-pi-rgpio","status":"publish","type":"post","link":"https:\/\/beneford.com\/Blog\/index.php\/2013\/03\/26\/raspberry-pi-rgpio\/","title":{"rendered":"Raspberry Pi &#8211; RGPIO"},"content":{"rendered":"<div>RGPIO is a Raspberry Pi installable module that provides a device driver interface GPIO (General Purpose Input\/Output).<\/div>\n<h2>Installing RGPIO<\/h2>\n<div>Put\u00a0<a title=\"RGPIO\" href=\"http:\/\/nofl.biz\/available\/rgpio.ko\">rgpio.ko<\/a> in \/lib\/modules\/3.6.11+\/kernel\/drivers\/rgpio<\/div>\n<div>Add rgpio to the list of modules to load at startup in \/etc\/modules<\/div>\n<div>Run depmod to update modprobe&#8217;s list of module dependencies.<\/div>\n<h2>What RGPIO looks like<\/h2>\n<p>RGPIO creates a device: \/dev\/rgpio<\/p>\n<p>This device is a character mode device that you can write text strings to and read text strings from. These strings tell RGPIO what to do, and tell you what RGPIO has found.<\/p>\n<p>For testing, it is useful to set up a small script &#8211; I call it p containing:<\/p>\n<pre>[ -c \/dev\/rgpio ] &amp;&amp; echo $@ &gt; \/dev\/rgpio &amp;&amp; cat - &lt; \/dev\/rgpio<\/pre>\n<p>([ -c \/dev\/rgpio ] stops anything being written to a non-existent device.)<\/p>\n<p>Then you can use rgpio by entering commands as follows, and the output will be shown immediately:<\/p>\n<pre>user@rpi:\/home\/me# .\/p P14R\nRGPIO 14:on<\/pre>\n<p>Help is built in:<\/p>\n<pre>user@rpi:\/home\/me# .\/p H\n{P|O|I|W|L}     set mode: PIN,One-wire,I2C,PWM,LCD\n?               show Help\npidS            Sending SIGIO to process when new output is added (pid=0 to cancel)\n{P|O|I|W|L}?    show Help for each mode\n                #,% can be decimal, 0x Hex or 0b Binary<\/pre>\n<h2>RGPIO Modes<\/h2>\n<p><strong><a title=\"RGPIO Port handling\" href=\"http:\/\/nofl.biz\/blog\/?p=59\">P mode<\/a><\/strong>:\u00a0control the individual GPIO pins. This includes reading from and writing (Lo or Hi) to the pin, watching for changes in the read-state, and setting the internal pull-ups for each pin.<\/p>\n<p><strong>W mode<\/strong>: PWM control &#8211; hardware (on Raspberry Pi, this is only on pin 18) or software modes.<\/p>\n<p><strong><a title=\"RGPIO \u2013 LCD Screens\" href=\"http:\/\/nofl.biz\/blog\/?p=63\">L mode<\/a><\/strong>: control a parallel character LCD device<\/p>\n<p><strong>I mode<\/strong>: seek, query and control I2C devices<\/p>\n<p><strong>O mode<\/strong>: seek, query and control 1-Wire devices<\/p>\n<p>Here are some Python examples using <a title=\"RGPIO and PiBoard\" href=\"http:\/\/nofl.biz\/blog\/?p=79\">RGPIO on the PiBoard<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>RGPIO is a Raspberry Pi installable module that provides a device driver interface GPIO (General Purpose Input\/Output). Installing RGPIO Put\u00a0rgpio.ko in \/lib\/modules\/3.6.11+\/kernel\/drivers\/rgpio Add rgpio to the list of modules to load at startup in \/etc\/modules Run depmod to update modprobe&#8217;s list of module dependencies. What RGPIO looks like RGPIO creates a device: \/dev\/rgpio This device [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,5],"tags":[],"class_list":["post-56","post","type-post","status-publish","format-standard","hentry","category-raspberry-pi","category-rgpio"],"_links":{"self":[{"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/posts\/56","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/comments?post=56"}],"version-history":[{"count":0,"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/posts\/56\/revisions"}],"wp:attachment":[{"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/media?parent=56"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/categories?post=56"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/tags?post=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}