diff --git a/docs/build/assets/documenter.css b/docs/build/assets/documenter.css index b8514efd2c05f06f46b4f230a32812813c7688b2..0aa36a9a22db0791b7ba63cc88b821c2114e2eab 100644 --- a/docs/build/assets/documenter.css +++ b/docs/build/assets/documenter.css @@ -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, diff --git a/docs/build/assets/search.js b/docs/build/assets/search.js index 4e3e9a4abc32d8426a05ea9b57ddd8295d893d16..5eb7fee83449b833cc11dc28364386be03f42f7b 100644 --- a/docs/build/assets/search.js +++ b/docs/build/assets/search.js @@ -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(); diff --git a/docs/build/examples.html b/docs/build/examples.html new file mode 100644 index 0000000000000000000000000000000000000000..fd821ab3ae740ec91ebc3b9b45c657e24a3a1760 --- /dev/null +++ b/docs/build/examples.html @@ -0,0 +1,2 @@ +<!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, "/home/debian/juliapackages")</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 >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("/home/debian/juliapackages/LabConnections/test/BeagleBone/SYS_LED_test.jl")</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("/home/debian/juliapackages/LabConnections/test/BeagleBone/GPIO_test.jl")</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("/home/debian/juliapackages/LabConnections/test/BeagleBone/PWM_test.jl")</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 "testLED.jl" on the HOST</p><pre><code class="language-none">cd && cd .julia/v0.6/LabConnections/Examples/ && 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> diff --git a/docs/build/beaglebone_black_pinmap.png b/docs/build/figures/beaglebone_black_pinmap.png similarity index 100% rename from docs/build/beaglebone_black_pinmap.png rename to docs/build/figures/beaglebone_black_pinmap.png diff --git a/docs/build/flashBB.png b/docs/build/figures/flashBB.png similarity index 100% rename from docs/build/flashBB.png rename to docs/build/figures/flashBB.png diff --git a/docs/build/index.html b/docs/build/index.html index 9799482dba584b6d23ce65e047839d58172e5f65..f38d64394bc798d9366903393bb61abe9443180c 100644 --- a/docs/build/index.html +++ b/docs/build/index.html @@ -1,2 +1,2 @@ <!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> diff --git a/docs/build/installation.html b/docs/build/installation.html index 0136c61a3f5cb8bb7abb40d091d7ad5169ba729a..3b4651732895855ba4032d387900ee08edfd1b07 100644 --- a/docs/build/installation.html +++ b/docs/build/installation.html @@ -1,5 +1,5 @@ <!DOCTYPE html> -<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Installation Instructions · 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 class="current"><a class="toctext" href="installation.html">Installation Instructions</a><ul class="internal"><li><a class="toctext" href="#On-the-HOST-1">On the HOST</a></li><li><a class="toctext" href="#On-the-BeagleBone-1">On the BeagleBone</a></li><li><a class="toctext" href="#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><li><a class="toctext" href="systemConfiguration.html">System Configuration</a></li></ul></nav><article id="docs"><header><nav><ul><li><a href="installation.html">Installation Instructions</a></li></ul><a class="edit-page" href="https://github.com//tree/a896ac435aa1ba8ddbeecbb871aaad4bc26fbeab/docs/src/installation.md"><span class="fa"></span> Edit on GitHub</a></nav><hr/><div id="topbar"><span>Installation Instructions</span><a class="fa fa-bars" href="#"></a></div></header><h1><a class="nav-anchor" id="Installation-Instructions-1" href="#Installation-Instructions-1">Installation Instructions</a></h1><h2><a class="nav-anchor" id="On-the-HOST-1" href="#On-the-HOST-1">On the HOST</a></h2><p>To get started, first install julia v0.6.X on the PC running a Linux distribution by following the instructions specified <a href="https://github.com/JuliaLang/julia/blob/master/README.md">here</a>. So far, the system has only been testen on Ubuntu 14.* and 16.*.</p><p>Once julia is installed julia, run</p><pre><code class="language-none">`Pkg.clone(https://gitlab.control.lth.se/labdev/LabConnections.jl)' -`Pkg.add("YAML")'</code></pre><p>in the julia prompt to install all dependencies on the HOST.</p><h2><a class="nav-anchor" id="On-the-BeagleBone-1" href="#On-the-BeagleBone-1">On the BeagleBone</a></h2><p>On the BeagleBone, first install Debian for 32 bit ARM processors using a micro-SD by following <a href="http://derekmolloy.ie/write-a-new-image-to-the-beaglebone-black/">this guide</a>. You may also include a julia v0.6 tarball, alternatively transferring it using after an installation.</p><p>If chosing the latter, connect the BB and download the julia tarball for ARM (ARMv7 32-bit hard float) from <a href="https://julialang.org/downloads/">here</a> and scp it to /home/debian/ on the BB. Run</p><pre><code class="language-none">`cd ~/Downloads' -`scp -r julia-0.6.0-linux-arm.tar.gz debian@192.168.7.2:/home/debian'</code></pre><p>next, log on to the BB via SSH by running</p><pre><code class="language-none">`ssh debian@192.168.7.2'</code></pre><p>an unpack the tarball. Julia should now be operational by running</p><pre><code class="language-none">`/home/debian/julia-<distro specific tag>/bin/julia'</code></pre><p>Next, open a new terminal on the HOST and cd to the /util directory of the LabConnection package by running in the julia package folder</p><pre><code class="language-none">`cd && cd .julia/v0.6/LabConnection/util'</code></pre><p>This directory contains some nice utility files to operate the BB from the host. To flash it with the current revision of the software, including all dependencies, simply execut the shells cript `flash.sh'.</p><p><img src="flashBB.png" alt="block diagram"/></p><h2><a class="nav-anchor" id="Setting-up-automatic-communication-between-the-BB-and-the-HOST-via-TCP-1" href="#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></h2><p>To setup automatic start of Julia server on the BB, make sure to have completed all prior installation instructions. SSH to the BeagleBone and copy the julilaserver.service to the systemd/system</p><pre><code class="language-none">`ssh debian@192.168.7.2' -`sudo cp -r /home/debian/juliapackets/LabConnections/src/BeagleBone/startup/juliaserver.service /lib/systemd/system/juliaserver.service` (on the BeagleBone)</code></pre><p>Then execute the commands</p><p><code>sudo systemctl enable juliaserver</code> (on the BeagleBone) <code>sudo systemctl start juliaserver</code> (on the BeagleBone)</p><p>After a while, the BeagleBone should start blinking on SysLED 2: on-off-on-sleep-repeat. The server should now start automatically on restart of the BeagleBone, and you should be able to run the examples in in /Examples on the host computer.</p><pre><code class="language-"></code></pre><footer><hr/><a class="previous" href="index.html"><span class="direction">Previous</span><span class="title">LabConnections</span></a><a class="next" href="systemConfiguration.html"><span class="direction">Next</span><span class="title">System Configuration</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>Installation Instructions · 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 class="current"><a class="toctext" href="installation.html">Installation Instructions</a><ul class="internal"><li><a class="toctext" href="#On-the-BBB-1">On the BBB</a></li><li><a class="toctext" href="#On-the-HOST-1">On the HOST</a></li><li><a class="toctext" href="#Setting-up-automatic-communication-1">Setting up automatic communication</a></li></ul></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="installation.html">Installation Instructions</a></li></ul><a class="edit-page" href="https://github.com//blob/master/docs/src/installation.md"><span class="fa"></span> Edit on GitHub</a></nav><hr/><div id="topbar"><span>Installation Instructions</span><a class="fa fa-bars" href="#"></a></div></header><h1><a class="nav-anchor" id="Installation-Instructions-1" href="#Installation-Instructions-1">Installation Instructions</a></h1><h2><a class="nav-anchor" id="On-the-BBB-1" href="#On-the-BBB-1">On the BBB</a></h2><p>On the BeagleBone, first flash it with a Debian image for 32 bit ARM processors (BeagleBoard.org Debian Image 2017-03-19) using a micro-SD by following <a href="http://derekmolloy.ie/write-a-new-image-to-the-beaglebone-black/">this guide</a>. You may also include a Julia v0.6 tarball, alternatively transferring it using after an installation.</p><p>If using the provided SD card, flash the BB by holding down S2 for about 5 seconds while connecting the BB to 5V power. Keep the button pressed until the four system LEDs (D2/D3/D4/D5) start blinking in a periodical sequence. Leave the BB alone for 15-20 minutes while flashing, until all four lights are turned off (or on). Power off the BB, remove the SD card, and power it on again.</p><p>Log on to the BB via SSH by</p><pre><code class="language-none">`ssh debian@192.168.7.2'</code></pre><p>an unpack the tarball. Julia should now be operational by running</p><pre><code class="language-none">`/home/debian/julia-<distro specific tag>/bin/julia'</code></pre><p>and before leaving the BB, remove the distibution specific tag by renaming</p><pre><code class="language-none">`mv /home/debian/julia-<distro specific tag>/bin/julia /home/debian/julia/bin/julia'</code></pre><h2><a class="nav-anchor" id="On-the-HOST-1" href="#On-the-HOST-1">On the HOST</a></h2><p>To get started, first install Julia v0.6.X on the PC running a Linux distribution by following the instructions specified <a href="https://github.com/JuliaLang/julia/blob/master/README.md">here</a>. So far, the system has only been tested on Ubuntu 14.04 and 16.04.</p><p>Once Julia is installed, run</p><pre><code class="language-none">`Pkg.clone(https://gitlab.control.lth.se/labdev/LabConnections.jl)'</code></pre><p>in the Julia prompt to install all dependencies on the HOST, the source code is then located in `./julia/v0.6/LabCOnnections'.</p><p>If you plan on working with the SPI devices to debug the ADC/DAC, then you will need a forked <code>serbus' repository which wraps the</code>linux/spi/spidev'. Simply</p><pre><code class="language-none">`cd && cd .julia/v0.6' +`git clone https://github.com/mgreiff/serbus'</code></pre><p>to get the latest revision of the serbus fork.</p><p>To update the BB with the latest revision of the code, </p><pre><code class="language-none">`cd && cd .julia/v0.6/LabConnection/util' +`./flash_BB.sh'</code></pre><p>This scripts bundles the current code in LabCOnnections and serbus on the host computer and transfers it to the /home/debian/juliapackages directory on the BB.</p><h2><a class="nav-anchor" id="Setting-up-automatic-communication-1" href="#Setting-up-automatic-communication-1">Setting up automatic communication</a></h2><p>To setup automatic start of Julia server on the BB, make sure to have completed all prior installation instructions, and that the lates revision of the LabConnections package is located on the BB. SSH to the BeagleBone and copy the julilaserver.service to the systemd/system</p><pre><code class="language-none">`ssh debian@192.168.7.2' +`sudo cp -r /home/debian/juliapackets/LabConnections/src/BeagleBone/startup/juliaserver.service /lib/systemd/system/juliaserver.service` (on the BeagleBone)</code></pre><p>Then execute the commands</p><p><code>sudo systemctl enable juliaserver</code> (on the BeagleBone) <code>sudo systemctl start juliaserver</code> (on the BeagleBone)</p><p>After a while, the BeagleBone should start blinking on SysLED 2: on-off-on-sleep-repeat. The server should now start automatically on restart of the BeagleBone, and you should be able to run the examples in in /Examples on the host computer.</p><pre><code class="language-"></code></pre><footer><hr/><a class="previous" href="index.html"><span class="direction">Previous</span><span class="title">LabConnections</span></a><a class="next" href="systemConfiguration.html"><span class="direction">Next</span><span class="title">System Configuration (deprecated)</span></a></footer></article></body></html> diff --git a/docs/build/search.html b/docs/build/search.html index 4b536fd2a64079097d2a566cd4aed984575c4844..d4823f089ea20e9894ab272425c10e07b3813263 100644 --- a/docs/build/search.html +++ b/docs/build/search.html @@ -1,2 +1,2 @@ <!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> diff --git a/docs/build/search_index.js b/docs/build/search_index.js index 24b774c296050cc8d85dfc4ea86beed44ebd504c..905950bff4d439035f1d6816f9c9118c201b2ce3 100644 --- a/docs/build/search_index.js +++ b/docs/build/search_index.js @@ -33,56 +33,56 @@ var documenterSearchIndex = {"docs": [ }, { - "location": "installation.html#On-the-HOST-1", + "location": "installation.html#On-the-BBB-1", "page": "Installation Instructions", - "title": "On the HOST", + "title": "On the BBB", "category": "section", - "text": "To get started, first install julia v0.6.X on the PC running a Linux distribution by following the instructions specified here. So far, the system has only been testen on Ubuntu 14.* and 16.*.Once julia is installed julia, run`Pkg.clone(https://gitlab.control.lth.se/labdev/LabConnections.jl)'\n`Pkg.add(\"YAML\")'in the julia prompt to install all dependencies on the HOST." + "text": "On the BeagleBone, first flash it with a Debian image for 32 bit ARM processors (BeagleBoard.org Debian Image 2017-03-19) using a micro-SD by following this guide. You may also include a Julia v0.6 tarball, alternatively transferring it using after an installation.If using the provided SD card, flash the BB by holding down S2 for about 5 seconds while connecting the BB to 5V power. Keep the button pressed until the four system LEDs (D2/D3/D4/D5) start blinking in a periodical sequence. Leave the BB alone for 15-20 minutes while flashing, until all four lights are turned off (or on). Power off the BB, remove the SD card, and power it on again.Log on to the BB via SSH by`ssh debian@192.168.7.2'an unpack the tarball. Julia should now be operational by running`/home/debian/julia-<distro specific tag>/bin/julia'and before leaving the BB, remove the distibution specific tag by renaming`mv /home/debian/julia-<distro specific tag>/bin/julia /home/debian/julia/bin/julia'" }, { - "location": "installation.html#On-the-BeagleBone-1", + "location": "installation.html#On-the-HOST-1", "page": "Installation Instructions", - "title": "On the BeagleBone", + "title": "On the HOST", "category": "section", - "text": "On the BeagleBone, first install Debian for 32 bit ARM processors using a micro-SD by following this guide. You may also include a julia v0.6 tarball, alternatively transferring it using after an installation.If chosing the latter, connect the BB and download the julia tarball for ARM (ARMv7 32-bit hard float) from here and scp it to /home/debian/ on the BB. Run`cd ~/Downloads'\n`scp -r julia-0.6.0-linux-arm.tar.gz debian@192.168.7.2:/home/debian'next, log on to the BB via SSH by running`ssh debian@192.168.7.2'an unpack the tarball. Julia should now be operational by running`/home/debian/julia-<distro specific tag>/bin/julia'Next, open a new terminal on the HOST and cd to the /util directory of the LabConnection package by running in the julia package folder`cd && cd .julia/v0.6/LabConnection/util'This directory contains some nice utility files to operate the BB from the host. To flash it with the current revision of the software, including all dependencies, simply execut the shells cript `flash.sh'.(Image: block diagram)" + "text": "To get started, first install Julia v0.6.X on the PC running a Linux distribution by following the instructions specified here. So far, the system has only been tested on Ubuntu 14.04 and 16.04.Once Julia is installed, run`Pkg.clone(https://gitlab.control.lth.se/labdev/LabConnections.jl)'in the Julia prompt to install all dependencies on the HOST, the source code is then located in `./julia/v0.6/LabCOnnections'.If you plan on working with the SPI devices to debug the ADC/DAC, then you will need a forked serbus' repository which wraps thelinux/spi/spidev'. Simply`cd && cd .julia/v0.6'\n`git clone https://github.com/mgreiff/serbus'to get the latest revision of the serbus fork.To update the BB with the latest revision of the code, `cd && cd .julia/v0.6/LabConnection/util'\n`./flash_BB.sh'This scripts bundles the current code in LabCOnnections and serbus on the host computer and transfers it to the /home/debian/juliapackages directory on the BB." }, { - "location": "installation.html#Setting-up-automatic-communication-between-the-BB-and-the-HOST-via-TCP-1", + "location": "installation.html#Setting-up-automatic-communication-1", "page": "Installation Instructions", - "title": "Setting up automatic communication between the BB and the HOST via TCP", + "title": "Setting up automatic communication", "category": "section", - "text": "To setup automatic start of Julia server on the BB, make sure to have completed all prior installation instructions. SSH to the BeagleBone and copy the julilaserver.service to the systemd/system`ssh debian@192.168.7.2'\n`sudo cp -r /home/debian/juliapackets/LabConnections/src/BeagleBone/startup/juliaserver.service /lib/systemd/system/juliaserver.service` (on the BeagleBone)Then execute the commandssudo systemctl enable juliaserver (on the BeagleBone) sudo systemctl start juliaserver (on the BeagleBone)After a while, the BeagleBone should start blinking on SysLED 2: on-off-on-sleep-repeat. The server should now start automatically on restart of the BeagleBone, and you should be able to run the examples in in /Examples on the host computer." + "text": "To setup automatic start of Julia server on the BB, make sure to have completed all prior installation instructions, and that the lates revision of the LabConnections package is located on the BB. SSH to the BeagleBone and copy the julilaserver.service to the systemd/system`ssh debian@192.168.7.2'\n`sudo cp -r /home/debian/juliapackets/LabConnections/src/BeagleBone/startup/juliaserver.service /lib/systemd/system/juliaserver.service` (on the BeagleBone)Then execute the commandssudo systemctl enable juliaserver (on the BeagleBone) sudo systemctl start juliaserver (on the BeagleBone)After a while, the BeagleBone should start blinking on SysLED 2: on-off-on-sleep-repeat. The server should now start automatically on restart of the BeagleBone, and you should be able to run the examples in in /Examples on the host computer." }, { "location": "systemConfiguration.html#", - "page": "System Configuration", - "title": "System Configuration", + "page": "System Configuration (deprecated)", + "title": "System Configuration (deprecated)", "category": "page", "text": "" }, { - "location": "systemConfiguration.html#System-Configuration-1", - "page": "System Configuration", - "title": "System Configuration", + "location": "systemConfiguration.html#System-Configuration-(deprecated)-1", + "page": "System Configuration (deprecated)", + "title": "System Configuration (deprecated)", "category": "section", "text": "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.(Image: block diagram)" }, { - "location": "systemConfiguration.html#Configuration-interfaces-1", - "page": "System Configuration", - "title": "Configuration interfaces", + "location": "systemConfiguration.html#Configuration-interfaces-(deprecated)-1", + "page": "System Configuration (deprecated)", + "title": "Configuration interfaces (deprecated)", "category": "section", "text": "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' 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." }, { "location": "systemConfiguration.html#Configuration-files-1", - "page": "System Configuration", + "page": "System Configuration (deprecated)", "title": "Configuration files", "category": "section", "text": "The configuration file is specified as a dictionary of lists assigned to the case-senstive keys \"gpio\", \"led\", \"pwm\", \"adc\", \"qed\". Each entry has an assigned list detailing a unique integer, a tuple of pins and a description. When loading such a configuration file, for instance using`components = YAML.load(open(\"example_configuration.yml\"))'all and specific components of a certain type will be accessed as`components[\"adc\"]'The unique integer is included for quick referencing of pins in the IO communication on the BB side, the description is used on the HOST side and the tuple of pins is in a human readable string format relating to the BB layout." @@ -90,10 +90,82 @@ var documenterSearchIndex = {"docs": [ { "location": "systemConfiguration.html#Creating-configurations-1", - "page": "System Configuration", + "page": "System Configuration (deprecated)", "title": "Creating configurations", "category": "section", "text": "For instance, if a system is to be run with (1) two PWM signals, (2) ADC functionality over the SPI, (3) one quadrature encoder, (4) 4 input GPIOs and (5) 2 output GPIOs. These may be chosen as shown in the file `example_configuration.yml'.This file was created by runnig the create_configuration.jl' script in/utils', which checks consistency against `pins.yml' interactively. This script can be operated by running`julia create_configuration.jl example_configuration.yml'" }, +{ + "location": "testing.html#", + "page": "Tests", + "title": "Tests", + "category": "page", + "text": "" +}, + +{ + "location": "testing.html#Tests-1", + "page": "Tests", + "title": "Tests", + "category": "section", + "text": "The BeagleBone IO communication can be testedDepth = 3" +}, + +{ + "location": "examples.html#", + "page": "Examples on the BB", + "title": "Examples on the BB", + "category": "page", + "text": "" +}, + +{ + "location": "examples.html#Examples-on-the-BB-1", + "page": "Examples on the BB", + "title": "Examples on the BB", + "category": "section", + "text": "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 promptpush!(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.Pages = [\"examples.md\"]\nDepth = 3" +}, + +{ + "location": "examples.html#Example-with-LEDs-(BB)-1", + "page": "Examples on the BB", + "title": "Example with LEDs (BB)", + "category": "section", + "text": "To test the system LED functionality of the Julia code from the BBB, open a Julia prompt and run the SYS_LED_test.jl fileinclude(\"/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." +}, + +{ + "location": "examples.html#Example-with-GPIOs-(BB)-1", + "page": "Examples on the BB", + "title": "Example with GPIOs (BB)", + "category": "section", + "text": "To test the GPIO functionality of the Julia code from the BBB, open a Julia prompt and run the GPIO_test.jl fileinclude(\"/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." +}, + +{ + "location": "examples.html#Example-with-PWM-(BB)-1", + "page": "Examples on the BB", + "title": "Example with PWM (BB)", + "category": "section", + "text": "To test the PWM functionality of the Julia code from the BBB, open a Julia prompt and run the PWM_test.jl fileinclude(\"/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." +}, + +{ + "location": "examples.html#Example-with-SPI-(BB)-1", + "page": "Examples on the BB", + "title": "Example with SPI (BB)", + "category": "section", + "text": "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 runcp /home/debian/juliapackages/serbus/bb_spi.sh /home/debianand execute./bb_spi.shin the /home/debian/ directory. The program thenCompiles a device tree overlay (should SPI1 be used)\nCreates the binaries for the SPI driver and example\nRuns the MCP3903 example script located in spi_MCP3903.cThe 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." +}, + +{ + "location": "examples.html#Example-with-LEDs-(HOST)-1", + "page": "Examples on the BB", + "title": "Example with LEDs (HOST)", + "category": "section", + "text": "To operate the LEDs from the host computer, simply connect the BBB to the HOST via USB and run the \"testLED.jl\" on the HOSTcd && cd .julia/v0.6/LabConnections/Examples/ && julia testLED.jl" +}, + ]} diff --git a/docs/build/systemConfiguration.html b/docs/build/systemConfiguration.html index 5658309bde51e0913792311ceeb45962076e9689..0c36cde2fe319841f73585fb9705021715a90a90 100644 --- a/docs/build/systemConfiguration.html +++ b/docs/build/systemConfiguration.html @@ -1,2 +1,2 @@ <!DOCTYPE html> -<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>System Configuration · 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 class="current"><a class="toctext" href="systemConfiguration.html">System Configuration</a><ul class="internal"><li><a class="toctext" href="#Configuration-interfaces-1">Configuration interfaces</a></li><li><a class="toctext" href="#Configuration-files-1">Configuration files</a></li><li><a class="toctext" href="#Creating-configurations-1">Creating configurations</a></li></ul></li></ul></nav><article id="docs"><header><nav><ul><li><a href="systemConfiguration.html">System Configuration</a></li></ul><a class="edit-page" href="https://github.com//tree/a896ac435aa1ba8ddbeecbb871aaad4bc26fbeab/docs/src/systemConfiguration.md"><span class="fa"></span> Edit on GitHub</a></nav><hr/><div id="topbar"><span>System Configuration</span><a class="fa fa-bars" href="#"></a></div></header><h1><a class="nav-anchor" id="System-Configuration-1" href="#System-Configuration-1">System Configuration</a></h1><p>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.</p><p><img src="beaglebone_black_pinmap.png" alt="block diagram"/></p><h2><a class="nav-anchor" id="Configuration-interfaces-1" href="#Configuration-interfaces-1">Configuration interfaces</a></h2><p>The interface to the BB pins is set in the <code>srcBeagleBone/config/*</code> directory. Many pins of the BB may have multiple settings, documented in the <a href="https://gitlab.control.lth.se/labdev/LabConnections.jl/blob/master/src/BeagleBone/config/pins.yml">`pins.yml'</a> 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.</p><h2><a class="nav-anchor" id="Configuration-files-1" href="#Configuration-files-1">Configuration files</a></h2><p>The configuration file is specified as a dictionary of lists assigned to the case-senstive keys "gpio", "led", "pwm", "adc", "qed". Each entry has an assigned list detailing a unique integer, a tuple of pins and a description. When loading such a configuration file, for instance using</p><pre><code class="language-none">`components = YAML.load(open("example_configuration.yml"))'</code></pre><p>all and specific components of a certain type will be accessed as</p><pre><code class="language-none">`components["adc"]'</code></pre><p>The unique integer is included for quick referencing of pins in the IO communication on the BB side, the description is used on the HOST side and the tuple of pins is in a human readable string format relating to the BB layout.</p><h2><a class="nav-anchor" id="Creating-configurations-1" href="#Creating-configurations-1">Creating configurations</a></h2><p>For instance, if a system is to be run with (1) two PWM signals, (2) ADC functionality over the SPI, (3) one quadrature encoder, (4) 4 input GPIOs and (5) 2 output GPIOs. These may be chosen as shown in the file <a href="https://gitlab.control.lth.se/labdev/LabConnections.jl/blob/master/src/BeagleBone/config/pins.yml">`example_configuration.yml'</a>.</p><p>This file was created by runnig the <code>create_configuration.jl' script in</code>/utils', which checks consistency against <a href="https://gitlab.control.lth.se/labdev/LabConnections.jl/blob/master/src/BeagleBone/config/pins.yml">`pins.yml'</a> interactively. This script can be operated by running</p><pre><code class="language-none">`julia create_configuration.jl example_configuration.yml'</code></pre><footer><hr/><a class="previous" href="installation.html"><span class="direction">Previous</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>System Configuration (deprecated) · 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 class="current"><a class="toctext" href="systemConfiguration.html">System Configuration (deprecated)</a><ul class="internal"><li><a class="toctext" href="#Configuration-interfaces-(deprecated)-1">Configuration interfaces (deprecated)</a></li><li><a class="toctext" href="#Configuration-files-1">Configuration files</a></li><li><a class="toctext" href="#Creating-configurations-1">Creating configurations</a></li></ul></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="systemConfiguration.html">System Configuration (deprecated)</a></li></ul><a class="edit-page" href="https://github.com//blob/master/docs/src/systemConfiguration.md"><span class="fa"></span> Edit on GitHub</a></nav><hr/><div id="topbar"><span>System Configuration (deprecated)</span><a class="fa fa-bars" href="#"></a></div></header><h1><a class="nav-anchor" id="System-Configuration-(deprecated)-1" href="#System-Configuration-(deprecated)-1">System Configuration (deprecated)</a></h1><p>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.</p><p><img src="figures/beaglebone_black_pinmap.png" alt="block diagram"/></p><h2><a class="nav-anchor" id="Configuration-interfaces-(deprecated)-1" href="#Configuration-interfaces-(deprecated)-1">Configuration interfaces (deprecated)</a></h2><p>The interface to the BB pins is set in the <code>srcBeagleBone/config/*</code> directory. Many pins of the BB may have multiple settings, documented in the <a href="https://gitlab.control.lth.se/labdev/LabConnections.jl/blob/master/src/BeagleBone/config/pins.yml">`pins.yml'</a> 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.</p><h2><a class="nav-anchor" id="Configuration-files-1" href="#Configuration-files-1">Configuration files</a></h2><p>The configuration file is specified as a dictionary of lists assigned to the case-senstive keys "gpio", "led", "pwm", "adc", "qed". Each entry has an assigned list detailing a unique integer, a tuple of pins and a description. When loading such a configuration file, for instance using</p><pre><code class="language-none">`components = YAML.load(open("example_configuration.yml"))'</code></pre><p>all and specific components of a certain type will be accessed as</p><pre><code class="language-none">`components["adc"]'</code></pre><p>The unique integer is included for quick referencing of pins in the IO communication on the BB side, the description is used on the HOST side and the tuple of pins is in a human readable string format relating to the BB layout.</p><h2><a class="nav-anchor" id="Creating-configurations-1" href="#Creating-configurations-1">Creating configurations</a></h2><p>For instance, if a system is to be run with (1) two PWM signals, (2) ADC functionality over the SPI, (3) one quadrature encoder, (4) 4 input GPIOs and (5) 2 output GPIOs. These may be chosen as shown in the file <a href="https://gitlab.control.lth.se/labdev/LabConnections.jl/blob/master/src/BeagleBone/config/pins.yml">`example_configuration.yml'</a>.</p><p>This file was created by runnig the <code>create_configuration.jl' script in</code>/utils', which checks consistency against <a href="https://gitlab.control.lth.se/labdev/LabConnections.jl/blob/master/src/BeagleBone/config/pins.yml">`pins.yml'</a> interactively. This script can be operated by running</p><pre><code class="language-none">`julia create_configuration.jl example_configuration.yml'</code></pre><footer><hr/><a class="previous" href="installation.html"><span class="direction">Previous</span><span class="title">Installation Instructions</span></a><a class="next" href="testing.html"><span class="direction">Next</span><span class="title">Tests</span></a></footer></article></body></html> diff --git a/docs/build/testing.html b/docs/build/testing.html new file mode 100644 index 0000000000000000000000000000000000000000..8429d30c445f7984203a9d248da107128dd86333 --- /dev/null +++ b/docs/build/testing.html @@ -0,0 +1,2 @@ +<!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> diff --git a/docs/make.jl b/docs/make.jl index 308f52e32ae824313f6ce95387419f63614510de..be2ee4ff5a10e3be86e563ddff74a2fbef792dd3 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,5 +1,5 @@ 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", ] ) diff --git a/docs/src/examples.md b/docs/src/examples.md new file mode 100644 index 0000000000000000000000000000000000000000..d4cccf5b44d61ea820063f8e9eb80480e05344f8 --- /dev/null +++ b/docs/src/examples.md @@ -0,0 +1,80 @@ +# 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 +``` diff --git a/docs/src/beaglebone_black_pinmap.png b/docs/src/figures/beaglebone_black_pinmap.png similarity index 100% rename from docs/src/beaglebone_black_pinmap.png rename to docs/src/figures/beaglebone_black_pinmap.png diff --git a/docs/src/flashBB.png b/docs/src/figures/flashBB.png similarity index 100% rename from docs/src/flashBB.png rename to docs/src/figures/flashBB.png diff --git a/docs/src/systemConfiguration.md b/docs/src/systemConfiguration.md index d81bf05236a9bf1f25ba48e431ca1a84466d610e..22ea6df15d0da07b862ee640c0f22e5425aa3ee4 100644 --- a/docs/src/systemConfiguration.md +++ b/docs/src/systemConfiguration.md @@ -1,9 +1,9 @@ -# 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. - + -## 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 diff --git a/docs/src/testing.md b/docs/src/testing.md new file mode 100644 index 0000000000000000000000000000000000000000..9fd4633ea7a742aade8c746657d7f290970d684f --- /dev/null +++ b/docs/src/testing.md @@ -0,0 +1,8 @@ +# Tests +The BeagleBone IO communication can be tested +```@contents +Depth = 3 +``` + +```@systemConfiguration +``` diff --git a/src/BeagleBone/startup/startup.jl b/src/BeagleBone/startup/startup.jl index 6240433f2fe912dc531a5df36e69ae6f98ba82da..d3bac04029fe3e4d85130c4c4d498e3ea012865b 100644 --- a/src/BeagleBone/startup/startup.jl +++ b/src/BeagleBone/startup/startup.jl @@ -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 diff --git a/test/BeagleBone/GPIO_test.jl b/test/BeagleBone/GPIO_test.jl index ec1a409244b6c3c4febacbc97df5e122b42205ed..07ca2d51130efc6b8c3b06f3d85a55c8c4b59bfb 100644 --- a/test/BeagleBone/GPIO_test.jl +++ b/test/BeagleBone/GPIO_test.jl @@ -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