Skip to content

Commit fb552b8

Browse files
committed
sdio: use experimental embedded-hal-sdio crate
Uses the experimental `embedded-hal-sdmmc` crate for SD/MMC traits. See discussion for reasoning: - <#3503 (comment)> - <#3503 (comment)> - <#3503 (comment)>
1 parent f017518 commit fb552b8

File tree

7 files changed

+21
-19
lines changed

7 files changed

+21
-19
lines changed

esp-hal/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ bitflags = "2.9.0"
2727
bytemuck = "1.22.0"
2828
cfg-if = "1.0.0"
2929
critical-section = { version = "1.2.0", features = ["restore-state-u32"] }
30-
embedded-hal = { version = "1.0.0", git = "https://github.com/rmsyn/embedded-hal", branch = "embedded-hal/mmc" }
31-
embedded-hal-async = { version = "1.0.0", git = "https://github.com/rmsyn/embedded-hal", branch = "embedded-hal/mmc" }
30+
embedded-hal = "1.0.0"
31+
embedded-hal-async = "1.0.0"
3232
enumset = "1.1.6"
3333
paste = "1.0.15"
3434
portable-atomic = { version = "1.11.0", default-features = false }
@@ -56,6 +56,7 @@ embassy-usb-synopsys-otg = { version = "0.2.0", optional = true }
5656
embedded-can = { version = "0.4.1", optional = true }
5757
esp-synopsys-usb-otg = { version = "0.4.2", optional = true }
5858
nb = { version = "1.1.0", optional = true }
59+
embedded-hal-sdmmc = { version = "0.1.0-alpha.2", optional = true }
5960

6061
# Logging interfaces, they are mutually exclusive so they need to be behind separate features.
6162
defmt = { version = "1.0.1", optional = true }
@@ -208,6 +209,7 @@ unstable = [
208209
"dep:rand_core-09",
209210
"dep:nb",
210211
"dep:ufmt-write",
212+
"dep:embedded-hal-sdmmc",
211213
]
212214

213215
[lints.clippy]

esp-hal/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ pub mod i2c;
226226
pub mod peripheral;
227227
#[cfg(all(feature = "unstable", any(hmac, sha)))]
228228
mod reg_access;
229-
#[cfg(any(feature = "esp32", feature = "esp32c6"))]
229+
#[cfg(all(feature = "unstable", any(feature = "esp32", feature = "esp32c6")))]
230230
pub mod sdio;
231231
#[cfg(any(spi0, spi1, spi2, spi3))]
232232
pub mod spi;

esp-hal/src/sdio.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
//! The peripheral can be used to transfer data over the SDIO bus in `Slave`
66
//! mode.
77
8-
use embedded_hal::mmc::{
8+
use embedded_hal_sdmmc::{
99
CardMode,
1010
CardType,
1111
FifoStatus,
12-
MmcCommon,
13-
MmcDevice,
12+
Common,
13+
Device,
1414
Reset,
15-
command::MmcCommand,
16-
response::MmcResponse,
15+
command::Command,
16+
response::Response,
1717
tuning::{TuningMode, TuningWidth},
1818
};
1919

@@ -227,7 +227,7 @@ impl core::fmt::Display for Error {
227227

228228
impl core::error::Error for Error {}
229229

230-
impl<'d> MmcCommon for Sdio<'d> {
230+
impl<'d> Common for Sdio<'d> {
231231
type Error = Error;
232232

233233
fn card_type(&self) -> CardType {
@@ -292,12 +292,12 @@ impl<'d> MmcCommon for Sdio<'d> {
292292
fn clear_all_response_interrupt(&mut self) {}
293293
}
294294

295-
impl<'d> MmcDevice for Sdio<'d> {
296-
fn read_command<C: MmcCommand>(&mut self) -> Result<C, Error> {
295+
impl<'d> Device for Sdio<'d> {
296+
fn read_command<C: Command>(&mut self) -> Result<C, Error> {
297297
Err(Error::unimplemented())
298298
}
299299

300-
fn write_response<R: MmcResponse>(&mut self, _response: &R) -> Result<(), Error> {
300+
fn write_response<R: Response>(&mut self, _response: &R) -> Result<(), Error> {
301301
Err(Error::unimplemented())
302302
}
303303
}

esp-lp-hal/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ test = false
1717
[dependencies]
1818
cfg-if = "1.0.0"
1919
document-features = "0.2.10"
20-
embedded-hal = { version = "1.0.0", git = "https://github.com/rmsyn/embedded-hal", branch = "embedded-hal/mmc", optional = true }
21-
embedded-hal-nb = { version = "1.0.0", git = "https://github.com/rmsyn/embedded-hal", branch = "embedded-hal/mmc", optional = true }
20+
embedded-hal = { version = "1.0.0", optional = true }
21+
embedded-hal-nb = { version = "1.0.0", optional = true }
2222
embedded-io = { version = "0.6.1", optional = true }
2323
esp32c6-lp = { version = "0.3.0", features = ["critical-section"], optional = true }
2424
esp32s2-ulp = { version = "0.3.0", features = ["critical-section"], optional = true }

examples/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ embassy-net = { version = "0.6.0", features = [ "tcp", "udp", "dhcpv4", "medium-
1717
embassy-sync = "0.6.2"
1818
embassy-time = "0.4.0"
1919
embassy-usb = { version = "0.4.0", default-features = false }
20-
embedded-hal-async = { version = "1.0.0", git = "https://github.com/rmsyn/embedded-hal", branch = "embedded-hal/mmc" }
20+
embedded-hal-async = "1.0.0"
2121
embedded-io = { version = "0.6.1", default-features = false }
2222
embedded-io-async = "0.6.1"
2323
embedded-storage = "0.3.1"

hil-test/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,12 @@ embassy-futures = "0.1.1"
230230
embedded-storage = "0.3.1"
231231
embassy-sync = "0.6.0"
232232
embassy-time = "0.4.0"
233-
embedded-hal = { version = "1.0.0", git = "https://github.com/rmsyn/embedded-hal", branch = "embedded-hal/mmc" }
233+
embedded-hal = "1.0.0"
234234
embedded-io = "0.6.1"
235235
embedded-io-async = "0.6.1"
236236
embedded-can = "0.4.1"
237-
embedded-hal-async = { version = "1.0.0", git = "https://github.com/rmsyn/embedded-hal", branch = "embedded-hal/mmc" }
238-
embedded-hal-nb = { version = "1.0.0", git = "https://github.com/rmsyn/embedded-hal", branch = "embedded-hal/mmc" }
237+
embedded-hal-async = "1.0.0"
238+
embedded-hal-nb = "1.0.0"
239239
esp-alloc = { path = "../esp-alloc", optional = true }
240240
esp-backtrace = { path = "../esp-backtrace", default-features = false, features = ["exception-handler", "defmt", "semihosting"] }
241241
esp-bootloader-esp-idf = { path = "../esp-bootloader-esp-idf" }

qa-test/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ embassy-time = "0.4.0"
1212
embassy-futures = "0.1.1"
1313
embassy-sync = "0.6.1"
1414
embedded-graphics = "0.8.1"
15-
embedded-hal-async = { version = "1.0.0", git = "https://github.com/rmsyn/embedded-hal", branch = "embedded-hal/mmc" }
15+
embedded-hal-async = "1.0.0"
1616
esp-alloc = { path = "../esp-alloc" }
1717
esp-backtrace = { path = "../esp-backtrace", features = ["exception-handler", "panic-handler", "println"] }
1818
esp-bootloader-esp-idf = { path = "../esp-bootloader-esp-idf" }

0 commit comments

Comments
 (0)