Skip to content

Commit 1ad01fe

Browse files
bors[bot]samcrow
andauthored
Merge #312
312: Fix pin definitions for FSMC LCD interface r=burrbull a=samcrow I noticed that some of the pin definitions for the FSMC LCD interface that I added in [pull request 297](#297) were wrong. A few of the pins use AF10 when I had assumed that they all use AF12, and pin PD2 should have been included. Here's a fix. Co-authored-by: Sam Crow <[email protected]>
2 parents 89299c8 + 083aaf2 commit 1ad01fe

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
3636
[#258]: https://github.com/stm32-rs/stm32f4xx-hal/pull/258
3737
[#257]: https://github.com/stm32-rs/stm32f4xx-hal/pull/257
3838

39+
### Fixed
40+
41+
- Corrected pin definitions for the Flexible Static Memory Controller / Flexible Memory Controller
42+
LCD interface [#312]
43+
44+
[#312]: https://github.com/stm32-rs/stm32f4xx-hal/pull/312
45+
3946
## [v0.9.0] - 2021-04-04
4047

4148
### Changed

src/fsmc_lcd/pins.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -724,37 +724,40 @@ mod extra_pins {
724724
use crate::gpio::gpioa::{PA2, PA3, PA4, PA5};
725725
use crate::gpio::gpiob::{PB12, PB14};
726726
use crate::gpio::gpioc::{PC11, PC12, PC2, PC3, PC4, PC5, PC6};
727-
use crate::gpio::{Alternate, AF12};
727+
use crate::gpio::gpiod::PD2;
728+
use crate::gpio::{Alternate, AF10, AF12};
728729

729-
// All FSMC/FMC pins use AF12
730+
// Most FSMC/FMC pins use AF12, but a few use AF10
730731
type FmcAlternate = Alternate<AF12>;
731732

732733
impl PinD4 for PA2<FmcAlternate> {}
733734
impl PinD5 for PA3<FmcAlternate> {}
734735
impl PinD6 for PA4<FmcAlternate> {}
735736
impl PinD7 for PA5<FmcAlternate> {}
736737
impl PinD13 for PB12<FmcAlternate> {}
737-
impl PinD0 for PB14<FmcAlternate> {}
738+
impl PinD0 for PB14<Alternate<AF10>> {}
738739
impl PinWriteEnable for PC2<FmcAlternate> {}
739740
impl PinAddress for PC3<FmcAlternate> {}
740741
impl Sealed for PC3<FmcAlternate> {}
741742
impl PinChipSelect4 for PC4<FmcAlternate> {}
742743
impl Sealed for PC4<FmcAlternate> {}
743744
impl PinReadEnable for PC5<FmcAlternate> {}
744-
impl PinD1 for PC6<FmcAlternate> {}
745-
impl PinD2 for PC11<FmcAlternate> {}
746-
impl PinD3 for PC12<FmcAlternate> {}
745+
impl PinD1 for PC6<Alternate<AF10>> {}
746+
impl PinD2 for PC11<Alternate<AF10>> {}
747+
impl PinD3 for PC12<Alternate<AF10>> {}
748+
impl PinWriteEnable for PD2<Alternate<AF10>> {}
747749

748750
// Sealed trait boilerplate
749751
impl Sealed for PA2<FmcAlternate> {}
750752
impl Sealed for PA3<FmcAlternate> {}
751753
impl Sealed for PA4<FmcAlternate> {}
752754
impl Sealed for PA5<FmcAlternate> {}
753755
impl Sealed for PB12<FmcAlternate> {}
754-
impl Sealed for PB14<FmcAlternate> {}
756+
impl Sealed for PB14<Alternate<AF10>> {}
755757
impl Sealed for PC2<FmcAlternate> {}
756758
impl Sealed for PC5<FmcAlternate> {}
757-
impl Sealed for PC6<FmcAlternate> {}
758-
impl Sealed for PC11<FmcAlternate> {}
759-
impl Sealed for PC12<FmcAlternate> {}
759+
impl Sealed for PC6<Alternate<AF10>> {}
760+
impl Sealed for PC11<Alternate<AF10>> {}
761+
impl Sealed for PC12<Alternate<AF10>> {}
762+
impl Sealed for PD2<Alternate<AF10>> {}
760763
}

0 commit comments

Comments
 (0)