freq count fw: change to use CSR
This commit is contained in:
parent
adc7554f79
commit
84b5a5f2e3
|
@ -450,9 +450,8 @@ pub mod wrpll {
|
||||||
|
|
||||||
fn get_freq_counts(timer: &mut GlobalTimer) -> (u32, u32) {
|
fn get_freq_counts(timer: &mut GlobalTimer) -> (u32, u32) {
|
||||||
unsafe {
|
unsafe {
|
||||||
csr::wrpll::frequency_counter_update_en_write(1);
|
csr::wrpll::frequency_counter_update_write(1);
|
||||||
timer.delay_us(150_000); // 8ns << TIMER_WIDTH
|
timer.delay_us(150_000); // 8ns << TIMER_WIDTH
|
||||||
csr::wrpll::frequency_counter_update_en_write(0);
|
|
||||||
#[cfg(wrpll_ref_clk = "GT_CDR")]
|
#[cfg(wrpll_ref_clk = "GT_CDR")]
|
||||||
let ref_count = csr::wrpll::frequency_counter_counter_rtio_rx0_read();
|
let ref_count = csr::wrpll::frequency_counter_counter_rtio_rx0_read();
|
||||||
#[cfg(wrpll_ref_clk = "SMA_CLKIN")]
|
#[cfg(wrpll_ref_clk = "SMA_CLKIN")]
|
||||||
|
|
Loading…
Reference in New Issue