Commit 16c5df73 authored by Marcus Greiff's avatar Marcus Greiff

First attempt at generating autodocs of functions

parent 1567fe76
Pipeline #590 passed with stage
in 27 seconds
......@@ -14,13 +14,6 @@ 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.
- [Examples on the BB](examples.md#Examples-on-the-BB-1)
- [Example with LEDs (BB)](examples.md#Example-with-LEDs-(BB)-1)
- [Example with GPIOs (BB)](examples.md#Example-with-GPIOs-(BB)-1)
- [Example with PWM (BB)](examples.md#Example-with-PWM-(BB)-1)
- [Example with SPI (BB)](examples.md#Example-with-SPI-(BB)-1)
- [Example with LEDs (HOST)](examples.md#Example-with-LEDs-(HOST)-1)
<a id='Example-with-LEDs-(BB)-1'></a>
......
......@@ -25,8 +25,12 @@
## Functions
- [Available devices](lib/io_devices.md#Available-devices-1)
- [Available functions](lib/functions.md#Available-functions-1)
<a id='Documentation-Index-1'></a>
## Documentation Index
<a id='Available-functions-1'></a>
# Available functions
```
initdev
closedev
```
<a id='Available-devices-1'></a>
# Available devices
```
teardown
```
<a id='Tests-1'></a>
# Tests
The BeagleBone tests can be run on any computer, regrdless of their file-syste. By setting the flag RUNNING_TESTS to true, a dummy file-system is exported in which the tests are run operate. This has the advantage of enabling testing of the code run on the BB free from the BB itself, without building the Debian FS, thereby enabling the automatic testing through Travis.
To run the tests, simply enter the /test/ directory and run
```
julia run_tests.jl
```
If the tests are to be run on the BB with hardware in the loop, run
```
julia run_tests.jl
```
on the BB, to run examples separately, see
......@@ -29,3 +29,6 @@ pages:
- Guide:
- Introduction: 'man/introduction.md'
- Installation: 'man/installation.md'
- API:
- IO devices: 'lib/io_devices.md'
- Fucntions: 'lib/functions.md'
# Examples on the BB
# Examples
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
......@@ -11,11 +11,6 @@ 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
......
......@@ -11,14 +11,18 @@ Depth = 1
```
## Guide
```@contents
Pages = ["man/introduction.md", "man/installation.md"]
Depth = 1
```
## Functions
```@contents
Pages = ["lib/io_devices.md", "lib/functions.md"]
```
## Documentation Index
```@index
Pages = ["lib/io_devices.md", "lib/functions.md"]
Depth = 1
```
```@index
Pages = ["functions.md"]
```
# Available functions
```@docs
initdev
closedev
```
```@index
Pages = ["io_devices.md"]
```
# Available devices
```@docs
teardown
```
# Tests
The BeagleBone tests can be run on any computer, regrdless of their file-syste.
By setting the flag RUNNING_TESTS to true, a dummy file-system is exported in
which the tests are run operate. This has the advantage of enabling testing of
the code run on the BB free from the BB itself, without building the Debian FS,
thereby enabling the automatic testing through Travis.
To run the tests, simply enter the /test/ directory and run
julia run_tests.jl
If the tests are to be run on the BB with hardware in the loop, run
julia run_tests.jl
on the BB, to run examples separately, see
......@@ -11,12 +11,10 @@ const DEVICES = Dict("debug" => Debug, "sysled" => SysLED, "gpio" => GPIO, "pwm"
active_devices = Dict{String,Dict{Int32,IO_Object}}("debug" => Dict{Int32,Debug}(), "sysled" => Dict{Int32,SysLED}(),
"gpio" => Dict{Int32,GPIO}(), "pwm" => Dict{Int32,PWM}())
"""
active_device = initdev(dev_name::String, i:Int32)
@doc """ active_device = initdev(dev_name::String, i:Int32)
Initializes a new device of type 'dev_name' at index 'i' on the BeagleBone,
and adds it to the dict of currently active devices. Returns the initialized
device 'active_device'.
"""
device 'active_device'."""->
function initdev(dev_name::String, i::Int32)
#Check if the type of device is valid
dev_constr = try
......@@ -32,11 +30,10 @@ function initdev(dev_name::String, i::Int32)
return active_device
end
"""
closedev(dev_name::String, i::Int32)
@doc """ closedev(dev_name::String, i::Int32)
Closes down a currently active device of type 'dev_name' at index 'i' on the BeagleBone,
and removes it from the dict of currently active devices.
"""
""" ->
function closedev(dev_name::String, i::Int32)
active_device = try
active_devices[dev_name][i]
......
......@@ -16,7 +16,6 @@ The operation of reading the current output value of the GPIO is done by
See the test/BeagleBone/GPIO_test.jl for more examples.
"""
type GPIO <: IO_Object
i::Int32
basedir::String
......@@ -68,10 +67,9 @@ function read(gpio::GPIO, operation::Int32, debug::Bool=false)
return l
end
"""
teardown(gpio::GPIO, debug::Bool=false)
@doc """ teardown(gpio::GPIO, debug::Bool=false)
Closes all open streams on the GPIO, and unexports it from the file system.
"""
""" ->
function teardown(gpio::GPIO, debug::Bool=false)
debug && return
......
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