Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
Beam Positoning Monitor - Software
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
Beam Positoning Monitor - Software
Commits
16701b4a
Commit
16701b4a
authored
Feb 20, 2015
by
Lucas Russo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
examples/fmc130m_4ch_ctl.c: add clk_sel option
parent
b6b5a445
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
fmc130m_4ch_ctl.c
examples/fmc130m_4ch_ctl.c
+21
-0
No files found.
examples/fmc130m_4ch_ctl.c
View file @
16701b4a
...
...
@@ -28,6 +28,7 @@ void print_help (char *program_name)
"
\t
-b <broker_endpoint> Broker endpoint
\n
"
"
\t
-pll_status PLL Lock status
\n
"
"
\t
-trig_dir <dir> Trigger direction
\n
"
"
\t
-clk_sel <sel = [0(FMC front panel)|1(FMC pin)]> Clock selection
\n
"
,
program_name
);
}
...
...
@@ -38,6 +39,7 @@ int main (int argc, char *argv [])
char
*
board_number_str
=
NULL
;
char
*
bpm_number_str
=
NULL
;
char
*
trig_dir_str
=
NULL
;
char
*
clk_sel_str
=
NULL
;
uint32_t
get_pll_status
=
0
;
char
**
str_p
=
NULL
;
...
...
@@ -78,6 +80,9 @@ int main (int argc, char *argv [])
else
if
(
streq
(
argv
[
i
],
"-trig_dir"
))
{
str_p
=
&
trig_dir_str
;
}
else
if
(
streq
(
argv
[
i
],
"-clk_sel"
))
{
str_p
=
&
clk_sel_str
;
}
/* Fallout for options with parameters */
else
{
*
str_p
=
strdup
(
argv
[
i
]);
...
...
@@ -143,6 +148,19 @@ int main (int argc, char *argv [])
fprintf
(
stdout
,
"[client:fmc130m_4ch]: bpm_set_trig_dir was successfully executed
\n
"
);
}
uint32_t
clk_sel
=
0
;
if
(
clk_sel_str
!=
NULL
)
{
clk_sel
=
strtoul
(
clk_sel_str
,
NULL
,
10
);
fprintf
(
stdout
,
"[client:fmc130m_4ch]: clk_sel = %u
\n
"
,
clk_sel
);
err
=
bpm_set_fmc_clk_sel
(
bpm_client
,
service
,
clk_sel
);
if
(
err
!=
BPM_CLIENT_SUCCESS
){
fprintf
(
stderr
,
"[client:fmc130m_4ch]: bpm_set_fmc_clk_sel failed
\n
"
);
goto
err_bpm_exit
;
}
fprintf
(
stdout
,
"[client:fmc130m_4ch]: bpm_set_fmc_clk_sel was successfully executed
\n
"
);
}
if
(
get_pll_status
)
{
uint32_t
pll_status
=
0
;
bpm_client_err_e
err
=
bpm_get_fmc_pll_status
(
bpm_client
,
service
,
&
pll_status
);
...
...
@@ -156,6 +174,9 @@ int main (int argc, char *argv [])
err_bpm_exit:
bpm_client_destroy
(
&
bpm_client
);
str_p
=
&
clk_sel_str
;
free
(
*
str_p
);
clk_sel_str
=
NULL
;
str_p
=
&
trig_dir_str
;
free
(
*
str_p
);
trig_dir_str
=
NULL
;
...
...
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