Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
FMC ADC 100M 14b 4cha - Software
Commits
d44cd644
Commit
d44cd644
authored
Oct 10, 2014
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib: path to zio attributes is changed
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
203413f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
49 deletions
+82
-49
config-zio.c
lib/config-zio.c
+80
-47
fmc-adc-100m14b4cha.c
lib/fmc-adc-100m14b4cha.c
+2
-2
No files found.
lib/config-zio.c
View file @
d44cd644
...
...
@@ -164,51 +164,63 @@ static int fmcadc_zio_config_trg(struct __fmcadc_dev_zio *fa,
switch
(
index
)
{
case
FMCADC_CONF_TRG_SOURCE
:
if
(
direction
)
return
fa_zio_sysfs_set
(
fa
,
"cset0/trigger/external"
,
value
);
return
fa_zio_sysfs_set
(
fa
,
"cset0/trigger/instance-attributes/external"
,
value
);
else
return
fa_zio_sysfs_get
(
fa
,
"cset0/trigger/external"
,
value
);
return
fa_zio_sysfs_get
(
fa
,
"cset0/trigger/instance-attributes/external"
,
value
);
break
;
case
FMCADC_CONF_TRG_SOURCE_CHAN
:
if
(
direction
)
return
fa_zio_sysfs_set
(
fa
,
"cset0/trigger/int-channel"
,
value
);
return
fa_zio_sysfs_set
(
fa
,
"cset0/trigger/instance-attributes/int-channel"
,
value
);
else
return
fa_zio_sysfs_get
(
fa
,
"cset0/trigger/int-channel"
,
value
);
return
fa_zio_sysfs_get
(
fa
,
"cset0/trigger/instance-attributes/int-channel"
,
value
);
break
;
case
FMCADC_CONF_TRG_THRESHOLD
:
if
(
direction
)
return
fa_zio_sysfs_set
(
fa
,
"cset0/trigger/int-threshold"
,
value
);
"cset0/trigger/instance-attributes/int-threshold"
,
value
);
else
return
fa_zio_sysfs_get
(
fa
,
"cset0/trigger/int-threshold"
,
value
);
"cset0/trigger/instance-attributes/int-threshold"
,
value
);
break
;
case
FMCADC_CONF_TRG_POLARITY
:
if
(
direction
)
return
fa_zio_sysfs_set
(
fa
,
"cset0/trigger/polarity"
,
value
);
return
fa_zio_sysfs_set
(
fa
,
"cset0/trigger/instance-attributes/polarity"
,
value
);
else
return
fa_zio_sysfs_get
(
fa
,
"cset0/trigger/polarity"
,
value
);
return
fa_zio_sysfs_get
(
fa
,
"cset0/trigger/instance-attributes/polarity"
,
value
);
break
;
case
FMCADC_CONF_TRG_DELAY
:
if
(
direction
)
return
fa_zio_sysfs_set
(
fa
,
"cset0/trigger/delay"
,
value
);
return
fa_zio_sysfs_set
(
fa
,
"cset0/trigger/instance-attributes/delay"
,
value
);
else
return
fa_zio_sysfs_get
(
fa
,
"cset0/trigger/delay"
,
value
);
return
fa_zio_sysfs_get
(
fa
,
"cset0/trigger/instance-attributes/delay"
,
value
);
break
;
case
FMCADC_CONF_TRG_THRESHOLD_FILTER
:
if
(
direction
)
return
fa_zio_sysfs_set
(
fa
,
"cset0/trigger/int-threshold-filter"
,
value
);
return
fa_zio_sysfs_set
(
fa
,
"cset0/trigger/instance-attributes/int-threshold-filter"
,
value
);
else
return
fa_zio_sysfs_get
(
fa
,
"cset0/trigger/int-threshold-filter"
,
value
);
return
fa_zio_sysfs_get
(
fa
,
"cset0/trigger/instance-attributes/int-threshold-filter"
,
value
);
break
;
default:
errno
=
FMCADC_ENOCAP
;
...
...
@@ -221,35 +233,43 @@ static int fmcadc_zio_config_acq(struct __fmcadc_dev_zio *fa,
switch
(
index
)
{
case
FMCADC_CONF_ACQ_N_SHOTS
:
if
(
direction
)
return
fa_zio_sysfs_set
(
fa
,
"cset0/trigger/nshots"
,
value
);
return
fa_zio_sysfs_set
(
fa
,
"cset0/trigger/instance-attributes/nshots"
,
value
);
else
return
fa_zio_sysfs_get
(
fa
,
"cset0/trigger/nshots"
,
value
);
return
fa_zio_sysfs_get
(
fa
,
"cset0/trigger/instance-attributes/nshots"
,
value
);
break
;
case
FMCADC_CONF_ACQ_POST_SAMP
:
if
(
direction
)
return
fa_zio_sysfs_set
(
fa
,
"cset0/trigger/post-samples"
,
value
);
"cset0/trigger/instance-attributes/post-samples"
,
value
);
else
return
fa_zio_sysfs_get
(
fa
,
"cset0/trigger/post-samples"
,
value
);
"cset0/trigger/instance-attributes/post-samples"
,
value
);
break
;
case
FMCADC_CONF_ACQ_PRE_SAMP
:
if
(
direction
)
return
fa_zio_sysfs_set
(
fa
,
"cset0/trigger/pre-samples"
,
value
);
return
fa_zio_sysfs_set
(
fa
,
"cset0/trigger/instance-attributes/pre-samples"
,
value
);
else
return
fa_zio_sysfs_get
(
fa
,
"cset0/trigger/pre-samples"
,
value
);
return
fa_zio_sysfs_get
(
fa
,
"cset0/trigger/instance-attributes/pre-samples"
,
value
);
break
;
case
FMCADC_CONF_ACQ_DECIMATION
:
if
(
direction
)
return
fa_zio_sysfs_set
(
fa
,
"cset0/sample-decimation"
,
value
);
return
fa_zio_sysfs_set
(
fa
,
"cset0/instance-attributes/sample-decimation"
,
value
);
else
return
fa_zio_sysfs_get
(
fa
,
"cset0/sample-decimation"
,
value
);
return
fa_zio_sysfs_get
(
fa
,
"cset0/instance-attributes/sample-decimation"
,
value
);
break
;
case
FMCADC_CONF_ACQ_FREQ_HZ
:
if
(
direction
)
{
...
...
@@ -281,28 +301,32 @@ static int fmcadc_zio_config_chn(struct __fmcadc_dev_zio *fa, unsigned int ch,
switch
(
index
)
{
case
FMCADC_CONF_CHN_RANGE
:
sprintf
(
path
,
"cset%d/ch%d-vref"
,
fa
->
cset
,
ch
);
sprintf
(
path
,
"cset%d/instance-attributes/ch%d-vref"
,
fa
->
cset
,
ch
);
if
(
direction
)
return
fa_zio_sysfs_set
(
fa
,
path
,
value
);
else
return
fa_zio_sysfs_get
(
fa
,
path
,
value
);
break
;
case
FMCADC_CONF_CHN_TERMINATION
:
sprintf
(
path
,
"cset%d/ch%d-50ohm-term"
,
fa
->
cset
,
ch
);
sprintf
(
path
,
"cset%d/instance-attributes/ch%d-50ohm-term"
,
fa
->
cset
,
ch
);
if
(
direction
)
return
fa_zio_sysfs_set
(
fa
,
path
,
value
);
else
return
fa_zio_sysfs_get
(
fa
,
path
,
value
);
break
;
case
FMCADC_CONF_CHN_OFFSET
:
sprintf
(
path
,
"cset%d/ch%d-offset"
,
fa
->
cset
,
ch
);
sprintf
(
path
,
"cset%d/instance-attributes/ch%d-offset"
,
fa
->
cset
,
ch
);
if
(
direction
)
return
fa_zio_sysfs_set
(
fa
,
path
,
value
);
else
return
fa_zio_sysfs_get
(
fa
,
path
,
value
);
break
;
case
FMCADC_CONF_CHN_SATURATION
:
sprintf
(
path
,
"cset%d/ch%d-saturation"
,
fa
->
cset
,
ch
);
sprintf
(
path
,
"cset%d/instance-attributes/ch%d-saturation"
,
fa
->
cset
,
ch
);
if
(
direction
)
return
fa_zio_sysfs_set
(
fa
,
path
,
value
);
else
...
...
@@ -321,23 +345,28 @@ static int fmcadc_zio_config_brd(struct __fmcadc_dev_zio *fa,
switch
(
index
)
{
case
FMCADC_CONF_UTC_TIMING_BASE_S
:
if
(
direction
)
return
fa_zio_sysfs_set
(
fa
,
"cset0/tstamp-base-s"
,
return
fa_zio_sysfs_set
(
fa
,
"cset0/instance-attributes/tstamp-base-s"
,
value
);
else
return
fa_zio_sysfs_get
(
fa
,
"cset0/tstamp-base-s"
,
return
fa_zio_sysfs_get
(
fa
,
"cset0/instance-attributes/tstamp-base-s"
,
value
);
break
;
case
FMCADC_CONF_UTC_TIMING_BASE_T
:
if
(
direction
)
return
fa_zio_sysfs_set
(
fa
,
"cset0/tstamp-base-t"
,
return
fa_zio_sysfs_set
(
fa
,
"cset0/instance-attributes/tstamp-base-t"
,
value
);
else
return
fa_zio_sysfs_get
(
fa
,
"cset0/tstamp-base-t"
,
return
fa_zio_sysfs_get
(
fa
,
"cset0/instance-attributes/tstamp-base-t"
,
value
);
break
;
case
FMCADC_CONF_BRD_STATE_MACHINE_STATUS
:
if
(
!
direction
)
return
fa_zio_sysfs_get
(
fa
,
"cset0/fsm-state"
,
return
fa_zio_sysfs_get
(
fa
,
"cset0/instance-attributes/fsm-state"
,
value
);
errno
=
EINVAL
;
return
-
1
;
...
...
@@ -363,12 +392,16 @@ static int fmcadc_zio_config(struct __fmcadc_dev_zio *fa, unsigned int flags,
/* Disabling the trigger before changing configuration */
if
(
direction
)
{
err
=
fa_zio_sysfs_get
(
fa
,
"cset0/trigger/enable"
,
&
enabled
);
err
=
fa_zio_sysfs_get
(
fa
,
"cset0/trigger/enable"
,
&
enabled
);
if
(
err
)
return
err
;
if
(
enabled
)
{
enabled
=
0
;
err
=
fa_zio_sysfs_set
(
fa
,
"cset0/trigger/enable"
,
&
enabled
);
err
=
fa_zio_sysfs_set
(
fa
,
"cset0/trigger/enable"
,
&
enabled
);
/* restore the initial value */
enabled
=
1
;
}
...
...
lib/fmc-adc-100m14b4cha.c
View file @
d44cd644
...
...
@@ -177,7 +177,7 @@ int fmcadc_zio_acq_start(struct fmcadc_dev *dev,
if
(
fmcadc_flush_input
(
fa
)
<
0
)
return
-
1
;
err
=
fa_zio_sysfs_set
(
fa
,
"cset0/fsm-command"
,
&
cmd
);
err
=
fa_zio_sysfs_set
(
fa
,
"cset0/
instance-attributes/
fsm-command"
,
&
cmd
);
if
(
err
)
return
err
;
...
...
@@ -192,7 +192,7 @@ int fmcadc_zio_acq_stop(struct fmcadc_dev *dev, unsigned int flags)
struct
__fmcadc_dev_zio
*
fa
=
to_dev_zio
(
dev
);
uint32_t
cmd
=
2
;
/* hw command for "stop" */
return
fa_zio_sysfs_set
(
fa
,
"cset0/fsm-command"
,
&
cmd
);
return
fa_zio_sysfs_set
(
fa
,
"cset0/
instance-attributes/
fsm-command"
,
&
cmd
);
}
...
...
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