Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
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
Software for White Rabbit PTP Core
Commits
b9cac100
Commit
b9cac100
authored
May 04, 2023
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd_pll: remove checkvco (now part of freqmon)
parent
b826e1a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
55 deletions
+0
-55
cmd_pll.c
shell/cmd_pll.c
+0
-55
No files found.
shell/cmd_pll.c
View file @
b9cac100
...
...
@@ -26,7 +26,6 @@ static const char * const pll_menu[] =
[
6
]
=
"stop"
,
[
7
]
=
"sdac"
,
[
8
]
=
"gdac"
,
[
9
]
=
"checkvco"
};
/* Number of arguments for the sub-commands. Mind the order! */
...
...
@@ -41,59 +40,8 @@ static const unsigned char nargs[] =
[
6
]
=
1
,
[
7
]
=
2
,
[
8
]
=
1
,
[
9
]
=
0
};
static
int
calc_apr
(
int
meas_min
,
int
meas_max
,
int
f_center
)
{
// apr_min is in PPM
int64_t
delta_low
=
meas_min
-
f_center
;
int64_t
delta_hi
=
meas_max
-
f_center
;
uint64_t
u_delta_low
,
u_delta_hi
;
int
ppm_lo
,
ppm_hi
;
if
(
delta_low
>=
0
)
return
-
1
;
if
(
delta_hi
<=
0
)
return
-
1
;
/* __div64_32 divides 64 by 32; result is in the 64 argument. */
u_delta_low
=
-
delta_low
*
1000000LL
;
__div64_32
(
&
u_delta_low
,
f_center
);
ppm_lo
=
(
int
)
u_delta_low
;
u_delta_hi
=
delta_hi
*
1000000LL
;
__div64_32
(
&
u_delta_hi
,
f_center
);
ppm_hi
=
(
int
)
u_delta_hi
;
return
ppm_lo
<
ppm_hi
?
ppm_lo
:
ppm_hi
;
}
static
void
check_vco_frequencies
(
void
)
{
//disable_irq();
int
f_min
,
f_max
;
pp_printf
(
"SoftPLL VCO Frequency/APR test:
\n
"
);
spll_set_dac
(
-
1
,
0
);
f_min
=
spll_measure_frequency
(
SPLL_OSC_DMTD
);
spll_set_dac
(
-
1
,
65535
);
f_max
=
spll_measure_frequency
(
SPLL_OSC_DMTD
);
pp_printf
(
"DMTD VCO: Low=%d Hz Hi=%d Hz, APR = %d ppm.
\n
"
,
f_min
,
f_max
,
calc_apr
(
f_min
,
f_max
,
62500000
));
spll_set_dac
(
0
,
0
);
f_min
=
spll_measure_frequency
(
SPLL_OSC_REF
);
spll_set_dac
(
0
,
65535
);
f_max
=
spll_measure_frequency
(
SPLL_OSC_REF
);
pp_printf
(
"REF VCO: Low=%d Hz Hi=%d Hz, APR = %d ppm.
\n
"
,
f_min
,
f_max
,
calc_apr
(
f_min
,
f_max
,
REF_CLOCK_FREQ_HZ
));
f_min
=
spll_measure_frequency
(
SPLL_OSC_EXT
);
pp_printf
(
"EXT clock: Freq=%d Hz
\n
"
,
f_min
);
}
static
int
cmd_pll
(
const
char
*
args
[])
{
unsigned
narg
;
...
...
@@ -144,9 +92,6 @@ static int cmd_pll(const char *args[])
case
8
:
pp_printf
(
"%d
\n
"
,
spll_get_dac
(
vals
[
1
]));
return
0
;
case
9
:
check_vco_frequencies
();
return
0
;
default:
return
0
;
}
...
...
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