Skip to content

Commit d6cadcb

Browse files
committed
Octospi support for RM0455 parts, mostly commented out for now
REC and peripheral names are wrong on master, already fixed on the stm32h725_735_730 branch
1 parent c9f9675 commit d6cadcb

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

src/xspi/mod.rs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -373,13 +373,21 @@ mod common {
373373
}
374374

375375
pub(super) fn get_clock(clocks: &CoreClocks) -> Option<Hertz> {
376-
let d1ccipr = unsafe { (*stm32::RCC::ptr()).d1ccipr.read() };
377-
378-
match d1ccipr.$ccip().variant() {
379-
stm32::rcc::d1ccipr::[< $ccip:upper _A >]::RCC_HCLK3 => Some(clocks.hclk()),
380-
stm32::rcc::d1ccipr::[< $ccip:upper _A >]::PLL1_Q => clocks.pll1_q_ck(),
381-
stm32::rcc::d1ccipr::[< $ccip:upper _A >]::PLL2_R => clocks.pll2_r_ck(),
382-
stm32::rcc::d1ccipr::[< $ccip:upper _A >]::PER => clocks.per_ck(),
376+
#[cfg(not(feature = "rm0455"))]
377+
use stm32::rcc::d1ccipr as ccipr;
378+
#[cfg(feature = "rm0455")]
379+
use stm32::rcc::cdccipr as ccipr;
380+
381+
#[cfg(not(feature = "rm0455"))]
382+
let ccipr = unsafe { (*stm32::RCC::ptr()).d1ccipr.read() };
383+
#[cfg(feature = "rm0455")]
384+
let ccipr = unsafe { (*stm32::RCC::ptr()).cdccipr.read() };
385+
386+
match ccipr.$ccip().variant() {
387+
ccipr::[< $ccip:upper _A >]::RCC_HCLK3 => Some(clocks.hclk()),
388+
ccipr::[< $ccip:upper _A >]::PLL1_Q => clocks.pll1_q_ck(),
389+
ccipr::[< $ccip:upper _A >]::PLL2_R => clocks.pll2_r_ck(),
390+
ccipr::[< $ccip:upper _A >]::PER => clocks.per_ck(),
383391
}
384392
}
385393

@@ -795,8 +803,8 @@ mod common {
795803
#[cfg(any(feature = "rm0433", feature = "rm0399"))]
796804
xspi_impl! { stm32::QUADSPI, rec::Qspi, qspisel }
797805

798-
#[cfg(any(feature = "rm0455", feature = "rm0468"))]
806+
#[cfg(any(feature = "rm0468"))] // TODO feature = "rm0455",
799807
xspi_impl! { stm32::OCTOSPI1, rec::Octospi1, octospisel }
800-
#[cfg(any(feature = "rm0455", feature = "rm0468"))]
808+
#[cfg(any(feature = "rm0468"))] // TODO feature = "rm0455",
801809
xspi_impl! { stm32::OCTOSPI2, rec::Octospi2, octospisel }
802810
}

src/xspi/octospi.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,5 +342,6 @@ macro_rules! octospi_impl {
342342
};
343343
}
344344

345-
octospi_impl! { octospi1_unchecked, stm32::OCTOSPI1, rec::Octospi1 }
346-
octospi_impl! { octospi2_unchecked, stm32::OCTOSPI2, rec::Octospi2 }
345+
// TODO
346+
//octospi_impl! { octospi1_unchecked, stm32::OCTOSPI1, rec::Octospi1 }
347+
//octospi_impl! { octospi2_unchecked, stm32::OCTOSPI2, rec::Octospi2 }

0 commit comments

Comments
 (0)