Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
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
White Rabbit Switch - Software
Commits
aca42742
Commit
aca42742
authored
Sep 17, 2018
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userspace/tools: add get/set of 50ohm termination of 1-PPS input to wrs_pps_control
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
db87b6b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
11 deletions
+51
-11
wrs-user-manual.in
doc/wrs-user-manual.in
+2
-1
wrs_pps_control.c
userspace/tools/wrs_pps_control.c
+49
-10
No files found.
doc/wrs-user-manual.in
View file @
aca42742
...
...
@@ -1857,7 +1857,8 @@ The following tools and scripts are provided:
@item wrs
_
pps
_
control
A tool to switch the PPS output on and off. Usage: ``@t
{
wrs
_
pps
_
control
on
}
'' switches the PPS output on, and ``@t
{
wrs
_
pps
_
control off
}
''
pps on
}
'' switches the PPS output on, and
``@t
{
wrs
_
pps
_
control pps off
}
''
switches the PPS output off. Switching the output on/off is independent
of the PPSi process, but PPSi switches the PPS output back on when a
link restart is detected and PPSi comes into @t
{
'TRACK
_
PHASE'
}
state.
...
...
userspace/tools/wrs_pps_control.c
View file @
aca42742
...
...
@@ -18,8 +18,8 @@ void help(char *prgname)
" -h print help
\n
"
"
\n
"
" Commands are:
\n
"
"
on - switch PPS output on
.
\n
"
"
off - switch PPS output off.
\n
"
);
"
pps <on|off> - switch PPS output on/off
.
\n
"
"
50ohm-term-in <on|off|read> - on/off/read 50ohm termination for 1-PPS input
\n
"
);
exit
(
1
);
}
...
...
@@ -36,14 +36,53 @@ int main(int argc, char *argv[])
}
if
(
argc
>
1
)
{
if
(
strcmp
(
argv
[
1
],
"on"
)
==
0
)
{
assert_init
(
shw_fpga_mmap_init
());
shw_pps_gen_enable_output
(
PPS_ON
);
exit
(
0
);
}
else
if
(
strcmp
(
argv
[
1
],
"off"
)
==
0
)
{
assert_init
(
shw_fpga_mmap_init
());
shw_pps_gen_enable_output
(
PPS_OFF
);
exit
(
0
);
if
(
!
strcmp
(
argv
[
1
],
"pps"
))
{
if
(
argc
<
3
)
{
printf
(
"No parameter given
\n
;"
);
exit
(
1
);
}
if
(
!
strcmp
(
argv
[
2
],
"on"
))
{
assert_init
(
shw_fpga_mmap_init
());
shw_pps_gen_enable_output
(
PPS_ON
);
exit
(
0
);
}
else
if
(
!
strcmp
(
argv
[
2
],
"off"
))
{
assert_init
(
shw_fpga_mmap_init
());
shw_pps_gen_enable_output
(
PPS_OFF
);
exit
(
0
);
}
else
{
printf
(
"Unknown parameter
\n
;"
);
exit
(
1
);
}
}
else
if
(
!
strcmp
(
argv
[
1
],
"50ohm-term-in"
))
{
if
(
argc
<
3
)
{
printf
(
"No parameter given
\n
;"
);
exit
(
1
);
}
if
(
!
strcmp
(
argv
[
2
],
"on"
))
{
assert_init
(
shw_fpga_mmap_init
());
shw_pps_gen_in_term_enable
(
PPSG_PPS_IN_TERM_50OHM_ENABLE
);
exit
(
0
);
}
else
if
(
!
strcmp
(
argv
[
2
],
"off"
))
{
assert_init
(
shw_fpga_mmap_init
());
shw_pps_gen_in_term_enable
(
PPSG_PPS_IN_TERM_50OHM_DISABLE
);
exit
(
0
);
}
else
if
(
!
strcmp
(
argv
[
2
],
"read"
))
{
assert_init
(
shw_fpga_mmap_init
());
if
(
shw_pps_gen_in_term_read
()
==
PPSG_PPS_IN_TERM_50OHM_ENABLE
)
{
printf
(
"50ohm termination enabled on "
"1-PPS
\n
;"
);
}
else
{
printf
(
"50ohm termination disabled on "
"1-PPS
\n
;"
);
}
exit
(
0
);
}
else
{
printf
(
"Unknown parameter
\n
;"
);
exit
(
1
);
}
}
else
{
printf
(
"Unknown command
\n
;"
);
exit
(
1
);
...
...
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