Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Anders Blomdell
moberg
Commits
1349c82f
Commit
1349c82f
authored
Mar 28, 2019
by
Anders Blomdell
Browse files
Merge branch 'cont-frb/moberg-review'
parents
f0f5f0fd
ee5e8457
Changes
5
Hide whitespace changes
Inline
Side-by-side
adaptors/julia/AnalogIn.jl
View file @
1349c82f
...
...
@@ -7,16 +7,16 @@ mutable struct AnalogIn
moberg
::
Moberg
index
::
UInt32
channel
::
AnalogInChannel
AnalogIn
(
moberg
::
Moberg
,
index
::
Unsigned
)
=
(
channel
=
AnalogInChannel
(
0
,
0
)
;
function
AnalogIn
(
moberg
::
Moberg
,
index
::
Unsigned
)
channel
=
AnalogInChannel
(
0
,
0
)
checkOK
(
ccall
((
:
moberg_analog_in_open
,
"libmoberg"
),
Status
,
(
Moberg
,
Cint
,
Ref
{
AnalogInChannel
}),
moberg
,
index
,
channel
))
;
self
=
new
(
moberg
,
index
,
channel
)
;
finalizer
(
close
,
self
)
;
moberg
,
index
,
channel
))
self
=
new
(
moberg
,
index
,
channel
)
finalizer
(
close
,
self
)
self
)
end
end
function
close
(
ain
::
AnalogIn
)
...
...
@@ -35,4 +35,3 @@ function read(ain::AnalogIn)
ain
.
channel
.
context
,
result
))
return
result
[]
end
adaptors/julia/AnalogOut.jl
View file @
1349c82f
...
...
@@ -7,16 +7,16 @@ mutable struct AnalogOut
moberg
::
Moberg
index
::
UInt32
channel
::
AnalogOutChannel
AnalogOut
(
moberg
::
Moberg
,
index
::
Unsigned
)
=
(
channel
=
AnalogOutChannel
(
0
,
0
)
;
function
AnalogOut
(
moberg
::
Moberg
,
index
::
Unsigned
)
channel
=
AnalogOutChannel
(
0
,
0
)
checkOK
(
ccall
((
:
moberg_analog_out_open
,
"libmoberg"
),
Status
,
(
Moberg
,
Cint
,
Ref
{
AnalogOutChannel
}),
moberg
,
index
,
channel
));
self
=
new
(
moberg
,
index
,
channel
)
;
finalizer
(
close
,
self
)
;
self
=
new
(
moberg
,
index
,
channel
)
finalizer
(
close
,
self
)
self
)
end
end
function
close
(
aout
::
AnalogOut
)
...
...
@@ -25,7 +25,7 @@ function close(aout::AnalogOut)
Status
,
(
Moberg
,
Cint
,
AnalogOutChannel
),
aout
.
moberg
,
aout
.
index
,
aout
.
channel
))
end
;
end
function
write
(
aout
::
AnalogOut
,
value
::
Cdouble
)
checkOK
(
ccall
(
aout
.
channel
.
write
,
...
...
adaptors/julia/DigitalIn.jl
View file @
1349c82f
...
...
@@ -7,16 +7,16 @@ mutable struct DigitalIn
moberg
::
Moberg
index
::
UInt32
channel
::
DigitalInChannel
DigitalIn
(
moberg
::
Moberg
,
index
::
Unsigned
)
=
(
channel
=
DigitalInChannel
(
0
,
0
)
;
function
DigitalIn
(
moberg
::
Moberg
,
index
::
Unsigned
)
channel
=
DigitalInChannel
(
0
,
0
)
checkOK
(
ccall
((
:
moberg_digital_in_open
,
"libmoberg"
),
Status
,
(
Moberg
,
Cint
,
Ref
{
DigitalInChannel
}),
moberg
,
index
,
channel
));
self
=
new
(
moberg
,
index
,
channel
)
;
finalizer
(
close
,
self
)
;
self
=
new
(
moberg
,
index
,
channel
)
finalizer
(
close
,
self
)
self
)
end
end
function
close
(
din
::
DigitalIn
)
...
...
@@ -35,4 +35,3 @@ function read(din::DigitalIn)
din
.
channel
.
context
,
result
))
return
result
[]
!=
0
end
adaptors/julia/DigitalOut.jl
View file @
1349c82f
...
...
@@ -7,16 +7,16 @@ mutable struct DigitalOut
moberg
::
Moberg
index
::
UInt32
channel
::
DigitalOutChannel
DigitalOut
(
moberg
::
Moberg
,
index
::
Unsigned
)
=
(
channel
=
DigitalOutChannel
(
0
,
0
)
;
function
DigitalOut
(
moberg
::
Moberg
,
index
::
Unsigned
)
channel
=
DigitalOutChannel
(
0
,
0
)
checkOK
(
ccall
((
:
moberg_digital_out_open
,
"libmoberg"
),
Status
,
(
Moberg
,
Cint
,
Ref
{
DigitalOutChannel
}),
moberg
,
index
,
channel
))
;
self
=
new
(
moberg
,
index
,
channel
)
;
finalizer
(
close
,
self
)
;
moberg
,
index
,
channel
))
self
=
new
(
moberg
,
index
,
channel
)
finalizer
(
close
,
self
)
self
)
end
end
function
close
(
dout
::
DigitalOut
)
...
...
@@ -25,7 +25,7 @@ function close(dout::DigitalOut)
Status
,
(
Moberg
,
Cint
,
DigitalOutChannel
),
dout
.
moberg
,
dout
.
index
,
dout
.
channel
))
end
;
end
function
write
(
dout
::
DigitalOut
,
value
::
Bool
)
checkOK
(
ccall
(
dout
.
channel
.
write
,
...
...
adaptors/julia/EncoderIn.jl
View file @
1349c82f
...
...
@@ -7,16 +7,16 @@ mutable struct EncoderIn
moberg
::
Moberg
index
::
UInt32
channel
::
EncoderInChannel
EncoderIn
(
moberg
::
Moberg
,
index
::
Unsigned
)
=
(
channel
=
EncoderInChannel
(
0
,
0
)
;
function
EncoderIn
(
moberg
::
Moberg
,
index
::
Unsigned
)
channel
=
EncoderInChannel
(
0
,
0
)
checkOK
(
ccall
((
:
moberg_encoder_in_open
,
"libmoberg"
),
Status
,
(
Moberg
,
Cint
,
Ref
{
EncoderInChannel
}),
moberg
,
index
,
channel
))
;
self
=
new
(
moberg
,
index
,
channel
)
;
finalizer
(
close
,
self
)
;
moberg
,
index
,
channel
))
self
=
new
(
moberg
,
index
,
channel
)
finalizer
(
close
,
self
)
self
)
end
end
function
close
(
ein
::
EncoderIn
)
...
...
@@ -35,4 +35,3 @@ function read(ein::EncoderIn)
ein
.
channel
.
context
,
result
))
return
result
[]
end
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment