diff options
| -rw-r--r-- | embassy-stm32/CHANGELOG.md | 1 | ||||
| -rw-r--r-- | embassy-stm32/src/rcc/c0.rs | 14 |
2 files changed, 13 insertions, 2 deletions
diff --git a/embassy-stm32/CHANGELOG.md b/embassy-stm32/CHANGELOG.md index 190e68d6d..8fcc088fd 100644 --- a/embassy-stm32/CHANGELOG.md +++ b/embassy-stm32/CHANGELOG.md | |||
| @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
| 22 | - fix: handle address and data-length errors in OSPI | 22 | - fix: handle address and data-length errors in OSPI |
| 23 | - feat: Allow OSPI DMA writes larger than 64kB using chunking | 23 | - feat: Allow OSPI DMA writes larger than 64kB using chunking |
| 24 | - feat: More ADC enums for g0 PAC, API change for oversampling, allow separate sample times | 24 | - feat: More ADC enums for g0 PAC, API change for oversampling, allow separate sample times |
| 25 | - feat: Add USB CRS sync support for STM32C071 | ||
| 25 | 26 | ||
| 26 | ## 0.4.0 - 2025-08-26 | 27 | ## 0.4.0 - 2025-08-26 |
| 27 | 28 | ||
diff --git a/embassy-stm32/src/rcc/c0.rs b/embassy-stm32/src/rcc/c0.rs index c2295bab6..99f22273d 100644 --- a/embassy-stm32/src/rcc/c0.rs +++ b/embassy-stm32/src/rcc/c0.rs | |||
| @@ -49,6 +49,10 @@ pub struct Config { | |||
| 49 | /// System Clock Configuration | 49 | /// System Clock Configuration |
| 50 | pub sys: Sysclk, | 50 | pub sys: Sysclk, |
| 51 | 51 | ||
| 52 | /// HSI48 Configuration | ||
| 53 | #[cfg(crs)] | ||
| 54 | pub hsi48: Option<super::Hsi48Config>, | ||
| 55 | |||
| 52 | pub ahb_pre: AHBPrescaler, | 56 | pub ahb_pre: AHBPrescaler, |
| 53 | pub apb1_pre: APBPrescaler, | 57 | pub apb1_pre: APBPrescaler, |
| 54 | 58 | ||
| @@ -68,6 +72,8 @@ impl Config { | |||
| 68 | }), | 72 | }), |
| 69 | hse: None, | 73 | hse: None, |
| 70 | sys: Sysclk::HSISYS, | 74 | sys: Sysclk::HSISYS, |
| 75 | #[cfg(crs)] | ||
| 76 | hsi48: Some(crate::rcc::Hsi48Config::new()), | ||
| 71 | ahb_pre: AHBPrescaler::DIV1, | 77 | ahb_pre: AHBPrescaler::DIV1, |
| 72 | apb1_pre: APBPrescaler::DIV1, | 78 | apb1_pre: APBPrescaler::DIV1, |
| 73 | ls: crate::rcc::LsConfig::new(), | 79 | ls: crate::rcc::LsConfig::new(), |
| @@ -127,6 +133,10 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 127 | } | 133 | } |
| 128 | }; | 134 | }; |
| 129 | 135 | ||
| 136 | // Configure HSI48 if required | ||
| 137 | #[cfg(crs)] | ||
| 138 | let hsi48 = config.hsi48.map(super::init_hsi48); | ||
| 139 | |||
| 130 | let rtc = config.ls.init(); | 140 | let rtc = config.ls.init(); |
| 131 | 141 | ||
| 132 | let sys = match config.sys { | 142 | let sys = match config.sys { |
| @@ -185,13 +195,13 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 185 | hsi: hsi, | 195 | hsi: hsi, |
| 186 | hsiker: hsiker, | 196 | hsiker: hsiker, |
| 187 | hse: hse, | 197 | hse: hse, |
| 198 | #[cfg(crs)] | ||
| 199 | hsi48: hsi48, | ||
| 188 | rtc: rtc, | 200 | rtc: rtc, |
| 189 | 201 | ||
| 190 | // TODO | 202 | // TODO |
| 191 | lsi: None, | 203 | lsi: None, |
| 192 | lse: None, | 204 | lse: None, |
| 193 | #[cfg(crs)] | ||
| 194 | hsi48: None, | ||
| 195 | ); | 205 | ); |
| 196 | 206 | ||
| 197 | RCC.ccipr() | 207 | RCC.ccipr() |
