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="2563" name="getPinMode" prototype="Page" created="1367624660103" lastModified="1372253114447">
5 <hop:parent idref="2471" prototyperef="Page"/>
6 <is_xhtml type="boolean">true</is_xhtml>
7 <http_remotehost>127.0.0.1</http_remotehost>
8 <http_language>en-US,en;q=0.8</http_language>
10 <http_browser>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36</http_browser>
11 <time type="date">26.06.2013 08:25:14 CDT</time>
12 <hopsession>127.0.0.12.7.236.1tmoumlyxjrzy</hopsession>
13 <body><script src="/static/bonescript-demo.js"></script>
\r
14 <div id='side-menu' class="t3_sidebar">
\r
15 <ul class="left-menu"><strong>Navigation</strong>
\r
16 <li><a href="/static/side-menu.html">Menu contents</a></li>
\r
19 <div class="t3_content_1"><div id='connect-status'></div><div id="content_child">
\r
20 <h1>getPinMode(pin, [callback])</h1>
\r
21 <p>Get the mode of a pin.</p>
\r
22 <h2>Arguments</h2>
\r
24 <li><em>pin</em>: the <a href="bonescript#pin">BeagleBone pin</a> identifier</li>
\r
25 <li><em>callback</em>: called upon completion</li>
\r
27 <h2>Return value</h2>
\r
29 <li><em>mux</em>: index of mux mode</li>
\r
30 <li><em>options</em>: array of mode names</li>
\r
31 <li><em>slew</em>: 'fast' or 'slow'</li>
\r
32 <li><em>rx</em>: 'enabled' or 'disabled'</li>
\r
33 <li><em>pullup</em>: 'diabled', 'pullup' or 'pulldown'</li>
\r
34 <li><em>pin</em>: key string for pin</li>
\r
35 <li><em>name</em>: pin name</li>
\r
36 <li><em>err</em>: error status message</li>
\r
38 <h2>callback(x)</h2>
\r
40 <li><em>x</em>: return value</li>
\r
43 <button class="dynlink" onclick="demoRun('code')">run</button>
\r
44 <button class="dynlink" onclick="demoRestore('code')">restore</button>
\r
46 <pre id="code" class="use-editor" style="height: 230px;">
\r
47 var b = require('bonescript');
\r
48 b.getPinMode("P8_13", printPinMux);
\r
49 function printPinMux(x) {
\r
50 console.log('mux = ' + x.mux);
\r
51 console.log('pullup = ' + x.pullup);
\r
52 console.log('slew = ' + x.slew);
\r
54 console.log('options = ' +
\r
55 x.options.join(','));
\r
56 console.log('pin = ' + x.pin);
\r
57 console.log('name = ' + x.name);
\r
58 console.log('err = ' + x.err);
\r
60 <div readonly id="console-output" style="height: 200px;"></div>
\r
61 <h2>Build and execute instructions</h2>
\r
63 <li>Check out some of the other examples to see and verify
\r
64 getPinMode functionality.</li>
\r
66 <h2>See also</h2>
\r
67 <h3>Topics</h3>
\r
69 <li><a href="/Support/BoneScript/#headers">BeagleBone expansion headers</a></li>
\r
70 <li><a href="/Support/BoneScript/#digitalio">Digital I/O</a></li>
\r
72 <h3>Related functions</h3>
\r
74 <li><a href="/Support/BoneScript/#require">require</a></li>
\r
75 <li><a href="/Support/BoneScript/pinMode">pinMode</a></li>
\r
78 <h3>Examples</h3>
\r
80 <li><a href="/Support/BoneScript/demo_attachedCapes">Show attached capes</a></li>
\r
83 </div></div><div style="clear: both;"></div></body>
84 <pseudoparent idref="2471" prototyperef="Page"/>
85 <http_referer>http://beagleboard.org/support/BoneScript/getPinMode/edit</http_referer>
86 <http_host>beagleboard.org</http_host>
87 <user>jkridner@gmail.com</user>