You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found where TIMER0 is initialized in embassy and this involves setting the clock source in embassy/embassy-rp/src/clocks.rs.
Now I want to initialize TIMER1 (and decently use clock sources for other peripherals).
I seemingly should use the clk_ref_freq defined in embassy/embassy-rp/src/clocks.rs to calculate appropriate factors in a similar way as done for TIMER0. But I don't find a way to access this value. (Right now I calculate clk_ref_freq by reading back the factor from TIMER0:
let clk_ref_freq = pac::TICKS.timer0_cycles().read().0 * 1000000;
Nasty hack :) )
Is there an "official" way to get clk_ref_freq or another appropriate constant (derived from the Oscillator frequency)? I did not find anything in the documentation.
This said, IMHO there should be settable "features" defining the desired CPU clock (defaulting to the official max clock of the RP2040 rsp RP235x) and defining the crystal frequency (defaulting to what the BSP defines),
Will this affect the multiple "magic numbers" in fn crystal()fn rosc() etc ?
I found where
TIMER0
is initialized in embassy and this involves setting the clock source inembassy/embassy-rp/src/clocks.rs
.Now I want to initialize TIMER1 (and decently use clock sources for other peripherals).
I seemingly should use the
clk_ref_freq
defined inembassy/embassy-rp/src/clocks.rs
to calculate appropriate factors in a similar way as done forTIMER0
. But I don't find a way to access this value. (Right now I calculateclk_ref_freq
by reading back the factor fromTIMER0
:Nasty hack :) )
Is there an "official" way to get
clk_ref_freq
or another appropriate constant (derived from the Oscillator frequency)? I did not find anything in the documentation.Also see #3766
The text was updated successfully, but these errors were encountered: