Added vrefbuf driver.

Also updated stm32-data-generated to latest
This commit is contained in:
Gerzain Mata 2025-08-10 19:32:23 -07:00
parent 92d12b5d88
commit 4a3cf32316
2 changed files with 15 additions and 3 deletions

View File

@ -81,7 +81,7 @@ futures-util = { version = "0.3.30", default-features = false }
sdio-host = "0.9.0"
critical-section = "1.1"
#stm32-metapac = { version = "16" }
stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-a236d845991bb48198427e08dc61ae3e257057a8" }
stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-9941f338734a2e6c1652267f64b13f7b35d8c9db" }
vcell = "0.1.3"
nb = "1.0.0"
@ -110,7 +110,7 @@ proc-macro2 = "1.0.36"
quote = "1.0.15"
#stm32-metapac = { version = "16", default-features = false, features = ["metadata"]}
stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-a236d845991bb48198427e08dc61ae3e257057a8", default-features = false, features = ["metadata"] }
stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-9941f338734a2e6c1652267f64b13f7b35d8c9db", default-features = false, features = ["metadata"] }
[features]
default = ["rt"]

View File

@ -5,7 +5,7 @@ pub use crate::pac::rcc::vals::Otghssel;
use crate::pac::rcc::vals::Pllrge;
pub use crate::pac::rcc::vals::{
Hdiv5, Hpre as AHBPrescaler, Hpre5 as AHB5Prescaler, Hsepre as HsePrescaler, Plldiv as PllDiv, Pllm as PllPreDiv,
Plln as PllMul, Pllsrc as PllSource, Ppre as APBPrescaler, Sw as Sysclk,
Plln as PllMul, Pllsrc as PllSource, Ppre as APBPrescaler, Sai1sel, Sw as Sysclk,
};
#[cfg(all(peri_usb_otg_hs))]
pub use crate::pac::{syscfg::vals::Usbrefcksel, SYSCFG};
@ -254,6 +254,16 @@ pub(crate) unsafe fn init(config: Config) {
w.set_clksel(usb_refck_sel);
});
#[cfg(sai_v4_2pdm)]
let audioclk = match config.mux.sai1sel {
Sai1sel::HSI => Some(HSI_FREQ),
Sai1sel::PLL1_Q => Some(pll1.q.expect("PLL1.Q not configured")),
Sai1sel::PLL1_P => Some(pll1.p.expect("PLL1.P not configured")),
Sai1sel::SYS => panic!("SYS not supported yet"),
Sai1sel::AUDIOCLK => panic!("AUDIOCLK not supported yet"),
_ => None,
};
let lsi = config.ls.lsi.then_some(LSI_FREQ);
config.mux.init();
@ -279,6 +289,8 @@ pub(crate) unsafe fn init(config: Config) {
// TODO
lse: None,
#[cfg(sai_v4_2pdm)]
audioclk: audioclk,
);
}