Skip to content

Commit 271e6b1

Browse files
committed
Tidy up FMC for STM32H735
FMC can only be used for 16-bit memories on STM32H735
1 parent 84a73af commit 271e6b1

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/fmc.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ use crate::gpio::gpiog::{
6161
use crate::gpio::gpioh::{
6262
PH10, PH11, PH12, PH13, PH14, PH15, PH2, PH3, PH5, PH6, PH7, PH8, PH9,
6363
};
64+
#[cfg(not(feature = "rm0468"))]
6465
use crate::gpio::gpioi::{PI0, PI1, PI10, PI2, PI3, PI4, PI5, PI6, PI7, PI9};
6566
use crate::gpio::{Alternate, AF12, AF9};
6667

@@ -149,9 +150,10 @@ unsafe impl FmcPeripheral for FMC {
149150
}
150151

151152
macro_rules! pins {
152-
(FMC: $($pin:ident: [$($inst:ty),*])+) => {
153+
(FMC: $($pin:ident: [$( $( #[ $pmeta:meta ] )* $inst:ty),*])+) => {
153154
$(
154155
$(
156+
$( #[ $pmeta ] )*
155157
impl stm32_fmc::$pin for $inst {}
156158
)*
157159
)+
@@ -216,14 +218,14 @@ pins! {
216218
D21: [ PH13<Alternate<AF12>> ]
217219
D22: [ PH14<Alternate<AF12>> ]
218220
D23: [ PH15<Alternate<AF12>> ]
219-
D24: [ PI0<Alternate<AF12>> ]
220-
D25: [ PI1<Alternate<AF12>> ]
221-
D26: [ PI2<Alternate<AF12>> ]
222-
D27: [ PI3<Alternate<AF12>> ]
223-
D28: [ PI6<Alternate<AF12>> ]
224-
D29: [ PI7<Alternate<AF12>> ]
225-
D30: [ PI9<Alternate<AF12>> ]
226-
D31: [ PI10<Alternate<AF12>> ]
221+
D24: [ #[cfg(not(feature = "rm0468"))] PI0<Alternate<AF12>> ]
222+
D25: [ #[cfg(not(feature = "rm0468"))] PI1<Alternate<AF12>> ]
223+
D26: [ #[cfg(not(feature = "rm0468"))] PI2<Alternate<AF12>> ]
224+
D27: [ #[cfg(not(feature = "rm0468"))] PI3<Alternate<AF12>> ]
225+
D28: [ #[cfg(not(feature = "rm0468"))] PI6<Alternate<AF12>> ]
226+
D29: [ #[cfg(not(feature = "rm0468"))] PI7<Alternate<AF12>> ]
227+
D30: [ #[cfg(not(feature = "rm0468"))] PI9<Alternate<AF12>> ]
228+
D31: [ #[cfg(not(feature = "rm0468"))] PI10<Alternate<AF12>> ]
227229

228230
DA0: [ PD14<Alternate<AF12>> ]
229231
DA1: [ PD15<Alternate<AF12>> ]
@@ -246,8 +248,8 @@ pins! {
246248

247249
NBL0: [ PE0<Alternate<AF12>> ]
248250
NBL1: [ PE1<Alternate<AF12>> ]
249-
NBL2: [ PI4<Alternate<AF12>> ]
250-
NBL3: [ PI5<Alternate<AF12>> ]
251+
NBL2: [ #[cfg(not(feature = "rm0468"))] PI4<Alternate<AF12>> ]
252+
NBL3: [ #[cfg(not(feature = "rm0468"))] PI5<Alternate<AF12>> ]
251253

252254
// NAND
253255
NCE: [

0 commit comments

Comments
 (0)