1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4 <title>MCTX3420 Web Interface</title>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7 <script language="javascript" type="text/javascript" src="static/excanvas.min.js"></script>
9 <script type="text/javascript" src="static/jquery-1.10.1.min.js"></script>
10 <script type="text/javascript" src="static/jquery.flot.min.js"></script>
11 <script type="text/javascript" src="static/base64.js"></script>
12 <script type="text/javascript" src="static/mctx.gui.js"></script>
13 <script type="text/javascript" src="static/mctx.pintest.js"></script>
15 <link rel="stylesheet" type="text/css" href="static/style.css">
16 <link rel="stylesheet" type="text/css" href="static/nav-menu.css">
17 <script type="text/javascript">
18 runBeforeLoad().done(function () {
19 //Ensure stuff is unloaded before leaving the page
20 $(window).unload(function(){
21 $("#adc-controls").find("input[type='checkbox']")
23 if ($(this).is(":checked")) {
24 $(this).trigger("click");
27 $("#gpio-container").find("input[name='unexport']")
29 $(this).trigger("click");
31 $("#pwm-container").find("input[name='unexport']")
33 $(this).trigger("click");
37 $(document).ready(function () {
39 var name = " " + (mctx.friendlyName ? mctx.friendlyName : "");
40 $("#welcome-container").text("Welcome"+ name + "!");
41 $("#content").css("display", "block");
43 $("#logout").click(function () {
44 $("#logout").logout();
47 $("#gpio-menu").populateDropdown(mctx.pintest.gpios, "GPIO ");
48 $("#pwm-menu").populateDropdown(mctx.pintest.pwms, "PWM ");
50 $("#gpio-go").click(function () {
51 if ($("#gpio-menu").val()) {
52 $(this).attr("disabled", true);
53 $("#gpio-container").exportGPIO($("#gpio-menu")).always(function () {
54 $("#gpio-go").attr("disabled", false);
58 $("#pwm-go").click(function () {
59 if ($("#pwm-menu").val()) {
60 $(this).attr("disabled", true);
61 $("#pwm-container").exportPWM($("#pwm-menu")).always(function () {
62 $("#pwm-go").attr("disabled", false);
66 $("#adc-controls").trigger("reset").setADCControl();
68 $("#errorlog").setErrorLog();
78 <a href="http://www.uwa.edu.au/" target="_blank">
79 <img alt = "The University of Western Australia"
80 src="static/uwacrest-text.png">
82 <span id="title">BBB Pin test (debug only)</span>
85 <div id="menu-container" class="nav-menu">
87 <span id="welcome-container">
90 <script type="text/javascript">getDate();</script>
92 <div id="logout-container">
95 <input type="button" id="logout" value="Logout">
100 <div class="clear"></div>
107 <div class="title">Info</div>
108 <p>This test page gives control over the BBB's pins.
109 Select a pin that you wish to use from the relevant drop-down
110 menu and click 'Go'.</p>
111 <p>A new widget will appear with controls relevant to that pin.</p>
112 <p>Make sure to check the error log to see if something goes wrong.</p>
115 <div class="title">Pin out diagram</div>
116 <p>To see the pin out diagram of the BBB, click <a href="pinout-table.pdf" target="_blank">here</a>.</p>
119 <div class="title">Export/Unexport?</div>
121 To export/unexport a pin means to enable/disable it. Apart from the obvious
122 use case, sometimes this can be required if you use two PWM channels
123 that share the same frequency base.
126 You won't be able to change
127 the frequency until you unexport one of them.
131 <div class="title">PWM explained</div>
132 <p>The frequency must be a decimal number greater than 0.</p>
134 The duty cycle describes the proportion of off/on time per period.
135 This number is specified as a ratio, with values ranging from 0 to 1.
138 The polarity determines if the duty represents the 'active
139 high' or 'active low' portion. By default, the duty cycle
140 represents the 'active high' portion.
148 <div class="title">Dashboard</div>
152 GPIO <select id="gpio-menu"></select>
153 <input type="button" id="gpio-go" value="Go">
156 PWM <select id="pwm-menu"></select>
157 <input type="button" id="pwm-go" value="Go">
162 <div class="sub-title">Error log</div>
163 <textarea id="errorlog" wrap="off" rows="4" cols="30" readonly></textarea>
167 <div class="title">Analogue input (ADC)</div>
168 <form class="controls" action="#" id="adc-controls">
169 <table class="centre">
171 <td>AIN</td><th>0</th><th>1</th><th>2</th><th>3</th>
172 <th>4</th><th>5</th><th>6</th><th>7</th>
176 <td><input name="0" type="text" readonly></td>
177 <td><input name="1" type="text" readonly></td>
178 <td><input name="2" type="text" readonly></td>
179 <td><input name="3" type="text" readonly></td>
180 <td><input name="4" type="text" readonly></td>
181 <td><input name="5" type="text" readonly></td>
182 <td><input name="6" type="text" readonly></td>
183 <td><input name="7" type="text" readonly></td>
187 <td><input name="0" type="checkbox"></td>
188 <td><input name="1" type="checkbox"></td>
189 <td><input name="2" type="checkbox"></td>
190 <td><input name="3" type="checkbox"></td>
191 <td><input name="4" type="checkbox"></td>
192 <td><input name="5" type="checkbox"></td>
193 <td><input name="6" type="checkbox"></td>
194 <td><input name="7" type="checkbox"></td>
200 <div class="widget" id="gpio-container">
201 <div class="title">GPIO controls</div>
204 <div class="widget" id="pwm-container">
205 <div class="title">PWM controls</div>
208 <!-- End main content -->