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
6
Merge Requests
6
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
4495a7d1
Commit
4495a7d1
authored
Jan 29, 2020
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ertm14: commit RF switch state, use FTW instead of freq in Hz
parent
0a194665
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
12 deletions
+25
-12
ertm14.c
ertm14.c
+25
-12
No files found.
ertm14.c
View file @
4495a7d1
...
@@ -829,6 +829,9 @@ int ertm14_init(void)
...
@@ -829,6 +829,9 @@ int ertm14_init(void)
int
i
;
int
i
;
uint32_t
id
;
uint32_t
id
;
has_new_config
=
0
;
ertm_init_complete
=
0
;
memset
(
&
board
,
0
,
sizeof
(
struct
ertm14_board
));
memset
(
&
board
,
0
,
sizeof
(
struct
ertm14_board
));
#ifdef CONFIG_ERTM14_WITHOUT_ERTM15
#ifdef CONFIG_ERTM14_WITHOUT_ERTM15
...
@@ -987,8 +990,8 @@ void ertm14_config_init()
...
@@ -987,8 +990,8 @@ void ertm14_config_init()
struct
ertm14_board_config
*
cfg
=
&
ertm14_configs
[
i
];
struct
ertm14_board_config
*
cfg
=
&
ertm14_configs
[
i
];
cfg
->
valid
=
1
;
cfg
->
valid
=
1
;
cfg
->
lo
.
f
req_hz
=
223500000
;
cfg
->
lo
.
f
tw
=
0x39374BC6
;
cfg
->
ref
.
f
req_hz
=
223500000
;
cfg
->
ref
.
f
tw
=
0x39374BC6
;
cfg
->
lo
.
ampl_factor
=
50
;
cfg
->
lo
.
ampl_factor
=
50
;
cfg
->
ref
.
ampl_factor
=
50
;
cfg
->
ref
.
ampl_factor
=
50
;
...
@@ -1000,15 +1003,13 @@ void ertm14_config_init()
...
@@ -1000,15 +1003,13 @@ void ertm14_config_init()
for
(
j
=
0
;
j
<=
ERTM14_CLKAB_OUT_MAX_ID
;
j
++
)
for
(
j
=
0
;
j
<=
ERTM14_CLKAB_OUT_MAX_ID
;
j
++
)
{
{
cfg
->
clka_freq_hz
[
j
]
=
25
0000000
;
cfg
->
clka_freq_hz
[
j
]
=
50
0000000
;
cfg
->
clkb_freq_hz
[
j
]
=
25
0000000
;
cfg
->
clkb_freq_hz
[
j
]
=
50
0000000
;
}
}
cfg
->
clka_enable_mask
=
(
1
<<
11
);
cfg
->
clka_enable_mask
=
-
1
;
//
( 1<<11);
cfg
->
clkb_enable_mask
=
(
1
<<
11
);
cfg
->
clkb_enable_mask
=
-
1
;
//
( 1<<11);
}
}
ertm14_apply_config
(
0
);
};
};
struct
ertm14_board_config
*
ertm14_get_config
(
int
config_id
)
struct
ertm14_board_config
*
ertm14_get_config
(
int
config_id
)
...
@@ -1061,11 +1062,23 @@ static int ertm14_commit_config( struct ertm14_board_config *cfg )
...
@@ -1061,11 +1062,23 @@ static int ertm14_commit_config( struct ertm14_board_config *cfg )
// DDSes
// DDSes
ad9910_program
(
&
board
.
dds_ad9910_lo
,
cfg
->
lo
.
freq_hz
,
0
,
cfg
->
lo
.
ampl_factor
);
ad9910_program
(
&
board
.
dds_ad9910_lo
,
cfg
->
lo
.
ftw
,
0
,
cfg
->
lo
.
ampl_factor
);
ad9910_program
(
&
board
.
dds_ad9910_ref
,
cfg
->
ref
.
freq_hz
,
0
,
cfg
->
ref
.
ampl_factor
);
ad9910_program
(
&
board
.
dds_ad9910_ref
,
cfg
->
ref
.
ftw
,
0
,
cfg
->
ref
.
ampl_factor
);
pp_printf
(
"DDS LO: FTW=0x%08x, ampl=%d
\n
"
,
cfg
->
lo
.
ftw
,
cfg
->
lo
.
ampl_factor
);
pp_printf
(
"DDS REF: FTW=0x%08x, ampl=%d
\n
"
,
cfg
->
ref
.
ftw
,
cfg
->
ref
.
ampl_factor
);
for
(
i
=
ERTM14_RF_OUT_MIN_ID
;
i
<=
ERTM14_RF_OUT_MAX_ID
;
i
++
)
{
int
st_lo
=
cfg
->
lo
.
out_state
[
i
]
==
ERTM15_RF_OUT_ON
?
1
:
0
;
int
st_ref
=
cfg
->
ref
.
out_state
[
i
]
==
ERTM15_RF_OUT_ON
?
1
:
0
;
pp_printf
(
"i %d lo %x ref %x
\n
"
,
i
,
st_lo
,
st_ref
);
ertm15_rf_distr_output_enable
(
&
board
.
rf_distr
,
ERTM15_RF_LO
,
i
,
st_lo
);
ertm15_rf_distr_output_enable
(
&
board
.
rf_distr
,
ERTM15_RF_REF
,
i
,
st_ref
);
}
pp_printf
(
"DDS LO: freq=%d Hz, ampl=%d
\n
"
,
cfg
->
lo
.
freq_hz
,
cfg
->
lo
.
ampl_factor
);
ertm15_update_rf_switches
(
&
board
.
rf_distr
);
pp_printf
(
"DDS REF: freq=%d Hz, ampl=%d
\n
"
,
cfg
->
ref
.
freq_hz
,
cfg
->
ref
.
ampl_factor
);
}
}
static
int
ertm14_update_config_task
(
void
)
static
int
ertm14_update_config_task
(
void
)
...
...
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