Skip to content

Commit be4d08d

Browse files
Merge #458
458: Support eMMC in SDIO module r=burrbull a=antonok-edm Followup to jkristell/sdio-host#10, which will also be required before this PR can be merged (cc `@jkristell)` This PR adds support for eMMC peripherals using the SDIO module. `Sdio` is now generic over an `SdioPeripheral`, which can either be a `SdCard` or `Emmc`. Many of the methods are generic enough to be shared between both, although some (like initialization) need to be specialized for each. Co-authored-by: Anton Lazarev <[email protected]>
2 parents 157b06d + 06437d3 commit be4d08d

File tree

4 files changed

+391
-199
lines changed

4 files changed

+391
-199
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Support eMMC peripherals using SDIO module [#458]
13+
1014
## [v0.12.0] - 2022-02-23
1115

1216
### Changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ nb = "1"
3434
rand_core = "0.6"
3535
stm32f4 = "0.14.0"
3636
synopsys-usb-otg = { version = "0.2.0", features = ["cortex-m"], optional = true }
37-
sdio-host = { version = "0.5.0", optional = true }
37+
sdio-host = { version = "0.6.0", optional = true }
3838
embedded-dma = "0.2.0"
3939
bare-metal = { version = "1" }
4040
void = { default-features = false, version = "1.0.2" }

examples/sd.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use panic_semihosting as _;
88
use stm32f4xx_hal::{
99
pac,
1010
prelude::*,
11-
sdio::{ClockFreq, Sdio},
11+
sdio::{ClockFreq, SdCard, Sdio},
1212
};
1313

1414
#[entry]
@@ -40,13 +40,13 @@ fn main() -> ! {
4040
let d3 = gpioc.pc11.into_alternate().internal_pull_up(true);
4141
let clk = gpioc.pc12.into_alternate().internal_pull_up(false);
4242
let cmd = gpiod.pd2.into_alternate().internal_pull_up(true);
43-
let mut sdio = Sdio::new(device.SDIO, (clk, cmd, d0, d1, d2, d3), &clocks);
43+
let mut sdio: Sdio<SdCard> = Sdio::new(device.SDIO, (clk, cmd, d0, d1, d2, d3), &clocks);
4444

4545
hprintln!("Waiting for card...").ok();
4646

4747
// Wait for card to be ready
4848
loop {
49-
match sdio.init_card(ClockFreq::F24Mhz) {
49+
match sdio.init(ClockFreq::F24Mhz) {
5050
Ok(_) => break,
5151
Err(_err) => (),
5252
}

0 commit comments

Comments
 (0)