Skip to content

Commit 5eb02ce

Browse files
committed
Add documentation for FMC, remove outdated section from README
1 parent cad583d commit 5eb02ce

File tree

3 files changed

+28
-12
lines changed

3 files changed

+28
-12
lines changed

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,6 @@ The Minimum Supported Rust Version (MSRV) at the moment is **1.43.0**. Older
110110
versions **may** compile, especially when some features are not used
111111
in your application.
112112

113-
Other STM32H7 crates
114-
--------------------
115-
116-
This crate only includes implmentations of [embedded-hal][] traits or
117-
other core functionality. An incomplete list of additional peripheral
118-
support crates is given here:
119-
120-
- [stm32h7-fmc](https://crates.io/crates/stm32h7-fmc)
121-
- _[Search crates.io...](https://crates.io/search?q=stm32h7)_
122-
123113
Changelog
124114
---------
125115

examples/fmc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ const APP: () = {
151151
// ----------------------------------------------------------
152152
// SDRAM
153153
// Initialise SDRAM...
154-
let fmc_io = fmc_pins! {
154+
let sdram_pins = fmc_pins! {
155155
// A0-A11
156156
gpiof.pf0, gpiof.pf1, gpiof.pf2, gpiof.pf3,
157157
gpiof.pf4, gpiof.pf5, gpiof.pf12, gpiof.pf13,
@@ -178,7 +178,7 @@ const APP: () = {
178178
};
179179

180180
let mut sdram = dp.FMC.sdram(
181-
fmc_io,
181+
sdram_pins,
182182
is42s32800g_6::Is42s32800g {},
183183
ccdr.peripheral.FMC,
184184
&ccdr.clocks,

src/fmc.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
11
//! HAL for Flexible memory controller (FMC)
2+
//!
3+
//! FMC support is implemented via the
4+
//! [stm32-fmc](https://github.com/stm32-rs/stm32-fmc) crate.
5+
//!
6+
//! ## SDRAM
7+
//!
8+
//! An external SDRAM can be instantiated by calling the [sdram](FmcExt::sdram)
9+
//! extension method. To avoid the pin checks, you can use
10+
//! [sdram_unchecked](FmcExt::sdram_unchecked) instead.
11+
//!
12+
//! ```
13+
//! use stm32h7xx_hal::prelude::*;
14+
//!
15+
//! let sdram_pins = ...; // Tuple, see stm32-fmc docs for pin ordering
16+
//! let sdram_chip = ...; // See stm32-fmc docs
17+
//!
18+
//! let mut sdram = dp.FMC.sdram(
19+
//! sdram_pins,
20+
//! sdram_chip,
21+
//! ccdr.peripheral.FMC,
22+
//! &ccdr.clocks,
23+
//! );
24+
//! ```
25+
//!
26+
//! `sdram` usage is described
27+
//! [here](https://github.com/stm32-rs/stm32-fmc#usage).
228
329
// From stm32_fmc
430
use stm32_fmc::FmcPeripheral;

0 commit comments

Comments
 (0)