Commit aca42742 authored by Adam Wujek's avatar Adam Wujek 💬

userspace/tools: add get/set of 50ohm termination of 1-PPS input to wrs_pps_control

Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent db87b6b6
......@@ -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.
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment