Skip to content

sdmmc: add HAL traits for SD/MMC peripherals #662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rmsyn
Copy link
Contributor

@rmsyn rmsyn commented Apr 23, 2025

Adds the initial implementation of the embedded-hal SD/MMC traits.

Includes types and traits useful for handling SD/MMC peripherals.

Adds the initial implementation of the `embedded-hal` SD/MMC traits.

Includes types and traits useful for handling SD/MMC peripherals.
@rmsyn rmsyn requested a review from a team as a code owner April 23, 2025 02:05
Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I started reviewing, but I think this PR needs a bit more work.

Did you get a chance to read https://github.com/rust-embedded/embedded-hal/blob/master/docs/how-to-add-a-new-trait.md?

This PR is missing some background work, and demonstration that it can be implemented on at least two targets.

Finally, is this worth abstracting over in eh? This feels like it could be a really great addition to the ecosystem, but equally how sure are we that we're going to cover every controller operation (and the fact you're trying to cover SPI commands here too) with these abstractions?

Perhaps a more worthwhile abstraction for eh would be a block device trait?

This PR might be better as a stand alone crate, at least initially, to demonstrate its viability.

type Error;

/// Gets whether the device is a MMC card.
fn is_mmc(&self) -> bool;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imo all these bools should be enums, like CardType::Sd and TransportMode::Spi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants