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
fecd08f3
Commit
fecd08f3
authored
Jul 21, 2015
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: make them really generic
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
9050ac83
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
10 deletions
+19
-10
fald-acq.c
libtools/fald-acq.c
+12
-4
fald-simple-get-conf.c
libtools/fald-simple-get-conf.c
+7
-6
No files found.
libtools/fald-acq.c
View file @
fecd08f3
...
...
@@ -37,8 +37,13 @@ static void fald_acq_stop(struct adc_dev *adc, char *called_from);
static
void
fald_help
()
{
printf
(
"
\n
fald-simple-acq [OPTIONS] 0x<device-id>
\n\n
"
);
printf
(
" <device-id>: FMC identifier (e.g.:
\"
0x0400
\"
)
\n
"
);
int
i
;
printf
(
"
\n
fald-simple-acq [OPTIONS] <device-name> 0x<device-id>
\n\n
"
);
printf
(
" <device-name>: name of the device to open
\n
"
);
for
(
i
=
0
;
i
<
__ADC_SUPPORTED_BOARDS_LAST_INDEX
;
i
++
)
printf
(
" %s
\n
"
,
adc_supported_board_names
[
i
]);
printf
(
" <device-id>: unique device identifier (e.g.:
\"
0x0400
\"
)
\n
"
);
printf
(
" --before|-b <num> number of pre samples
\n
"
);
printf
(
" --after|-a <num> n. of post samples (default: 16)
\n
"
);
printf
(
" --nshots|-n <num> number of trigger shots
\n
"
);
...
...
@@ -845,6 +850,7 @@ int main(int argc, char *argv[])
{
struct
adc_dev
*
adc
;
struct
adc_buffer
*
buf
;
char
*
devname
;
int
i
,
err
;
if
(
argc
==
1
)
{
...
...
@@ -855,11 +861,13 @@ int main(int argc, char *argv[])
}
/* set local _argv[0] with pg name */
_argv
[
0
]
=
argv
[
0
];
/* devid is the last arg */
/* device name and id are the last two arguments */
devname
=
argv
[
argc
-
2
];
sscanf
(
argv
[
argc
-
1
],
"%x"
,
&
devid
);
/* Open the ADC */
adc
=
adc_open
(
"fmc-adc-100m14b4cha"
,
devid
,
adc
=
adc_open
(
devname
,
devid
,
/* nshots * (presamples + postsamples) */
/*
acq.value[ADC_CONF_ACQ_N_SHOTS] *
...
...
libtools/fald-simple-get-conf.c
View file @
fecd08f3
...
...
@@ -18,9 +18,9 @@
static
void
fald_help
()
{
printf
(
"
\n
fald-simple-get-conf [OPTIONS]
0x<DEVICE ID
>
\n\n
"
);
printf
(
" <
DEVICE>: hexadecimal string which represent the device "
"identificator of an fmc-adc
\n
"
);
printf
(
"
\n
fald-simple-get-conf [OPTIONS]
<device-name> 0x<device-id
>
\n\n
"
);
printf
(
" <
device-name>: name of the device to open
\n
"
);
printf
(
" <device-id>: unique device identifier (e.g.:
\"
0x0400
\"
)
\n
"
);
printf
(
" --help|-h: show this help
\n\n
"
);
}
...
...
@@ -34,7 +34,7 @@ int main(int argc, char *argv[])
};
int
opt_index
=
0
,
err
=
0
,
i
;
unsigned
int
dev_id
=
0
;
char
c
;
char
c
,
*
devname
;
if
(
argc
==
1
)
{
fald_help
();
...
...
@@ -56,17 +56,18 @@ int main(int argc, char *argv[])
}
if
(
optind
!=
argc
-
1
)
{
fprintf
(
stderr
,
"%s: DEVICE-ID
is a mandatory argument
\n
"
,
fprintf
(
stderr
,
"%s: DEVICE-ID
and DEVICE-NAME are mandatory arguments
\n
"
,
argv
[
0
]);
fald_help
();
exit
(
1
);
}
else
{
devname
=
argv
[
argc
-
2
];
sscanf
(
argv
[
optind
],
"0x%x"
,
&
dev_id
);
}
printf
(
"Open ADC dev_id 0x%04x ...
\n
"
,
dev_id
);
/* Open the ADC */
adc
=
adc_open
(
"adc_100MS_4ch_14bit"
,
dev_id
,
adc
=
adc_open
(
devname
,
dev_id
,
/* no buffers expexted */
0
,
0
,
/* no flush either */
0
);
if
(
!
adc
)
{
...
...
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