{"id":59,"date":"2013-03-26T15:16:35","date_gmt":"2013-03-26T15:16:35","guid":{"rendered":"http:\/\/nofl.biz\/blog\/?p=59"},"modified":"2013-03-26T15:16:35","modified_gmt":"2013-03-26T15:16:35","slug":"rgpio-port-handling","status":"publish","type":"post","link":"https:\/\/beneford.com\/Blog\/index.php\/2013\/03\/26\/rgpio-port-handling\/","title":{"rendered":"RGPIO Port handling"},"content":{"rendered":"<p>RGPIO commands for simple ports (P-mode)\u00a0are:<\/p>\n<table>\n<tbody>\n<tr>\n<th align=\"left\">Command<\/th>\n<th align=\"left\">Comment<\/th>\n<th align=\"left\">Example<\/th>\n<\/tr>\n<tr>\n<td>P&lt;port&gt;+<\/td>\n<td>Set port Hi (turn it on)<\/td>\n<td>P4+<\/td>\n<\/tr>\n<tr>\n<td>P&lt;port&gt;-<\/td>\n<td>Set port Lo (turn it off)<\/td>\n<td>P11-<\/td>\n<\/tr>\n<tr>\n<td>P&lt;port&gt;R<\/td>\n<td>Set port input and read value<\/td>\n<td>P0x12R<\/td>\n<\/tr>\n<tr>\n<td>P[n,]&lt;port&gt;L<\/td>\n<td>Report when\u00a0port goes Lo<br \/>\nCache n events &#8211; default=0,\u00a0report once only.<\/td>\n<td>P8L<\/td>\n<\/tr>\n<tr>\n<td>P[n,]&lt;port&gt;H<\/td>\n<td>Report when port goes Hi<br \/>\nCache n events &#8211; default=0, report once only.<\/td>\n<td>P2,8H<\/td>\n<\/tr>\n<tr>\n<td>P[n,]&lt;port&gt;L<\/td>\n<td>Report when port changes<br \/>\nCache n events &#8211; default=1; if n=0, once only.<\/td>\n<td>P0,8C<\/td>\n<\/tr>\n<tr>\n<td>P&lt;port&gt;l<\/td>\n<td>Set port Hi and time how long before it goes Lo<\/td>\n<td>P8l<\/td>\n<\/tr>\n<tr>\n<td>P&lt;port&gt;h<\/td>\n<td>Set port Lo and time how long before it goes Hi<\/td>\n<td>P8l<\/td>\n<\/tr>\n<tr>\n<td>P&lt;port&gt;U<\/td>\n<td>Turn on the internal pullup on the port<\/td>\n<td>P8U<\/td>\n<\/tr>\n<tr>\n<td>P&lt;port&gt;u<\/td>\n<td>Turn off the internal pullup on the port<\/td>\n<td>P8u<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<th align=\"left\">Command<\/th>\n<th align=\"left\">Response<\/th>\n<\/tr>\n<tr>\n<td>P4R<\/td>\n<td>P4:on<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\">This reports the current state of the port.<\/td>\n<\/tr>\n<tr>\n<td>P8L<\/td>\n<td>E8:off 2013\/03\/15 14:21:35 (812355433)<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\">After an L command is sent, RGPIO watches for the port to change (using a hardware interrupt). The output will be available after the event has occured. The output can be pollled for, or a signal can be set. The output indicates the port, and state, the time and an incrementing timestamp for the event.<\/td>\n<\/tr>\n<tr>\n<td>P7h<\/td>\n<td>E7:on  t=56000<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\">After an h command is sent, RGPIO sets the port Lo and then times how long (in nanoseconds) it takes for the port to go Hi. The output can be pollled for, or a signal can be set. The output indicates the port, and state, the elapsed time.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>RGPIO commands for simple ports (P-mode)\u00a0are: Command Comment Example P&lt;port&gt;+ Set port Hi (turn it on) P4+ P&lt;port&gt;- Set port Lo (turn it off) P11- P&lt;port&gt;R Set port input and read value P0x12R P[n,]&lt;port&gt;L Report when\u00a0port goes Lo Cache n events &#8211; default=0,\u00a0report once only. P8L P[n,]&lt;port&gt;H Report when port goes Hi Cache n events [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,4,5,1],"tags":[],"class_list":["post-59","post","type-post","status-publish","format-standard","hentry","category-linux","category-raspberry-pi","category-rgpio","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/posts\/59","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=59"}],"version-history":[{"count":0,"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/posts\/59\/revisions"}],"wp:attachment":[{"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/media?parent=59"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/categories?post=59"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/tags?post=59"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}