Web edits
[beagleboard.org.git] / db / 2127.xml
blob4839729fb9f5013e1b02af77a827ddcb5ab1b46f
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <?xml-stylesheet type="text/xsl" href="helma.xsl"?>
3 <xmlroot xmlns:hop="http://www.helma.org/docs/guide/features/database">
4   <hopobject id="2127" name="Bonelib" prototype="Page" created="1349110534079" lastModified="1395701016976">
5   <hop:parent idref="20" prototyperef="Page"/>
6     <is_xhtml type="boolean">true</is_xhtml>
7     <http_remotehost>127.0.0.1</http_remotehost>
8     <pname>C++ and PERL Hardware Abstraction Library</pname>
9     <registrant>janick-bergeron.myopenid.com</registrant>
10     <http_language>en-US,en;q=0.8</http_language>
11     <uri>Bonelib</uri>
12     <http_browser>Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4</http_browser>
13     <time type="date">03.10.2012 10:01:43 CDT</time>
14     <updatetime type="date">01.10.2012 11:55:34 CDT</updatetime>
15     <hopsession>127.0.0.198.182.56.a8rz94jxxaah</hopsession>
16     <body>For example, to use pin P8[3] as an input with a pull-down, you normally have to:
17 &lt;p&gt;
18 &lt;ul&gt;
19 &lt;li&gt;Look up the BeagleBone System Reference Manual and determine that pin 3 on connector P8 corresponds to GPIO1[6]
20 &lt;li&gt;Set the pin muxing to mode 7 + input + pull-down by writing 007 to /sys/kernel/debug/omap_mux/gpmac_ad6
21 &lt;li&gt;Export the GPIO system files by writing 38 to /sys/class/gpio (btw, &quot;38&quot; does not come from P8[3], but from 1*32+6).
22 &lt;li&gt;Set the GPIO to input by writing &quot;in&quot; to /sys/class/gpio/gpio38/direction
23 &lt;li&gt;Sample the input by reading /sys/class/gpio/gpio38/value
24 &lt;/ul&gt;
25 &lt;p&gt;
26 Still with me? Bonelib makes it as simple as:
27 &lt;p&gt;
28 &lt;pre&gt;BeagleBone::gpio* inp = BeagleBone::gpio::P8(3);
29 inp-&gt;configure(BeagleBone::pin::IN, BeagleBone::pin::PD);
31 unsigned char val = inp-&gt;get();&lt;/pre&gt;
32 &lt;p&gt;
33 voila!
34 &lt;p&gt;
35 Find the full user documentation at http://sourceforge.net/p/bonelib/wiki/Home/</body>
36     <pseudoparent idref="20" prototyperef="Page"/>
37     <rssfeed></rssfeed>
38     <pvcount type="float">1.0</pvcount>
39     <homepage>https://sourceforge.net/projects/bonelib/</homepage>
40     <render_skin>project</render_skin>
41     <edit_skin>edit_project</edit_skin>
42     <http_referer>http://beagleboard.org/project/Bonelib/edit</http_referer>
43     <http_host>beagleboard.org</http_host>
44     <errmsg></errmsg>
45     <shortdesc>Library of C++/PERL objects providing a high-level abstraction of the BeagleBone peripherals</shortdesc>
46     <user>janick-bergeron.myopenid.com</user>
47   </hopobject>
48 </xmlroot>