diff options
| author | Adin Ackerman <[email protected]> | 2024-01-02 16:25:51 -0800 |
|---|---|---|
| committer | Adin Ackerman <[email protected]> | 2024-01-02 16:25:51 -0800 |
| commit | d372cba266c7a110f314e74dfee589987b892383 (patch) | |
| tree | dee3898d59414b6cfd28d8103a3fe256dbdc0763 /embassy-stm32 | |
| parent | 34713b4910d2d94a632ff8e3a161ab982fdab2ba (diff) | |
additional chip variants required more clocks
Diffstat (limited to 'embassy-stm32')
| -rw-r--r-- | embassy-stm32/src/rcc/g0.rs | 5 | ||||
| -rw-r--r-- | embassy-stm32/src/rcc/mod.rs | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/embassy-stm32/src/rcc/g0.rs b/embassy-stm32/src/rcc/g0.rs index 7f62031e5..aedc95bf3 100644 --- a/embassy-stm32/src/rcc/g0.rs +++ b/embassy-stm32/src/rcc/g0.rs | |||
| @@ -299,7 +299,9 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 299 | let lse_freq = config.ls.lse.map(|lse| lse.frequency); | 299 | let lse_freq = config.ls.lse.map(|lse| lse.frequency); |
| 300 | 300 | ||
| 301 | let hsi_freq = (sw == Sw::HSI).then_some(HSI_FREQ); | 301 | let hsi_freq = (sw == Sw::HSI).then_some(HSI_FREQ); |
| 302 | let hsi_div_8_freq = hsi_freq.map(|f| f / 8u32); | ||
| 302 | let lsi_freq = (sw == Sw::LSI).then_some(super::LSI_FREQ); | 303 | let lsi_freq = (sw == Sw::LSI).then_some(super::LSI_FREQ); |
| 304 | let hse_freq = (sw == Sw::HSE).then_some(sys_clk); | ||
| 303 | 305 | ||
| 304 | set_freqs(Clocks { | 306 | set_freqs(Clocks { |
| 305 | sys: sys_clk, | 307 | sys: sys_clk, |
| @@ -307,6 +309,9 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 307 | pclk1: apb_freq, | 309 | pclk1: apb_freq, |
| 308 | pclk1_tim: apb_tim_freq, | 310 | pclk1_tim: apb_tim_freq, |
| 309 | hsi: hsi_freq, | 311 | hsi: hsi_freq, |
| 312 | hsi48: None, | ||
| 313 | hsi_div_8: hsi_div_8_freq, | ||
| 314 | hse: hse_freq, | ||
| 310 | lse: lse_freq, | 315 | lse: lse_freq, |
| 311 | lsi: lsi_freq, | 316 | lsi: lsi_freq, |
| 312 | pll1_q: pll1_q_freq, | 317 | pll1_q: pll1_q_freq, |
diff --git a/embassy-stm32/src/rcc/mod.rs b/embassy-stm32/src/rcc/mod.rs index c4bee4c95..240ffc6d2 100644 --- a/embassy-stm32/src/rcc/mod.rs +++ b/embassy-stm32/src/rcc/mod.rs | |||
| @@ -162,8 +162,10 @@ pub struct Clocks { | |||
| 162 | 162 | ||
| 163 | #[cfg(any(stm32h5, stm32h7, rcc_l4, rcc_c0, stm32g0))] | 163 | #[cfg(any(stm32h5, stm32h7, rcc_l4, rcc_c0, stm32g0))] |
| 164 | pub hsi: Option<Hertz>, | 164 | pub hsi: Option<Hertz>, |
| 165 | #[cfg(stm32h5)] | 165 | #[cfg(any(stm32h5, stm32g0))] |
| 166 | pub hsi48: Option<Hertz>, | 166 | pub hsi48: Option<Hertz>, |
| 167 | #[cfg(stm32g0)] | ||
| 168 | pub hsi_div_8: Option<Hertz>, | ||
| 167 | #[cfg(any(stm32g0, stm32h5))] | 169 | #[cfg(any(stm32g0, stm32h5))] |
| 168 | pub lsi: Option<Hertz>, | 170 | pub lsi: Option<Hertz>, |
| 169 | #[cfg(any(stm32h5, stm32h7))] | 171 | #[cfg(any(stm32h5, stm32h7))] |
| @@ -171,7 +173,7 @@ pub struct Clocks { | |||
| 171 | 173 | ||
| 172 | #[cfg(any(stm32h5, stm32h7, rcc_l4, rcc_c0, stm32g0))] | 174 | #[cfg(any(stm32h5, stm32h7, rcc_l4, rcc_c0, stm32g0))] |
| 173 | pub lse: Option<Hertz>, | 175 | pub lse: Option<Hertz>, |
| 174 | #[cfg(any(stm32h5, stm32h7, stm32g4))] | 176 | #[cfg(any(stm32h5, stm32h7, stm32g0, stm32g4))] |
| 175 | pub hse: Option<Hertz>, | 177 | pub hse: Option<Hertz>, |
| 176 | 178 | ||
| 177 | #[cfg(stm32h5)] | 179 | #[cfg(stm32h5)] |
