Skip to content

Commit ec42929

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: - <esp-rs#3503 (comment)> - <esp-rs#3503 (comment)> - <esp-rs#3503 (comment)>
1 parent c38418c commit ec42929

File tree

9 files changed

+23
-21
lines changed

9 files changed

+23
-21
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 }
@@ -211,6 +212,7 @@ unstable = [
211212
"dep:rand_core-09",
212213
"dep:nb",
213214
"dep:ufmt-write",
215+
"dep:embedded-hal-sdmmc",
214216
]
215217

216218
[lints.clippy]

esp-hal/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ pub mod i2c;
222222
pub mod peripheral;
223223
#[cfg(all(feature = "unstable", any(hmac, sha)))]
224224
mod reg_access;
225-
#[cfg(any(feature = "esp32", feature = "esp32c6"))]
225+
#[cfg(all(feature = "unstable", any(feature = "esp32", feature = "esp32c6")))]
226226
pub mod sdio;
227227
#[cfg(any(spi0, spi1, spi2, spi3))]
228228
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,
11+
Common,
12+
Device,
1113
FifoStatus,
12-
MmcCommon,
13-
MmcDevice,
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 Common for Sdio<'_> {
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 Device for Sdio<'_> {
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-hal/src/sdio/slc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ impl PeripheralInstance for AnySlc<'_> {
3131
/// A peripheral singleton compatible with the SDIO SLC driver.
3232
pub trait SlcInstance: PeripheralInstance + IntoAnySlc {}
3333

34-
impl<'d> SlcInstance for AnySlc<'d> {}
34+
impl SlcInstance for AnySlc<'_> {}

esp-hal/src/sdio/slchost.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ impl PeripheralInstance for AnySlchost<'_> {
3131
/// A peripheral singleton compatible with the SDIO SLCHOST driver.
3232
pub trait SlchostInstance: PeripheralInstance + IntoAnySlchost {}
3333

34-
impl<'d> SlchostInstance for AnySlchost<'d> {}
34+
impl SlchostInstance for AnySlchost<'_> {}

esp-lp-hal/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ test = false
2222
[dependencies]
2323
cfg-if = "1.0.0"
2424
document-features = "0.2.10"
25-
embedded-hal = { version = "1.0.0", git = "https://github.com/rmsyn/embedded-hal", branch = "embedded-hal/mmc", optional = true }
26-
embedded-hal-nb = { version = "1.0.0", git = "https://github.com/rmsyn/embedded-hal", branch = "embedded-hal/mmc", optional = true }
25+
embedded-hal = { version = "1.0.0", optional = true }
26+
embedded-hal-nb = { version = "1.0.0", optional = true }
2727
embedded-io = { version = "0.6.1", optional = true }
2828
esp32c6-lp = { version = "0.3.0", features = ["critical-section"], optional = true }
2929
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)