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
29
Issues
29
List
Board
Labels
Milestones
Merge Requests
5
Merge Requests
5
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
980836ed
Commit
980836ed
authored
May 30, 2012
by
Tomasz Wlostowski
Committed by
Grzegorz Daniluk
Jun 05, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev/softpll_ng: now can lock the helper to channels other than 0, added spll_set_dac() function
parent
6195dd39
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
2 deletions
+25
-2
softpll_ng.c
dev/softpll_ng.c
+21
-2
softpll_ng.h
include/softpll_ng.h
+4
-0
measure_t24p.c
tests/measure_t24p.c
+0
-0
No files found.
dev/softpll_ng.c
View file @
980836ed
...
...
@@ -16,7 +16,7 @@ volatile int irq_count = 0;
static
volatile
struct
SPLL_WB
*
SPLL
=
(
volatile
struct
SPLL_WB
*
)
BASE_SOFTPLL
;
static
volatile
struct
PPSG_WB
*
PPSG
=
(
volatile
struct
PPSG_WB
*
)
BASE_PPS_GEN
;
#define TRACE
TRACE_DEV
#define TRACE
(...) TRACE_DEV(__VA_ARGS__)
/* The includes below contain code (not only declarations) to enable the compiler
to inline functions where necessary and save some CPU cycles */
...
...
@@ -282,6 +282,7 @@ void spll_init(int mode, int slave_ref_channel, int align_pps)
mpll_init
(
&
softpll
.
aux
[
i
],
slave_ref_channel
,
n_chan_ref
+
i
+
1
);
softpll
.
aux_fsm
[
i
].
state
=
AUX_DISABLED
;
}
break
;
case
SPLL_MODE_FREE_RUNNING_MASTER
:
...
...
@@ -289,7 +290,8 @@ void spll_init(int mode, int slave_ref_channel, int align_pps)
softpll
.
seq_state
=
SEQ_CLEAR_DACS
;
softpll
.
default_dac_main
=
32000
;
helper_init
(
&
softpll
.
helper
,
n_chan_ref
);
helper_init
(
&
softpll
.
helper
,
n_chan_ref
+
slave_ref_channel
);
mpll_init
(
&
softpll
.
mpll
,
slave_ref_channel
,
n_chan_ref
);
...
...
@@ -569,3 +571,20 @@ int spll_get_dac(int index)
return
softpll
.
aux
[
index
-
1
].
pi
.
y
;
return
0
;
}
void
spll_set_dac
(
int
index
,
int
value
)
{
if
(
index
<
0
)
{
softpll
.
helper
.
pi
.
y
=
value
;
SPLL
->
DAC_HPLL
=
value
;
}
else
{
SPLL
->
DAC_MAIN
=
SPLL_DAC_MAIN_DAC_SEL_W
(
index
)
|
(
value
&
0xffff
);
if
(
index
==
0
)
softpll
.
mpll
.
pi
.
y
=
value
;
else
if
(
index
>
0
)
softpll
.
aux
[
index
-
1
].
pi
.
y
=
value
;
}
}
include/softpll_ng.h
View file @
980836ed
...
...
@@ -29,5 +29,9 @@ int spll_get_delock_count();
int
spll_update_aux_clocks
();
int
spll_get_aux_status
(
int
channel
);
void
spll_set_dac
(
int
index
,
int
value
);
int
spll_get_dac
(
int
index
);
#endif
tests/
testtool
.c
→
tests/
measure_t24p
.c
View file @
980836ed
File moved
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