Add support for STM32G0

This commit is contained in:
Ben Gamari
2021-07-30 16:48:13 -04:00
committed by Dario Nieuwenhuis
parent 174c51f097
commit e2f71ffbbd
7 changed files with 354 additions and 12 deletions

View File

@ -8,15 +8,26 @@ mod types;
#[derive(Clone, Copy)]
pub struct Clocks {
pub sys: Hertz,
#[cfg(rcc_g0)]
pub apb: Hertz,
#[cfg(rcc_g0)]
pub apb_tim: Hertz,
#[cfg(not(rcc_g0))]
pub apb1: Hertz,
#[cfg(not(rcc_g0))]
pub apb1_tim: Hertz,
#[cfg(not(rcc_g0))]
pub apb2: Hertz,
#[cfg(not(rcc_g0))]
pub apb2_tim: Hertz,
#[cfg(rcc_wl5)]
pub apb3: Hertz,
pub apb1_tim: Hertz,
pub apb2_tim: Hertz,
#[cfg(any(rcc_l0, rcc_f0, rcc_f0x0))]
#[cfg(any(rcc_l0, rcc_f0, rcc_f0x0, rcc_g0))]
pub ahb: Hertz,
#[cfg(any(rcc_l4, rcc_f4, rcc_h7, rcc_wb, rcc_wl5))]
@ -77,6 +88,9 @@ cfg_if::cfg_if! {
} else if #[cfg(any(rcc_f0, rcc_f0x0))] {
mod f0;
pub use f0::*;
} else if #[cfg(any(rcc_g0))] {
mod g0;
pub use g0::*;
}
}