1465: rp: continue clock rework r=Dirbaio a=pennae

vastly reduce the code size of initial clock config (over 700 bytes saved!), at the cost of about 48 bytes of ram used to store the frequencies of all clocks in the system. also stop exporting unstable pac items for clock config, fix a few settings that were out of spec, and add missing features (most notably gpin source information).

Co-authored-by: pennae <github@quasiparticle.net>
This commit is contained in:
bors[bot] 2023-05-17 22:20:44 +00:00 committed by GitHub
commit 4b303949bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 391 additions and 332 deletions

File diff suppressed because it is too large Load Diff

View File

@ -26,12 +26,7 @@ impl<'d, T: Instance> RealTimeClock<'d, T> {
into_ref!(inner);
// Set the RTC divider
unsafe {
inner
.regs()
.clkdiv_m1()
.write(|w| w.set_clkdiv_m1(clk_rtc_freq() as u16 - 1))
};
unsafe { inner.regs().clkdiv_m1().write(|w| w.set_clkdiv_m1(clk_rtc_freq() - 1)) };
let mut result = Self { inner };
result.set_leap_year_check(true); // should be on by default, make sure this is the case.

View File

@ -17,14 +17,14 @@ async fn main(_spawner: Spawner) {
gpout3.enable();
loop {
gpout3.set_src(clocks::GpoutSrc::CLK_SYS);
gpout3.set_src(clocks::GpoutSrc::Sys);
info!(
"Pin 25 is now outputing CLK_SYS/1000, should be toggling at {}",
gpout3.get_freq()
);
Timer::after(Duration::from_secs(2)).await;
gpout3.set_src(clocks::GpoutSrc::CLK_REF);
gpout3.set_src(clocks::GpoutSrc::Ref);
info!(
"Pin 25 is now outputing CLK_REF/1000, should be toggling at {}",
gpout3.get_freq()