Commit d0ff511e authored by Marcus Greiff's avatar Marcus Greiff

Checked the examples on a fresh installation

parent d2a47034
Pipeline #586 passed with stage
in 28 seconds
......@@ -20,7 +20,7 @@ body, input {
text-rendering: optimizeLegibility;
}
pre, code {
pre, code, kbd {
font-family: 'Roboto Mono', Monaco, courier, monospace;
font-size: 0.90em;
}
......@@ -46,15 +46,37 @@ body {
line-height: 1.5;
}
h1 { font-size: 1.75em; }
h2 { font-size: 1.50em; }
h3 { font-size: 1.25em; }
h1 {
font-size: 1.75em;
}
/* Unless the <h1> the is very first thing on the page (i.e. the second element
* in the <article>, * after the <header>, we add some additional styling to it
* to make it stand out a bit more. This way we get a reasonable fallback if CSS3
* selectors are not supported in the browser.
*/
article > h1:not(:nth-child(2)) {
margin: 2.5em 0 0;
padding-bottom: 0.30em;
border-bottom: 1px solid #e5e5e5;
}
h2 {
font-size: 1.50em;
margin: 2.3em 0 0;
padding-bottom: 0.25em;
border-bottom: 1px solid #e5e5e5;
}
h3 {
font-size: 1.25em;
margin: 2.0em 0 0;
}
h4 { font-size: 1.15em; }
h5 { font-size: 1.10em; }
h6 { font-size: 1em; }
h4, h5, h6 {
margin: 1em 0;
margin-top: 1.5em;
margin-bottom: 1em;
}
img {
......@@ -105,6 +127,20 @@ pre code {
background-color: initial;
}
kbd {
font-size: 0.70em;
display: inline-block;
padding: 0.1em 0.5em 0.4em 0.5em;
line-height: 1.0em;
color: #444d56;
vertical-align: middle;
background-color: #fafbfc;
border: solid 1px #c6cbd1;
border-bottom-color: #959da5;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #959da5;
}
/* Headers in admonitions and docstrings */
.admonition h1,
article section.docstring h1 {
......@@ -341,8 +377,8 @@ article section.docstring .docstring-category {
}
article section.docstring a.source-link {
float: left;
font-weight: bold;
display: block;
font-weight: bold;
}
.nav-anchor,
......
......@@ -38,29 +38,180 @@ parseUri.options = {
requirejs.config({
paths: {
'jquery': 'https://code.jquery.com/jquery-3.1.0.js?',
'lunr': 'https://cdnjs.cloudflare.com/ajax/libs/lunr.js/0.7.1/lunr.min',
'jquery': 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min',
'lunr': 'https://cdnjs.cloudflare.com/ajax/libs/lunr.js/2.1.3/lunr.min',
'lodash': 'https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min',
}
});
var currentScript = document.currentScript;
require(["jquery", "lunr"], function($, lunr) {
require(["jquery", "lunr", "lodash"], function($, lunr, _) {
$("#search-form").submit(function(e) {
e.preventDefault()
})
// list below is the lunr 2.1.3 list minus the intersect with names(Base)
// (all, any, get, in, is, which) and (do, else, for, let, where, while, with)
// ideally we'd just filter the original list but it's not available as a variable
lunr.stopWordFilter = lunr.generateStopWordFilter([
'a',
'able',
'about',
'across',
'after',
'almost',
'also',
'am',
'among',
'an',
'and',
'are',
'as',
'at',
'be',
'because',
'been',
'but',
'by',
'can',
'cannot',
'could',
'dear',
'did',
'does',
'either',
'ever',
'every',
'from',
'got',
'had',
'has',
'have',
'he',
'her',
'hers',
'him',
'his',
'how',
'however',
'i',
'if',
'into',
'it',
'its',
'just',
'least',
'like',
'likely',
'may',
'me',
'might',
'most',
'must',
'my',
'neither',
'no',
'nor',
'not',
'of',
'off',
'often',
'on',
'only',
'or',
'other',
'our',
'own',
'rather',
'said',
'say',
'says',
'she',
'should',
'since',
'so',
'some',
'than',
'that',
'the',
'their',
'them',
'then',
'there',
'these',
'they',
'this',
'tis',
'to',
'too',
'twas',
'us',
'wants',
'was',
'we',
'were',
'what',
'when',
'who',
'whom',
'why',
'will',
'would',
'yet',
'you',
'your'
])
// add . as a separator, because otherwise "title": "Documenter.Anchors.add!"
// would not find anything if searching for "add!", only for the entire qualification
lunr.tokenizer.separator = /[\s\-\.]+/
// custom trimmer that doesn't strip @ and !, which are used in julia macro and function names
lunr.trimmer = function (token) {
return token.update(function (s) {
return s.replace(/^[^a-zA-Z0-9@!]+/, '').replace(/[^a-zA-Z0-9@!]+$/, '')
})
}
lunr.Pipeline.registerFunction(lunr.stopWordFilter, 'juliaStopWordFilter')
lunr.Pipeline.registerFunction(lunr.trimmer, 'juliaTrimmer')
var index = lunr(function () {
this.ref('location')
this.field('title', {boost: 10})
this.field('title')
this.field('text')
documenterSearchIndex['docs'].forEach(function(e) {
this.add(e)
}, this)
})
var store = {}
documenterSearchIndex['docs'].forEach(function(e) {
index.add(e)
store[e.location] = e
store[e.location] = {title: e.title, category: e.category}
})
$(function(){
function update_search(query) {
results = index.search(query)
function update_search(querystring) {
tokens = lunr.tokenizer(querystring)
results = index.query(function (q) {
tokens.forEach(function (t) {
q.term(t.toString(), {
fields: ["title"],
boost: 10,
usePipeline: false,
editDistance: 2,
wildcard: lunr.Query.wildcard.NONE
})
q.term(t.toString(), {
fields: ["text"],
boost: 1,
usePipeline: true,
editDistance: 2,
wildcard: lunr.Query.wildcard.NONE
})
})
})
$('#search-info').text("Number of results: " + results.length)
$('#search-results').empty()
results.forEach(function(result) {
......@@ -75,15 +226,16 @@ require(["jquery", "lunr"], function($, lunr) {
}
function update_search_box() {
query = $('#search-query').val()
update_search(query)
querystring = $('#search-query').val()
update_search(querystring)
}
$('#search-query').keyup(update_search_box)
$('#search-query').keyup(_.debounce(update_search_box, 250))
$('#search-query').change(update_search_box)
search_query = parseUri(window.location).queryKey["q"]
if(search_query !== undefined) {
search_query_uri = parseUri(window.location).queryKey["q"]
if(search_query_uri !== undefined) {
search_query = decodeURIComponent(search_query_uri.replace(/\+/g, '%20'))
$("#search-query").val(search_query)
}
update_search_box();
......
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Examples on the BB · LabConnections</title><link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css" rel="stylesheet" type="text/css"/><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js" data-main="assets/documenter.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link href="assets/documenter.css" rel="stylesheet" type="text/css"/></head><body><nav class="toc"><h1>LabConnections</h1><select id="version-selector" onChange="window.location.href=this.value" style="visibility: hidden"></select><form class="search" id="search-form" action="search.html"><input id="search-query" name="q" type="text" placeholder="Search docs"/></form><ul><li><a class="toctext" href="index.html">LabConnections</a></li><li><a class="toctext" href="installation.html">Installation Instructions</a></li><li><a class="toctext" href="systemConfiguration.html">System Configuration (deprecated)</a></li><li><a class="toctext" href="testing.html">Tests</a></li><li class="current"><a class="toctext" href="examples.html">Examples on the BB</a><ul class="internal"><li><a class="toctext" href="#Example-with-LEDs-(BB)-1">Example with LEDs (BB)</a></li><li><a class="toctext" href="#Example-with-GPIOs-(BB)-1">Example with GPIOs (BB)</a></li><li><a class="toctext" href="#Example-with-PWM-(BB)-1">Example with PWM (BB)</a></li><li><a class="toctext" href="#Example-with-SPI-(BB)-1">Example with SPI (BB)</a></li><li><a class="toctext" href="#Example-with-LEDs-(HOST)-1">Example with LEDs (HOST)</a></li></ul></li></ul></nav><article id="docs"><header><nav><ul><li><a href="examples.html">Examples on the BB</a></li></ul><a class="edit-page" href="https://github.com//blob/master/docs/src/examples.md"><span class="fa"></span> Edit on GitHub</a></nav><hr/><div id="topbar"><span>Examples on the BB</span><a class="fa fa-bars" href="#"></a></div></header><h1><a class="nav-anchor" id="Examples-on-the-BB-1" href="#Examples-on-the-BB-1">Examples on the BB</a></h1><p>The following examples may be run from the BB, and may require the user to export the the LabConnections module to the LOAD_PATH manually, executing the following line in the Julia prompt</p><pre><code class="language-none">push!(LOAD_PATH, &quot;/home/debian/juliapackages&quot;)</code></pre><p>When running the examples with hardware in the loop, take caution not to short the BB ground with any output pin, as this will damage the board. For instance, if connecting a diode to the output pins, always use a resistor of &gt;1000 Ohm in parallel. See the configuration page for information on which functionality specific pins support.</p><ul><li><a href="examples.html#Examples-on-the-BB-1">Examples on the BB</a></li><ul><li><a href="examples.html#Example-with-LEDs-(BB)-1">Example with LEDs (BB)</a></li><li><a href="examples.html#Example-with-GPIOs-(BB)-1">Example with GPIOs (BB)</a></li><li><a href="examples.html#Example-with-PWM-(BB)-1">Example with PWM (BB)</a></li><li><a href="examples.html#Example-with-SPI-(BB)-1">Example with SPI (BB)</a></li><li><a href="examples.html#Example-with-LEDs-(HOST)-1">Example with LEDs (HOST)</a></li></ul></ul><h2><a class="nav-anchor" id="Example-with-LEDs-(BB)-1" href="#Example-with-LEDs-(BB)-1">Example with LEDs (BB)</a></h2><p>To test the system LED functionality of the Julia code from the BBB, open a Julia prompt and run the SYS_LED_test.jl file</p><pre><code class="language-none">include(&quot;/home/debian/juliapackages/LabConnections/test/BeagleBone/SYS_LED_test.jl&quot;)</code></pre><p>This example runs a test with hardware in the loop, exporting and unexporting the SYS_LED devices and blinking led D2-D5 in a sequence over 1 second, alternating with D2/D4 and D3/D5 on/off.</p><h2><a class="nav-anchor" id="Example-with-GPIOs-(BB)-1" href="#Example-with-GPIOs-(BB)-1">Example with GPIOs (BB)</a></h2><p>To test the GPIO functionality of the Julia code from the BBB, open a Julia prompt and run the GPIO_test.jl file</p><pre><code class="language-none">include(&quot;/home/debian/juliapackages/LabConnections/test/BeagleBone/GPIO_test.jl&quot;)</code></pre><p>This again runs the tests with the BBB in the loop, testing exception handling exporting of the file system and also runs all the GPIOs on the board high/low at a 0.1 period time over 1 second to demonstrate the IO communication visually.</p><h2><a class="nav-anchor" id="Example-with-PWM-(BB)-1" href="#Example-with-PWM-(BB)-1">Example with PWM (BB)</a></h2><p>To test the PWM functionality of the Julia code from the BBB, open a Julia prompt and run the PWM_test.jl file</p><pre><code class="language-none">include(&quot;/home/debian/juliapackages/LabConnections/test/BeagleBone/PWM_test.jl&quot;)</code></pre><p>This runs the PWM tests with the BBB in the loop, testing exception handling exporting of the file system. In addition, it runs all the PWM pins on the board with a duty cycle of 0.5 over a period time over 1 second to demonstrate the IO communication visually.</p><h2><a class="nav-anchor" id="Example-with-SPI-(BB)-1" href="#Example-with-SPI-(BB)-1">Example with SPI (BB)</a></h2><p>All development on the SPI is currently done in C in a for of the serbus package. Consequently, this example is currently run completely separate from the LabConnections.</p><p>Make sure that the serbus package exists in the /juliapackages/ directory, where it is automatically placed when transferring code to the BB using the ./flash_BB shell script. Then simply run</p><pre><code class="language-none">cp /home/debian/juliapackages/serbus/bb_spi.sh /home/debian</code></pre><p>and execute</p><pre><code class="language-none">./bb_spi.sh</code></pre><p>in the /home/debian/ directory. The program then</p><ol><li><p>Compiles a device tree overlay (should SPI1 be used)</p></li><li><p>Creates the binaries for the SPI driver and example</p></li><li><p>Runs the MCP3903 example script located in spi_MCP3903.c</p></li></ol><p>The purpose of the program is to configure the ADC to operate in the continuous mode and then read the registers, outputting the measurements in the terminal.</p><h2><a class="nav-anchor" id="Example-with-LEDs-(HOST)-1" href="#Example-with-LEDs-(HOST)-1">Example with LEDs (HOST)</a></h2><p>To operate the LEDs from the host computer, simply connect the BBB to the HOST via USB and run the &quot;testLED.jl&quot; on the HOST</p><pre><code class="language-none">cd &amp;&amp; cd .julia/v0.6/LabConnections/Examples/ &amp;&amp; julia testLED.jl</code></pre><pre><code class="language-"></code></pre><footer><hr/><a class="previous" href="testing.html"><span class="direction">Previous</span><span class="title">Tests</span></a></footer></article></body></html>
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>LabConnections · LabConnections</title><link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css" rel="stylesheet" type="text/css"/><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js" data-main="assets/documenter.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link href="assets/documenter.css" rel="stylesheet" type="text/css"/></head><body><nav class="toc"><h1>LabConnections</h1><select id="version-selector" onChange="window.location.href=this.value" style="visibility: hidden"></select><form class="search" action="search.html"><input id="search-query" name="q" type="text" placeholder="Search docs"/></form><ul><li class="current"><a class="toctext" href="index.html">LabConnections</a><ul class="internal"></ul></li><li><a class="toctext" href="installation.html">Installation Instructions</a></li><li><a class="toctext" href="systemConfiguration.html">System Configuration</a></li></ul></nav><article id="docs"><header><nav><ul><li><a href="index.html">LabConnections</a></li></ul><a class="edit-page" href="https://github.com//tree/a896ac435aa1ba8ddbeecbb871aaad4bc26fbeab/docs/src/index.md"><span class="fa"></span> Edit on GitHub</a></nav><hr/><div id="topbar"><span>LabConnections</span><a class="fa fa-bars" href="#"></a></div></header><h1><a class="nav-anchor" id="LabConnections-1" href="#LabConnections-1">LabConnections</a></h1><p>This is the documentation for the LabCommunication project, detailing installation instructions, examples and tests which may be run, as well as documenting the protocols and structure of the IO communication.</p><ul><li><a href="installation.html#Installation-Instructions-1">Installation Instructions</a></li><ul><li><a href="installation.html#On-the-HOST-1">On the HOST</a></li><li><a href="installation.html#On-the-BeagleBone-1">On the BeagleBone</a></li><li><a href="installation.html#Setting-up-automatic-communication-between-the-BB-and-the-HOST-via-TCP-1">Setting up automatic communication between the BB and the HOST via TCP</a></li></ul><li><a href="index.html#LabConnections-1">LabConnections</a></li><li><a href="systemConfiguration.html#System-Configuration-1">System Configuration</a></li><ul><li><a href="systemConfiguration.html#Configuration-interfaces-1">Configuration interfaces</a></li><li><a href="systemConfiguration.html#Configuration-files-1">Configuration files</a></li><li><a href="systemConfiguration.html#Creating-configurations-1">Creating configurations</a></li></ul></ul><pre><code class="language-"></code></pre><footer><hr/><a class="next" href="installation.html"><span class="direction">Next</span><span class="title">Installation Instructions</span></a></footer></article></body></html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>LabConnections · LabConnections</title><link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css" rel="stylesheet" type="text/css"/><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js" data-main="assets/documenter.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link href="assets/documenter.css" rel="stylesheet" type="text/css"/></head><body><nav class="toc"><h1>LabConnections</h1><select id="version-selector" onChange="window.location.href=this.value" style="visibility: hidden"></select><form class="search" id="search-form" action="search.html"><input id="search-query" name="q" type="text" placeholder="Search docs"/></form><ul><li class="current"><a class="toctext" href="index.html">LabConnections</a><ul class="internal"></ul></li><li><a class="toctext" href="installation.html">Installation Instructions</a></li><li><a class="toctext" href="systemConfiguration.html">System Configuration (deprecated)</a></li><li><a class="toctext" href="testing.html">Tests</a></li><li><a class="toctext" href="examples.html">Examples on the BB</a></li></ul></nav><article id="docs"><header><nav><ul><li><a href="index.html">LabConnections</a></li></ul><a class="edit-page" href="https://github.com//blob/master/docs/src/index.md"><span class="fa"></span> Edit on GitHub</a></nav><hr/><div id="topbar"><span>LabConnections</span><a class="fa fa-bars" href="#"></a></div></header><h1><a class="nav-anchor" id="LabConnections-1" href="#LabConnections-1">LabConnections</a></h1><p>This is the documentation for the LabCommunication project, detailing installation instructions, examples and tests which may be run, as well as documenting the protocols and structure of the IO communication.</p><ul><li><a href="examples.html#Examples-on-the-BB-1">Examples on the BB</a></li><ul><li><a href="examples.html#Example-with-LEDs-(BB)-1">Example with LEDs (BB)</a></li><li><a href="examples.html#Example-with-GPIOs-(BB)-1">Example with GPIOs (BB)</a></li><li><a href="examples.html#Example-with-PWM-(BB)-1">Example with PWM (BB)</a></li><li><a href="examples.html#Example-with-SPI-(BB)-1">Example with SPI (BB)</a></li><li><a href="examples.html#Example-with-LEDs-(HOST)-1">Example with LEDs (HOST)</a></li></ul><li><a href="testing.html#Tests-1">Tests</a></li><li><a href="installation.html#Installation-Instructions-1">Installation Instructions</a></li><ul><li><a href="installation.html#On-the-BBB-1">On the BBB</a></li><li><a href="installation.html#On-the-HOST-1">On the HOST</a></li><li><a href="installation.html#Setting-up-automatic-communication-1">Setting up automatic communication</a></li></ul><li><a href="index.html#LabConnections-1">LabConnections</a></li><li><a href="systemConfiguration.html#System-Configuration-(deprecated)-1">System Configuration (deprecated)</a></li><ul><li><a href="systemConfiguration.html#Configuration-interfaces-(deprecated)-1">Configuration interfaces (deprecated)</a></li><li><a href="systemConfiguration.html#Configuration-files-1">Configuration files</a></li><li><a href="systemConfiguration.html#Creating-configurations-1">Creating configurations</a></li></ul></ul><pre><code class="language-"></code></pre><footer><hr/><a class="next" href="installation.html"><span class="direction">Next</span><span class="title">Installation Instructions</span></a></footer></article></body></html>
This diff is collapsed.
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Search · LabConnections</title><link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css" rel="stylesheet" type="text/css"/><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js" data-main="assets/documenter.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link href="assets/documenter.css" rel="stylesheet" type="text/css"/></head><body><nav class="toc"><h1>LabConnections</h1><select id="version-selector" onChange="window.location.href=this.value" style="visibility: hidden"></select><form class="search" action="search.html"><input id="search-query" name="q" type="text" placeholder="Search docs"/></form><ul><li><a class="toctext" href="index.html">LabConnections</a></li><li><a class="toctext" href="installation.html">Installation Instructions</a></li><li><a class="toctext" href="systemConfiguration.html">System Configuration</a></li></ul></nav><article><header><nav><ul><li>Search</li></ul></nav><hr/><div id="topbar"><span>Search</span><a class="fa fa-bars" href="#"></a></div></header><h1>Search</h1><p id="search-info">Number of results: <span id="search-results-number">loading...</span></p><ul id="search-results"></ul></article></body><script src="search_index.js"></script><script src="assets/search.js"></script></html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Search · LabConnections</title><link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css" rel="stylesheet" type="text/css"/><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js" data-main="assets/documenter.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link href="assets/documenter.css" rel="stylesheet" type="text/css"/></head><body><nav class="toc"><h1>LabConnections</h1><select id="version-selector" onChange="window.location.href=this.value" style="visibility: hidden"></select><form class="search" id="search-form" action="search.html"><input id="search-query" name="q" type="text" placeholder="Search docs"/></form><ul><li><a class="toctext" href="index.html">LabConnections</a></li><li><a class="toctext" href="installation.html">Installation Instructions</a></li><li><a class="toctext" href="systemConfiguration.html">System Configuration (deprecated)</a></li><li><a class="toctext" href="testing.html">Tests</a></li><li><a class="toctext" href="examples.html">Examples on the BB</a></li></ul></nav><article><header><nav><ul><li>Search</li></ul></nav><hr/><div id="topbar"><span>Search</span><a class="fa fa-bars" href="#"></a></div></header><h1>Search</h1><p id="search-info">Number of results: <span id="search-results-number">loading...</span></p><ul id="search-results"></ul></article></body><script src="search_index.js"></script><script src="assets/search.js"></script></html>
This diff is collapsed.
This diff is collapsed.
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Tests · LabConnections</title><link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css" rel="stylesheet" type="text/css"/><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js" data-main="assets/documenter.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link href="assets/documenter.css" rel="stylesheet" type="text/css"/></head><body><nav class="toc"><h1>LabConnections</h1><select id="version-selector" onChange="window.location.href=this.value" style="visibility: hidden"></select><form class="search" id="search-form" action="search.html"><input id="search-query" name="q" type="text" placeholder="Search docs"/></form><ul><li><a class="toctext" href="index.html">LabConnections</a></li><li><a class="toctext" href="installation.html">Installation Instructions</a></li><li><a class="toctext" href="systemConfiguration.html">System Configuration (deprecated)</a></li><li class="current"><a class="toctext" href="testing.html">Tests</a><ul class="internal"></ul></li><li><a class="toctext" href="examples.html">Examples on the BB</a></li></ul></nav><article id="docs"><header><nav><ul><li><a href="testing.html">Tests</a></li></ul><a class="edit-page" href="https://github.com//blob/master/docs/src/testing.md"><span class="fa"></span> Edit on GitHub</a></nav><hr/><div id="topbar"><span>Tests</span><a class="fa fa-bars" href="#"></a></div></header><h1><a class="nav-anchor" id="Tests-1" href="#Tests-1">Tests</a></h1><p>The BeagleBone IO communication can be tested</p><ul><li><a href="examples.html#Examples-on-the-BB-1">Examples on the BB</a></li><ul><li><a href="examples.html#Example-with-LEDs-(BB)-1">Example with LEDs (BB)</a></li><li><a href="examples.html#Example-with-GPIOs-(BB)-1">Example with GPIOs (BB)</a></li><li><a href="examples.html#Example-with-PWM-(BB)-1">Example with PWM (BB)</a></li><li><a href="examples.html#Example-with-SPI-(BB)-1">Example with SPI (BB)</a></li><li><a href="examples.html#Example-with-LEDs-(HOST)-1">Example with LEDs (HOST)</a></li></ul><li><a href="testing.html#Tests-1">Tests</a></li><li><a href="installation.html#Installation-Instructions-1">Installation Instructions</a></li><ul><li><a href="installation.html#On-the-BBB-1">On the BBB</a></li><li><a href="installation.html#On-the-HOST-1">On the HOST</a></li><li><a href="installation.html#Setting-up-automatic-communication-1">Setting up automatic communication</a></li></ul><li><a href="index.html#LabConnections-1">LabConnections</a></li><li><a href="systemConfiguration.html#System-Configuration-(deprecated)-1">System Configuration (deprecated)</a></li><ul><li><a href="systemConfiguration.html#Configuration-interfaces-(deprecated)-1">Configuration interfaces (deprecated)</a></li><li><a href="systemConfiguration.html#Configuration-files-1">Configuration files</a></li><li><a href="systemConfiguration.html#Creating-configurations-1">Creating configurations</a></li></ul></ul><pre><code class="language-"></code></pre><footer><hr/><a class="previous" href="systemConfiguration.html"><span class="direction">Previous</span><span class="title">System Configuration (deprecated)</span></a><a class="next" href="examples.html"><span class="direction">Next</span><span class="title">Examples on the BB</span></a></footer></article></body></html>
push!(LOAD_PATH,"../src/")
println(LOAD_PATH)
using Documenter, LabConnections
# makedocs()
# deploydocs(
......@@ -17,6 +17,8 @@ makedocs(
"index.md",
"installation.md",
"systemConfiguration.md",
"testing.md",
"examples.md",
]
)
......
# Examples on the BB
The following examples may be run from the BB, and may require the user to
export the the LabConnections module to the LOAD_PATH manually, executing the
following line in the Julia prompt
push!(LOAD_PATH, "/home/debian/juliapackages")
When running the examples with hardware in the loop, take caution not to short
the BB ground with any output pin, as this will damage the board. For instance,
if connecting a diode to the output pins, always use a resistor of >1000 Ohm in
parallel. See the configuration page for information on which functionality
specific pins support.
```@contents
Pages = ["examples.md"]
Depth = 3
```
## Example with LEDs (BB)
To test the system LED functionality of the Julia code from the BBB, open a
Julia prompt and run the SYS_LED_test.jl file
include("/home/debian/juliapackages/LabConnections/test/BeagleBone/SYS_LED_test.jl")
This example runs a test with hardware in the loop, exporting and unexporting
the SYS_LED devices and blinking led D2-D5 in a sequence over 1 second,
alternating with D2/D4 and D3/D5 on/off.
## Example with GPIOs (BB)
To test the GPIO functionality of the Julia code from the BBB, open a
Julia prompt and run the GPIO_test.jl file
include("/home/debian/juliapackages/LabConnections/test/BeagleBone/GPIO_test.jl")
This again runs the tests with the BBB in the loop, testing exception handling
exporting of the file system and also runs all the GPIOs on the board high/low
at a 0.1 period time over 1 second to demonstrate the IO communication visually.
## Example with PWM (BB)
To test the PWM functionality of the Julia code from the BBB, open a
Julia prompt and run the PWM_test.jl file
include("/home/debian/juliapackages/LabConnections/test/BeagleBone/PWM_test.jl")
This runs the PWM tests with the BBB in the loop, testing exception handling
exporting of the file system. In addition, it runs all the PWM pins on the board
with a duty cycle of 0.5 over a period time over 1 second to demonstrate the IO
communication visually.
## Example with SPI (BB)
All development on the SPI is currently done in C in a for of the serbus
package. Consequently, this example is currently run completely separate
from the LabConnections.
Make sure that the serbus package exists in the /juliapackages/ directory, where
it is automatically placed when transferring code to the BB using the ./flash_BB
shell script. Then simply run
cp /home/debian/juliapackages/serbus/bb_spi.sh /home/debian
and execute
./bb_spi.sh
in the /home/debian/ directory. The program then
1) Compiles a device tree overlay (should SPI1 be used)
2) Creates the binaries for the SPI driver and example
3) Runs the MCP3903 example script located in spi_MCP3903.c
The purpose of the program is to configure the ADC to operate in the continuous
mode and then read the registers, outputting the measurements in the terminal.
## Example with LEDs (HOST)
To operate the LEDs from the host computer, simply connect the BBB to the HOST
via USB and run the "testLED.jl" on the HOST
cd && cd .julia/v0.6/LabConnections/Examples/ && julia testLED.jl
```@systemConfiguration
```
# System Configuration
# System Configuration (deprecated)
The system configuration is designed easy human readable acceess to IO functionality and for speed in the real-time execution. Many pins may be used for different purposes, as can be seen in the diagram below, and the cofiguring of these pins is done on a low level. All pins are referred to by a generic string "PX.YZ". For example, the pin "P9.28" may be used in the PWM or the ADC (SPI), but not both simultaneously.
![block diagram](beaglebone_black_pinmap.png)
![block diagram](figures/beaglebone_black_pinmap.png)
## Configuration interfaces
## Configuration interfaces (deprecated)
The interface to the BB pins is set in the `srcBeagleBone/config/*` directory. Many pins of the BB may have multiple settings, documented in the [`pins.yml'](https://gitlab.control.lth.se/labdev/LabConnections.jl/blob/master/src/BeagleBone/config/pins.yml) interface. Any of the pins listed in this file may be incorporated in configuring a specific process. This is done my creating a new `*.yml' file in the config/ directory, with a set of pins and identifiers.
## Configuration files
......
# Tests
The BeagleBone IO communication can be tested
```@contents
Depth = 3
```
```@systemConfiguration
```
......@@ -2,7 +2,9 @@ push!(LOAD_PATH, "/home/debian/juliapackages")
using LabConnections.BeagleBone
BeagleBone.precompile_bb()
server = run_server()
println("Opening server")
while isopen(server)
#To keep julia from returning, thus killing the process
println("server kept open")
sleep(10)
end
......@@ -45,7 +45,7 @@ using Base.Test
end
@testset "Read/Write" begin
@testset "Exceptions" begin
# Fixture
device = initdev("gpio", Int32(1))
......@@ -60,25 +60,6 @@ using Base.Test
@test_throws ErrorException write!(device, (Int32(2), "bad_entry"))
@test_throws ErrorException write!(device, (Int32(3), "bad_entry"))
# Test operation 1
write!(device, (Int32(1), "1"))
@test read(device, Int32(1)) == "1"
write!(device, (Int32(1), "0"))
@test read(device, Int32(1)) == "0"
write!(device, (Int32(1), "1"))
@test read(device, Int32(1)) == "1"
write!(device, (Int32(1), "0"))
@test read(device, Int32(1)) == "0"
write!(device, (Int32(2), "in"))
@test read(device, Int32(2)) == "in"
write!(device, (Int32(2), "out"))
@test read(device, Int32(2)) == "out"
write!(device, (Int32(2), "in"))
@test read(device, Int32(2)) == "in"
write!(device, (Int32(2), "out"))
@test read(device, Int32(2)) == "out"
# Test operation 3
@test_throws ErrorException write!(device, (Int32(3), "none"))
@test_throws ErrorException write!(device, (Int32(3), "rising"))
......@@ -87,12 +68,9 @@ using Base.Test
# Close Gpio
closedev("gpio", Int32(1))
end
end
@testset "All channels" begin
# Instanciate all possible leds and perform 10 read/write commands
# with the set high/low operation ("value")
# Configure the GPIO for output usage
devices = []
for ii = 1:length(gpio_channels)
......@@ -104,7 +82,7 @@ using Base.Test
end
# Sets all available GPIO pins high/low in an alternating pattern
for i = 1:10
for i = 1:20
for ii = 1:length(gpio_channels)
state = "$(i%2)"
write!(devices[ii], (Int32(1), state))
......@@ -118,4 +96,32 @@ using Base.Test
closedev("gpio", Int32(ii))
end
end
@testset "Read/Write" begin
# Fixture
device = initdev("gpio", Int32(1))
# Test operation 1
write!(device, (Int32(1), "1"))
@test read(device, Int32(1)) == "1"
write!(device, (Int32(1), "0"))
@test read(device, Int32(1)) == "0"
write!(device, (Int32(1), "1"))
@test read(device, Int32(1)) == "1"
write!(device, (Int32(1), "0"))
@test read(device, Int32(1)) == "0"
write!(device, (Int32(2), "in"))
@test read(device, Int32(2)) == "in"
write!(device, (Int32(2), "out"))
@test read(device, Int32(2)) == "out"
write!(device, (Int32(2), "in"))
@test read(device, Int32(2)) == "in"
write!(device, (Int32(2), "out"))
@test read(device, Int32(2)) == "out"
# Close Gpio
closedev("gpio", Int32(1))
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment