Skip to content
Snippets Groups Projects
Commit c324aa20 authored by Mattias Fält's avatar Mattias Fält
Browse files

Exports

parent 769ee42b
No related branches found
No related tags found
1 merge request!1Bufferandcomedi
export AnalogInput10V export AnalogInput10V, AnalogOutput10V
mutable struct AnalogInput10V <: AbstractDevice mutable struct AnalogInput10V <: AbstractDevice
i::Int32 i::Int32
......
...@@ -30,16 +30,16 @@ end ...@@ -30,16 +30,16 @@ end
function send(bbstream::BeagleBoneStream) function send(bbstream::BeagleBoneStream)
ncmds = length(bbstream.sendbuffer) ncmds = length(bbstream.sendbuffer)
serialize(bbstream.stream, (true, ncmds, bbstream.sendbuffer)) serialize(bbstream.stream, (true, Int32(ncmds), bbstream.sendbuffer...))
empty!(bbstream.sendbuffer) empty!(bbstream.sendbuffer)
return return
end end
function read(comedistream::BeagleBoneStream) function read(comedistream::BeagleBoneStream)
ncmds = length(bbstream.readbuffer) ncmds = length(bbstream.readbuffer)
serialize(bbstream.stream, (false, ncmds, bbstream.sendbuffer)) serialize(bbstream.stream, (false, Int32(ncmds), bbstream.readbuffer...))
#TODO wait for answer #TODO wait for answer
vals = nothing vals = nothing
empty!(bbstream.sendbuffer) empty!(bbstream.readbuffer)
return vals return vals
end end
# #
...@@ -82,14 +82,13 @@ end ...@@ -82,14 +82,13 @@ end
function send(bbstream::BeagleBoneStream, cmd) function send(bbstream::BeagleBoneStream, cmd)
allcmds = (true, Int32(1), cmd) allcmds = (true, Int32(1), cmd)
println("Sending single command: $allcmds") println("Sending single command: $allcmds")
serialize(stream, allcmds) serialize(bbstream.stream, allcmds)
return return
end end
function read(bbstream::BeagleBoneStream, cmd) function read(bbstream::BeagleBoneStream, cmd)
cmd, stream = safe_getreadcommand(dev)
allcmds = (false, Int32(1), cmd) allcmds = (false, Int32(1), cmd)
println("Sending single command: $allcmds") println("Sending single command: $allcmds")
serialize(stream, allcmds) serialize(bbstream.stream, allcmds)
#TODO get, wait for and return response #TODO get, wait for and return response
return return
end end
......
...@@ -34,3 +34,4 @@ include("BeagleBoneStream.jl") ...@@ -34,3 +34,4 @@ include("BeagleBoneStream.jl")
#Include the device definitions #Include the device definitions
include("SysLED.jl") include("SysLED.jl")
include("10V.jl")
export LabStream
abstract type LabStream end abstract type LabStream end
function close(stream::LabStream) function close(stream::LabStream)
......
...@@ -3,7 +3,7 @@ export SysLED ...@@ -3,7 +3,7 @@ export SysLED
mutable struct SysLED <: AbstractDevice mutable struct SysLED <: AbstractDevice
i::Int32 i::Int32
stream::LabStream stream::LabStream
SysLED(i::Int32) = new(i, false, false) SysLED(i::Int32) = new(i)
end end
SysLED(i::Int64) = SysLED(convert(Int32, i)) SysLED(i::Int64) = SysLED(convert(Int32, i))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment