Lines Matching +full:channel +full:- +full:phase
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * PTP 1588 clock support - User space test program
35 #define CLOCK_INVALID -1
113 return t->sec * NSEC_PER_SEC + t->nsec; in pctns()
120 " -c query the ptp clock's capabilities\n" in usage()
121 " -d name device to open\n" in usage()
122 " -e val read 'val' external time stamp events\n" in usage()
123 " -f val adjust the ptp clock frequency by 'val' ppb\n" in usage()
124 " -F chan Enable single channel mask and keep device open for debugfs verification.\n" in usage()
125 " -g get the ptp clock time\n" in usage()
126 " -h prints this message\n" in usage()
127 " -i val index for event/trigger\n" in usage()
128 " -k val measure the time offset between system and phc clock\n" in usage()
130 " -l list the current pin configuration\n" in usage()
131 " -L pin,val configure pin index 'pin' with function 'val'\n" in usage()
132 " the channel index is taken from the '-i' option\n" in usage()
134 " 0 - none\n" in usage()
135 " 1 - external time stamp\n" in usage()
136 " 2 - periodic output\n" in usage()
137 " -n val shift the ptp clock time by 'val' nanoseconds\n" in usage()
138 " -o val phase offset (in nanoseconds) to be provided to the PHC servo\n" in usage()
139 " -p val enable output with a period of 'val' nanoseconds\n" in usage()
140 " -H val set output phase to 'val' nanoseconds (requires -p)\n" in usage()
141 " -w val set output pulse width to 'val' nanoseconds (requires -p)\n" in usage()
142 " -P val enable or disable (val=1|0) the system clock PPS\n" in usage()
143 " -s set the ptp clock time from the system time\n" in usage()
144 " -S set the system time from the ptp clock time\n" in usage()
145 " -t val shift the ptp clock time by 'val' seconds\n" in usage()
146 " -T val set the ptp clock time to 'val' seconds\n" in usage()
147 " -x val get an extended ptp clock time with the desired number of samples (up to %d)\n" in usage()
148 " -X get a ptp clock cross timestamp\n" in usage()
149 " -z test combinations of rising/falling external time stamp flags\n", in usage()
187 int pin_index = -1, pin_func; in main()
188 int pps = -1; in main()
191 int channel = -1; in main() local
195 int64_t perout_phase = -1; in main()
196 int64_t pulsewidth = -1; in main()
197 int64_t perout = -1; in main()
216 channel = atoi(optarg); in main()
238 return -1; in main()
275 return -1; in main()
290 return -1; in main()
297 return -1; in main()
303 return -1; in main()
319 " %d maximum phase adjustment (ns)\n", in main()
349 tx.time.tv_sec -= 1; in main()
368 puts("phase adjustment okay"); in main()
431 for (; extts; extts--) { in main()
471 puts("-w can only be specified together with -p"); in main()
472 return -1; in main()
476 puts("-H can only be specified together with -p"); in main()
477 return -1; in main()
483 return -1; in main()
497 perout_request.phase.sec = perout_phase / NSEC_PER_SEC; in main()
498 perout_request.phase.nsec = perout_phase % NSEC_PER_SEC; in main()
511 if (pps != -1) { in main()
524 return -1; in main()
530 return -1; in main()
532 sysoff->n_samples = n_samples; in main()
539 pct = &sysoff->ts[0]; in main()
540 for (i = 0; i < sysoff->n_samples; i++) { in main()
544 interval = t2 - t1; in main()
545 offset = (t2 + t1) / 2 - tp; in main()
548 (pct+2*i)->sec, (pct+2*i)->nsec); in main()
550 (pct+2*i+1)->sec, (pct+2*i+1)->nsec); in main()
552 (pct+2*i+2)->sec, (pct+2*i+2)->nsec); in main()
565 return -1; in main()
568 soe->n_samples = getextended; in main()
578 i, soe->ts[i][0].sec, soe->ts[i][0].nsec); in main()
580 soe->ts[i][1].sec, soe->ts[i][1].nsec); in main()
582 soe->ts[i][2].sec, soe->ts[i][2].nsec); in main()
593 return -1; in main()
602 xts->device.sec, xts->device.nsec); in main()
604 xts->sys_realtime.sec, xts->sys_realtime.nsec); in main()
606 xts->sys_monoraw.sec, xts->sys_monoraw.nsec); in main()
612 if (channel >= 0) { in main()
615 } else if (ioctl(fd, PTP_MASK_EN_SINGLE, (unsigned int *)&channel)) { in main()
618 printf("Channel %d exclusively enabled. Check on debugfs.\n", channel); in main()