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
6de19cac
Commit
6de19cac
authored
Apr 28, 2014
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fald-acq: add external trigger option
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
7ad2149e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
fald-acq.c
libtools/fald-acq.c
+10
-2
fald-trg-cfg.c
libtools/fald-trg-cfg.c
+1
-1
No files found.
libtools/fald-acq.c
View file @
6de19cac
...
...
@@ -45,6 +45,7 @@ static void fald_help()
printf
(
" --nshots|-n <num> number of trigger shots
\n
"
);
printf
(
" --delay|-d <num> delay sample after trigger
\n
"
);
printf
(
" --under-sample|-u|-D <num> pick 1 sample every <num>
\n
"
);
printf
(
" --external|-e use external trigger
\n
"
);
printf
(
" --threshold|-t <num> internal trigger threshold
\n
"
);
printf
(
" --channel|-c <num> channel used as trigger (1..4)
\n
"
);
printf
(
" --range|-r <num> channel input range: "
...
...
@@ -70,6 +71,8 @@ static struct option options[] = {
{
"nshots"
,
required_argument
,
0
,
'n'
},
{
"delay"
,
required_argument
,
0
,
'd'
},
{
"under-sample"
,
required_argument
,
0
,
'u'
},
{
"external"
,
no_argument
,
&
trg_cfgval
[
FMCADC_CONF_TRG_SOURCE
],
1
},
{
"threshold"
,
required_argument
,
0
,
't'
},
{
"channel"
,
required_argument
,
0
,
'c'
},
{
"timeout"
,
required_argument
,
0
,
'T'
},
...
...
@@ -98,7 +101,7 @@ static struct option options[] = {
{
0
,
0
,
0
,
0
}
};
#define GETOPT_STRING "b:a:n:d:u:t:c:T:B:M:N:l:s:r:g:X:p:P:D:h"
#define GETOPT_STRING "b:a:n:d:u:t:c:T:B:M:N:l:s:r:g:X:p:P:D:h
e
"
/* variables shared between threads */
static
struct
fmcadc_dev
*
adc
;
...
...
@@ -233,10 +236,13 @@ void parse_args(int argc, char *argv[])
fprintf
(
stdout
,
"FMCADC_CONF_TRG_SOURCE_CHAN: %d
\n
"
,
atoi
(
optarg
));
/* set internal, and then the channel */
fmcadc_set_conf
(
&
trg_cfg
,
FMCADC_CONF_TRG_SOURCE
,
0
);
trg_cfgval
[
FMCADC_CONF_TRG_SOURCE
]
=
0
;
/* set later */
fmcadc_set_conf
(
&
trg_cfg
,
FMCADC_CONF_TRG_SOURCE_CHAN
,
val
-
1
);
break
;
case
'e'
:
trg_cfgval
[
FMCADC_CONF_TRG_SOURCE
]
=
1
;
break
;
case
'T'
:
timeout
=
atoi
(
optarg
);
break
;
...
...
@@ -281,6 +287,8 @@ void parse_args(int argc, char *argv[])
/* Configure trigger (pick trigger polarity from external array) */
fmcadc_set_conf
(
&
trg_cfg
,
FMCADC_CONF_TRG_POLARITY
,
trg_cfgval
[
FMCADC_CONF_TRG_POLARITY
]);
fmcadc_set_conf
(
&
trg_cfg
,
FMCADC_CONF_TRG_SOURCE
,
trg_cfgval
[
FMCADC_CONF_TRG_SOURCE
]);
}
void
apply_config
()
...
...
libtools/fald-trg-cfg.c
View file @
6de19cac
...
...
@@ -26,7 +26,7 @@ int main()
/* get user input */
for
(;;)
{
memset
(
msg
,
0
,
512
);
fprintf
(
stdout
,
"Change trig config using standard args: -a -b -c -n
\n
>>>: "
);
fprintf
(
stdout
,
"Change trig config using standard args: -a -b -c -n
-e
\n
>>>: "
);
ptr
=
fgets
(
msg
,
sizeof
(
msg
),
stdin
);
/* removing newline at the end */
if
(
msg
[
strlen
(
msg
)
-
1
]
==
'\n'
)
...
...
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