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
4
Merge Requests
4
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
94dc30f4
Commit
94dc30f4
authored
Apr 23, 2020
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev/ad9910: implement ad9910_frequency_to_ftw()
parent
996c13fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
ad9910.c
dev/ad9910.c
+7
-0
ad9910.h
include/dev/ad9910.h
+1
-0
No files found.
dev/ad9910.c
View file @
94dc30f4
...
...
@@ -82,6 +82,11 @@ int ad9910_probe( struct ad9910_device *dev, struct spi_bus *bus, void (*trigger
return
(
id
==
AD9910_DEFAULT_CFR1
)
?
0
:
-
1
;
}
uint64_t
ad9910_frequency_to_ftw
(
struct
ad9910_device
*
dev
,
uint64_t
freq_hz
)
{
return
(
1ULL
<<
32
)
*
freq_hz
/
AD9910_REF_FREQ
;
}
int
ad9910_program
(
struct
ad9910_device
*
dev
,
uint64_t
ftw_n
,
int
phase
,
int
fs_current
)
{
...
...
@@ -92,6 +97,8 @@ int ad9910_program( struct ad9910_device *dev, uint64_t ftw_n, int phase, int fs
uint64_t
ftw
=
ftw_n
;
uint64_t
prof0_cr
=
ftw
|
(
0x8b5ULL
<<
48
);
dev_dbg
(
"ad9910 FTW = %d
\n
"
,
(
uint32_t
)
ftw
);
// dev_dbg("ad9910_program [%08x%08x] asf %d!\n", (uint32_t)(prof0_cr >> 32), (uint32_t)prof0_cr, asf );
for
(
i
=
0
;
ad9910_default_config
[
i
].
addr
>=
0
;
i
++
)
...
...
include/dev/ad9910.h
View file @
94dc30f4
...
...
@@ -46,5 +46,6 @@ void ad9910_write(struct ad9910_device *dev, uint32_t reg, uint64_t value, int n
int
ad9910_probe
(
struct
ad9910_device
*
dev
,
struct
spi_bus
*
bus
,
void
(
*
trigger_io_update
)(
struct
ad9910_device
*
dev
)
);
void
ad9910_trigger_update
(
struct
ad9910_device
*
dev
);
void
ad9910_configure_sync
(
struct
ad9910_device
*
dev
,
int
enable
,
int
fine_delay_taps
);
uint64_t
ad9910_frequency_to_ftw
(
struct
ad9910_device
*
dev
,
uint64_t
freq_hz
);
#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