diff --git a/docs/build/index.md b/docs/build/index.md index ddd957b0faf8eb3551cac6b4e046969214f8155d..7a600d2400f08f4982cab32e7c9317edc6082139 100644 --- a/docs/build/index.md +++ b/docs/build/index.md @@ -43,8 +43,8 @@ - [`Base.read`](lib/functions.md#Base.read) - [`Base.read`](lib/functions.md#Base.read) - [`LabConnections.BeagleBone.assert_pwm_write`](lib/functions.md#LabConnections.BeagleBone.assert_pwm_write-Tuple{Int32,String}) -- [`LabConnections.BeagleBone.bbparse`](lib/functions.md#LabConnections.BeagleBone.bbparse-Tuple{Tuple,Any}) - [`LabConnections.BeagleBone.bbparse`](lib/functions.md#LabConnections.BeagleBone.bbparse-Tuple{Any}) +- [`LabConnections.BeagleBone.bbparse`](lib/functions.md#LabConnections.BeagleBone.bbparse-Tuple{Tuple,Any}) - [`LabConnections.BeagleBone.closedev`](lib/functions.md#LabConnections.BeagleBone.closedev-Tuple{String,Int32}) - [`LabConnections.BeagleBone.export_gpio`](lib/functions.md#LabConnections.BeagleBone.export_gpio-Tuple{Int32}) - [`LabConnections.BeagleBone.export_led`](lib/functions.md#LabConnections.BeagleBone.export_led) diff --git a/docs/build/lib/functions.md b/docs/build/lib/functions.md index 32463d2ba190a4576c71ee066572906a96cf19d7..bed9fee32dd3a6aaaf3351503d15300e9198a076 100644 --- a/docs/build/lib/functions.md +++ b/docs/build/lib/functions.md @@ -2,8 +2,8 @@ - [`Base.read`](functions.md#Base.read) - [`Base.read`](functions.md#Base.read) - [`LabConnections.BeagleBone.assert_pwm_write`](functions.md#LabConnections.BeagleBone.assert_pwm_write-Tuple{Int32,String}) -- [`LabConnections.BeagleBone.bbparse`](functions.md#LabConnections.BeagleBone.bbparse-Tuple{Tuple,Any}) - [`LabConnections.BeagleBone.bbparse`](functions.md#LabConnections.BeagleBone.bbparse-Tuple{Any}) +- [`LabConnections.BeagleBone.bbparse`](functions.md#LabConnections.BeagleBone.bbparse-Tuple{Tuple,Any}) - [`LabConnections.BeagleBone.closedev`](functions.md#LabConnections.BeagleBone.closedev-Tuple{String,Int32}) - [`LabConnections.BeagleBone.export_gpio`](functions.md#LabConnections.BeagleBone.export_gpio-Tuple{Int32}) - [`LabConnections.BeagleBone.export_led`](functions.md#LabConnections.BeagleBone.export_led) @@ -45,10 +45,10 @@ Run a server on `port` that listens for commands from computer Optional debug ke ``` -l = read(gpio::GPIO, operation::Int32, debug::Bool=false) +l = read(led::SysLED, debug::Bool=false) ``` -Reads the current value from an operation on a GPIO. +Reads the current brightness value from the LED 'SysLED'. <a id='Base.read' href='#Base.read'>#</a> **`Base.read`** — *Function*. @@ -67,10 +67,10 @@ Reads the current value from an operation on a GPIO. ``` -l = read(led::SysLED, debug::Bool=false) +l = read(gpio::GPIO, operation::Int32, debug::Bool=false) ``` -Reads the current brightness value from the LED 'SysLED'. +Reads the current value from an operation on a GPIO. <a id='LabConnections.BeagleBone.assert_pwm_write-Tuple{Int32,String}' href='#LabConnections.BeagleBone.assert_pwm_write-Tuple{Int32,String}'>#</a> **`LabConnections.BeagleBone.assert_pwm_write`** — *Method*. @@ -199,10 +199,10 @@ Prints all the active devices and writes out specifics of a single devices. ``` -teardown!(pwd::PWM) +teardown(gpio::GPIO, debug::Bool=false) ``` -Closes all open streams on the PWM, and unexports it from the file system +Closes all open streams on the GPIO, and unexports it from the file system. <a id='LabConnections.BeagleBone.teardown' href='#LabConnections.BeagleBone.teardown'>#</a> **`LabConnections.BeagleBone.teardown`** — *Function*. @@ -221,10 +221,10 @@ Closes all open filestreams for the SysLED 'led'. ``` -teardown(gpio::GPIO, debug::Bool=false) +teardown!(pwd::PWM) ``` -Closes all open streams on the GPIO, and unexports it from the file system. +Closes all open streams on the PWM, and unexports it from the file system <a id='LabConnections.BeagleBone.to_string' href='#LabConnections.BeagleBone.to_string'>#</a> **`LabConnections.BeagleBone.to_string`** — *Function*. @@ -232,7 +232,7 @@ Closes all open streams on the GPIO, and unexports it from the file system. ``` -to_string(pwm::PWM,, debug::Bool=false) +to_string(gpio::GPIO, debug::Bool=false) ``` Generates a string representation of the GPIO device. @@ -254,7 +254,7 @@ Generates a string representation of the GPIO device. ``` -to_string(gpio::GPIO, debug::Bool=false) +to_string(pwm::PWM,, debug::Bool=false) ``` Generates a string representation of the GPIO device. @@ -265,10 +265,10 @@ Generates a string representation of the GPIO device. ``` -write!(pwm::PWM, args::Tuple{Int32,String}, debug::Bool=false) +write!(gpio::GPIO, args::Tuple{Int32,String}, debug::Bool=false) ``` -Writes an entry to an operation on the PWM, of the form args = (operation, entry). +Writes an entry to an operation on a GPIO, of the form args = (operation, entry). <a id='LabConnections.BeagleBone.write!' href='#LabConnections.BeagleBone.write!'>#</a> **`LabConnections.BeagleBone.write!`** — *Function*. @@ -276,10 +276,10 @@ Writes an entry to an operation on the PWM, of the form args = (operation, entry ``` -write!(led::SysLED, val::Bool, debug::Bool=false) +write!(pwm::PWM, args::Tuple{Int32,String}, debug::Bool=false) ``` -Turns the LED 'SysLed' on/off for val = true/false respectively. +Writes an entry to an operation on the PWM, of the form args = (operation, entry). <a id='LabConnections.BeagleBone.write!' href='#LabConnections.BeagleBone.write!'>#</a> **`LabConnections.BeagleBone.write!`** — *Function*. @@ -287,8 +287,8 @@ Turns the LED 'SysLed' on/off for val = true/false respectively. ``` -write!(gpio::GPIO, args::Tuple{Int32,String}, debug::Bool=false) +write!(led::SysLED, val::Bool, debug::Bool=false) ``` -Writes an entry to an operation on a GPIO, of the form args = (operation, entry). +Turns the LED 'SysLed' on/off for val = true/false respectively. diff --git a/docs/build/lib/io_devices.md b/docs/build/lib/io_devices.md index f180ee192317bdb1ffaac7fe262c0ece3c64cd50..f01fba905118a159d8d2bb8c9e4eca9849f418de 100644 --- a/docs/build/lib/io_devices.md +++ b/docs/build/lib/io_devices.md @@ -32,15 +32,15 @@ GPIO(i::Int32) Lowest form of communication with the GPIO pins. The available pins are listed in the "channel" parameter, and appear as directories in /sys/class/gpio after being exported. For instance, to setup a GPIO on "gpio112", configure it as an output pin and set it to high, the following code would be used. ``` -gpio = GPIO(1) -write!(gpio, (2,"out")) -write!(gpio, (1, "1")) +`gpio = GPIO(1)` +`write!(gpio, (2,"out"))` +`write!(gpio, (1, "1"))` ``` The operation of reading the current output value of the GPIO is done by ``` -read(gpio, 1) +`read(gpio, 1)` ``` See the test/BeagleBone/GPIO_test.jl for more examples. diff --git a/src/BeagleBone/GPIO.jl b/src/BeagleBone/GPIO.jl index 8c0cbc53eb8bdf3d1c11d94bd42cd57c17ebe9ef..cc03657f6f81630a3eea0c6ab8249184b95e1fb0 100644 --- a/src/BeagleBone/GPIO.jl +++ b/src/BeagleBone/GPIO.jl @@ -5,13 +5,13 @@ listed in the "channel" parameter, and appear as directories in /sys/class/gpio after being exported. For instance, to setup a GPIO on "gpio112", configure it as an output pin and set it to high, the following code would be used. - gpio = GPIO(1) - write!(gpio, (2,"out")) - write!(gpio, (1, "1")) + `gpio = GPIO(1)` + `write!(gpio, (2,"out"))` + `write!(gpio, (1, "1"))` The operation of reading the current output value of the GPIO is done by - read(gpio, 1) + `read(gpio, 1)` See the test/BeagleBone/GPIO_test.jl for more examples. """