Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
whuie2
experiment-control
Commits
e350a8d3
Commit
e350a8d3
authored
Dec 22, 2021
by
whooie
Browse files
add stuff for a5791 dac
parent
3893d91b
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/__init__.py
View file @
e350a8d3
...
@@ -26,7 +26,9 @@ from lib.system import (
...
@@ -26,7 +26,9 @@ from lib.system import (
CONNECTIONS
,
CONNECTIONS
,
FLIR
,
FLIR
,
MOGRF
,
MOGRF
,
ad5791_init_val
,
AD5791_INIT
,
AD5791_CTRL
,
AD5791_DAC
,
)
)
from
lib.dataio
import
(
from
lib.dataio
import
(
get_timestamp
,
get_timestamp
,
...
...
lib/system.py
View file @
e350a8d3
...
@@ -40,6 +40,9 @@ CONNECTIONS = ConnectionLayout(
...
@@ -40,6 +40,9 @@ CONNECTIONS = ConnectionLayout(
mot3_coils_onoff
=
Digital
(
0
,
2
,
1
),
mot3_coils_onoff
=
Digital
(
0
,
2
,
1
),
mot3_coils_cur
=
Analog
(
0
,
3.45
),
mot3_coils_cur
=
Analog
(
0
,
3.45
),
mot3_coils_vol
=
Analog
(
1
,
7.00
),
mot3_coils_vol
=
Analog
(
1
,
7.00
),
mot3_coils_sig
=
Digital
(
0
,
8
,
0
),
mot3_coils_clk
=
Digital
(
0
,
10
,
0
),
mot3_coils_sync
=
Digital
(
0
,
14
,
1
),
shim_coils_ud
=
Analog
(
2
,
0.00
),
shim_coils_ud
=
Analog
(
2
,
0.00
),
shim_coils_lr
=
Analog
(
3
,
0.00
),
shim_coils_lr
=
Analog
(
3
,
0.00
),
shim_coils_fb
=
Analog
(
4
,
0.00
),
shim_coils_fb
=
Analog
(
4
,
0.00
),
...
@@ -74,20 +77,7 @@ FLIR = Grasshopper(FLIR_SERIAL)
...
@@ -74,20 +77,7 @@ FLIR = Grasshopper(FLIR_SERIAL)
MOGRF_COM
=
3
MOGRF_COM
=
3
MOGRF
=
MOGDriver
(
"COM"
,
MOGRF_COM
)
MOGRF
=
MOGDriver
(
"COM"
,
MOGRF_COM
)
def
ad5791_init_val
(
register
:
int
,
value
:
int
)
->
int
:
AD5791_CTRL
=
0b0010
"""
AD5791_INIT
=
0b00000000000000010010
Returns the 24-bit integer value to send to the AD5791 DAC encoding the
AD5791_DAC
=
0b0001
operation mode.
Parameters
----------
register : uint8
value : uint24
"""
r
=
register
%
256
B10
=
value
%
65536
B2
=
(
value
>>
16
)
%
256
return
(((
B2
&
0x0f
)
|
r
)
<<
16
)
+
B10
AD5791_CTRL
=
ad5791_init_val
(
0x20
,
0x0012
)
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