Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
adc-lib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
adc-lib
Commits
53c0e127
Commit
53c0e127
authored
Aug 10, 2020
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tst: add external trigger get/set test
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
07bdb5f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
test_adc_getter_setter.py
pytest/fmc-adc-100m14b4cha/test_adc_getter_setter.py
+40
-0
No files found.
pytest/fmc-adc-100m14b4cha/test_adc_getter_setter.py
View file @
53c0e127
...
...
@@ -229,3 +229,43 @@ class TestAdcGetterSetterTriggerThreshold(object):
adc100m14b4cha
.
retrieve_config
(
conf_rb
)
assert
0
==
conf_rb
.
value_get
(
PyAdcConf
.
ADC_CONF_TRG_THR_HYSTERESIS
)
class
TestAdcGetterSetterTriggerExternal
(
object
):
@
pytest
.
mark
.
parametrize
(
"enable"
,
[
True
,
False
])
def
test_adc_enable
(
self
,
adc100m14b4cha
,
enable
):
"""Test that we can enable and disable a trigger external"""
conf
=
PyAdcConf
(
PyAdcConf
.
ADC_CONF_TYPE_TRG_EXT
,
0
)
conf
.
value_set
(
PyAdcConf
.
ADC_CONF_TRG_EXT_ENABLE
,
int
(
enable
))
assert
conf
.
value_get
(
PyAdcConf
.
ADC_CONF_TRG_EXT_ENABLE
)
==
int
(
enable
)
adc100m14b4cha
.
apply_config
(
conf
,
0
)
conf_rb
=
PyAdcConf
(
PyAdcConf
.
ADC_CONF_TYPE_TRG_EXT
,
0
)
conf_rb
.
mask_set
(
PyAdcConf
.
ADC_CONF_TRG_EXT_ENABLE
)
adc100m14b4cha
.
retrieve_config
(
conf_rb
)
assert
conf
.
value_get
(
PyAdcConf
.
ADC_CONF_TRG_EXT_ENABLE
)
==
conf_rb
.
value_get
(
PyAdcConf
.
ADC_CONF_TRG_EXT_ENABLE
)
@
pytest
.
mark
.
parametrize
(
"polarity"
,
[
0
,
1
])
def
test_adc_polarity
(
self
,
adc100m14b4cha
,
polarity
):
"""Test that we can set the polarity"""
conf
=
PyAdcConf
(
PyAdcConf
.
ADC_CONF_TYPE_TRG_EXT
,
0
)
conf
.
value_set
(
PyAdcConf
.
ADC_CONF_TRG_EXT_POLARITY
,
int
(
polarity
))
assert
conf
.
value_get
(
PyAdcConf
.
ADC_CONF_TRG_EXT_POLARITY
)
==
int
(
polarity
)
adc100m14b4cha
.
apply_config
(
conf
,
0
)
conf_rb
=
PyAdcConf
(
PyAdcConf
.
ADC_CONF_TYPE_TRG_EXT
,
0
)
conf_rb
.
mask_set
(
PyAdcConf
.
ADC_CONF_TRG_EXT_POLARITY
)
adc100m14b4cha
.
retrieve_config
(
conf_rb
)
assert
conf
.
value_get
(
PyAdcConf
.
ADC_CONF_TRG_EXT_POLARITY
)
==
conf_rb
.
value_get
(
PyAdcConf
.
ADC_CONF_TRG_EXT_POLARITY
)
@
pytest
.
mark
.
parametrize
(
"delay"
,
[
2
**
x
for
x
in
range
(
32
)])
def
test_adc_delay
(
self
,
adc100m14b4cha
,
delay
):
"""Test that we set the trigger delay"""
conf
=
PyAdcConf
(
PyAdcConf
.
ADC_CONF_TYPE_TRG_EXT
,
0
)
conf
.
value_set
(
PyAdcConf
.
ADC_CONF_TRG_EXT_DELAY
,
int
(
delay
))
assert
conf
.
value_get
(
PyAdcConf
.
ADC_CONF_TRG_EXT_DELAY
)
==
int
(
delay
)
adc100m14b4cha
.
apply_config
(
conf
,
0
)
conf_rb
=
PyAdcConf
(
PyAdcConf
.
ADC_CONF_TYPE_TRG_EXT
,
0
)
conf_rb
.
mask_set
(
PyAdcConf
.
ADC_CONF_TRG_EXT_DELAY
)
adc100m14b4cha
.
retrieve_config
(
conf_rb
)
assert
conf
.
value_get
(
PyAdcConf
.
ADC_CONF_TRG_EXT_DELAY
)
==
conf_rb
.
value_get
(
PyAdcConf
.
ADC_CONF_TRG_EXT_DELAY
)
Write
Preview
Markdown
is supported
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