aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2023-10-11 01:01:27 +0200
committerDario Nieuwenhuis <[email protected]>2023-10-11 01:06:44 +0200
commitd0d0ceec6acc0bae8a16f0ebdffaf24b40a018cd (patch)
tree15b366498a888c75450cea9d3c4dcee58dc3f6c4 /embassy-stm32
parent9be61a2967ad48c8faf6a25770c3be1b110b29a4 (diff)
stm32/rcc: rename HSE32 to HSE
Diffstat (limited to 'embassy-stm32')
-rw-r--r--embassy-stm32/src/rcc/wba.rs4
-rw-r--r--embassy-stm32/src/rcc/wl.rs12
2 files changed, 8 insertions, 8 deletions
diff --git a/embassy-stm32/src/rcc/wba.rs b/embassy-stm32/src/rcc/wba.rs
index 9ade369f5..d79b3063e 100644
--- a/embassy-stm32/src/rcc/wba.rs
+++ b/embassy-stm32/src/rcc/wba.rs
@@ -28,7 +28,7 @@ pub enum PllSrc {
28impl Into<Pllsrc> for PllSrc { 28impl Into<Pllsrc> for PllSrc {
29 fn into(self) -> Pllsrc { 29 fn into(self) -> Pllsrc {
30 match self { 30 match self {
31 PllSrc::HSE(..) => Pllsrc::HSE32, 31 PllSrc::HSE(..) => Pllsrc::HSE,
32 PllSrc::HSI16 => Pllsrc::HSI16, 32 PllSrc::HSI16 => Pllsrc::HSI16,
33 } 33 }
34 } 34 }
@@ -37,7 +37,7 @@ impl Into<Pllsrc> for PllSrc {
37impl Into<Sw> for ClockSrc { 37impl Into<Sw> for ClockSrc {
38 fn into(self) -> Sw { 38 fn into(self) -> Sw {
39 match self { 39 match self {
40 ClockSrc::HSE(..) => Sw::HSE32, 40 ClockSrc::HSE(..) => Sw::HSE,
41 ClockSrc::HSI16 => Sw::HSI16, 41 ClockSrc::HSI16 => Sw::HSI16,
42 } 42 }
43 } 43 }
diff --git a/embassy-stm32/src/rcc/wl.rs b/embassy-stm32/src/rcc/wl.rs
index f12588a59..4c3fe5051 100644
--- a/embassy-stm32/src/rcc/wl.rs
+++ b/embassy-stm32/src/rcc/wl.rs
@@ -15,14 +15,14 @@ pub const HSI_FREQ: Hertz = Hertz(16_000_000);
15/// LSI speed 15/// LSI speed
16pub const LSI_FREQ: Hertz = Hertz(32_000); 16pub const LSI_FREQ: Hertz = Hertz(32_000);
17 17
18/// HSE32 speed 18/// HSE speed
19pub const HSE32_FREQ: Hertz = Hertz(32_000_000); 19pub const HSE_FREQ: Hertz = Hertz(32_000_000);
20 20
21/// System clock mux source 21/// System clock mux source
22#[derive(Clone, Copy)] 22#[derive(Clone, Copy)]
23pub enum ClockSrc { 23pub enum ClockSrc {
24 MSI(MSIRange), 24 MSI(MSIRange),
25 HSE32, 25 HSE,
26 HSI16, 26 HSI16,
27} 27}
28 28
@@ -59,7 +59,7 @@ impl Default for Config {
59pub(crate) unsafe fn init(config: Config) { 59pub(crate) unsafe fn init(config: Config) {
60 let (sys_clk, sw, vos) = match config.mux { 60 let (sys_clk, sw, vos) = match config.mux {
61 ClockSrc::HSI16 => (HSI_FREQ, Sw::HSI16, VoltageScale::RANGE2), 61 ClockSrc::HSI16 => (HSI_FREQ, Sw::HSI16, VoltageScale::RANGE2),
62 ClockSrc::HSE32 => (HSE32_FREQ, Sw::HSE32, VoltageScale::RANGE1), 62 ClockSrc::HSE => (HSE_FREQ, Sw::HSE, VoltageScale::RANGE1),
63 ClockSrc::MSI(range) => (msirange_to_hertz(range), Sw::MSI, msirange_to_vos(range)), 63 ClockSrc::MSI(range) => (msirange_to_hertz(range), Sw::MSI, msirange_to_vos(range)),
64 }; 64 };
65 65
@@ -113,8 +113,8 @@ pub(crate) unsafe fn init(config: Config) {
113 RCC.cr().write(|w| w.set_hsion(true)); 113 RCC.cr().write(|w| w.set_hsion(true));
114 while !RCC.cr().read().hsirdy() {} 114 while !RCC.cr().read().hsirdy() {}
115 } 115 }
116 ClockSrc::HSE32 => { 116 ClockSrc::HSE => {
117 // Enable HSE32 117 // Enable HSE
118 RCC.cr().write(|w| { 118 RCC.cr().write(|w| {
119 w.set_hsebyppwr(true); 119 w.set_hsebyppwr(true);
120 w.set_hseon(true); 120 w.set_hseon(true);