Re-adds embassy macros for stm32
* Hook RCC config into chip config and use chip-specific RCC init function * RTC/clock setup is ignored for now
This commit is contained in:
@ -42,22 +42,25 @@ pub(crate) use pac::regs::generic;
|
||||
|
||||
#[non_exhaustive]
|
||||
pub struct Config {
|
||||
_private: (),
|
||||
rcc: rcc::Config,
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
fn default() -> Self {
|
||||
Self { _private: () }
|
||||
Self {
|
||||
rcc: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Initialize embassy.
|
||||
pub fn init(_config: Config) -> Peripherals {
|
||||
pub fn init(config: Config) -> Peripherals {
|
||||
let p = Peripherals::take();
|
||||
|
||||
unsafe {
|
||||
dma::init();
|
||||
pac::init_exti();
|
||||
rcc::init(config.rcc);
|
||||
}
|
||||
|
||||
p
|
||||
|
Reference in New Issue
Block a user