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
7b9de0a7
Commit
7b9de0a7
authored
Jun 04, 2012
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pps_gen: added pps_gen_set_time() function
parent
b0bbfd63
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
14 deletions
+17
-14
pps_gen.c
dev/pps_gen.c
+16
-14
pps_gen.h
include/pps_gen.h
+1
-0
No files found.
dev/pps_gen.c
View file @
7b9de0a7
...
...
@@ -10,19 +10,7 @@ static volatile struct PPSG_WB *PPSG = (volatile struct PPS_GEN_WB *) BASE_PPS_G
void
pps_gen_init
()
{
uint32_t
cr
;
cr
=
PPSG_CR_CNT_EN
|
PPSG_CR_PWIDTH_W
(
PPS_PULSE_WIDTH
);
PPSG
->
CR
=
cr
;
PPSG
->
ESCR
=
0
;
PPSG
->
ADJ_UTCLO
=
100
;
PPSG
->
ADJ_UTCHI
=
0
;
PPSG
->
ADJ_NSEC
=
0
;
PPSG
->
CR
=
cr
|
PPSG_CR_CNT_SET
;
PPSG
->
CR
=
cr
;
pps_gen_set_time
(
0
,
0
);
}
void
pps_gen_adjust_nsec
(
int32_t
how_much
)
...
...
@@ -48,6 +36,21 @@ int pps_gen_busy()
return
PPSG
->
CR
&
PPSG_CR_CNT_ADJ
?
0
:
1
;
}
void
pps_gen_set_time
(
uint32_t
utc
,
uint32_t
nsec
)
{
uint32_t
cr
=
PPSG_CR_CNT_EN
|
PPSG_CR_PWIDTH_W
(
PPS_PULSE_WIDTH
);
PPSG
->
CR
=
cr
;
PPSG
->
ESCR
=
0
;
PPSG
->
ADJ_UTCLO
=
utc
;
PPSG
->
ADJ_UTCHI
=
0
;
PPSG
->
ADJ_NSEC
=
nsec
;
PPSG
->
CR
=
cr
|
PPSG_CR_CNT_SET
;
PPSG
->
CR
=
cr
;
}
void
pps_gen_get_time
(
uint32_t
*
utc
,
uint32_t
*
cntr_nsec
)
{
uint32_t
cyc_before
,
cyc_after
;
...
...
@@ -65,7 +68,6 @@ void pps_gen_get_time(uint32_t *utc, uint32_t *cntr_nsec)
if
(
cntr_nsec
)
*
cntr_nsec
=
cyc_after
;
}
void
pps_gen_enable_output
(
int
enable
)
{
if
(
enable
)
...
...
include/pps_gen.h
View file @
7b9de0a7
...
...
@@ -8,5 +8,6 @@ void pps_gen_adjust_nsec(int32_t how_much);
void
shw_pps_gen_adjust_utc
(
int32_t
how_much
);
int
pps_gen_busy
();
void
pps_gen_get_time
(
uint32_t
*
utc
,
uint32_t
*
cntr_nsec
);
void
pps_gen_set_time
(
uint32_t
utc
,
uint32_t
nsec
);
#endif
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