Skip to content

Commit f975d82

Browse files
authored
Merge pull request #1 from ValouBambou/sd-card-device
fix rename error
2 parents 0aff382 + 714d1db commit f975d82

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ designed for readability and simplicity over performance.
1010

1111
You will need something that implements the `BlockDevice` trait, which can read and write the 512-byte blocks (or sectors) from your card. If you were to implement this over USB Mass Storage, there's no reason this crate couldn't work with a USB Thumb Drive, but we only supply a `BlockDevice` suitable for reading SD and SDHC cards over SPI.
1212

13-
To accommodate specific requirements when using SD cards on a shared SPI bus, this crate uses a bespoke `SdCardDevice` trait instead of the more commmon `embedded_hal::spi::SpiDevice` trait. Implementations for several types that wrap a `embedded-hal::spi::SpiBus` implementation are provided in the `sd_card` module. Some are guarded behind cargo features:
13+
To accommodate specific requirements when using SD cards on a shared SPI bus, this crate uses a bespoke `SdCardSpiDevice` trait instead of the more commmon `embedded_hal::spi::SpiDevice` trait. Implementations for several types that wrap a `embedded-hal::spi::SpiBus` implementation are provided in the `sd_card` module. Some are guarded behind cargo features:
1414

1515
- `embedded-hal-bus-03`: adds support for `embedded-hal-bus::spi::ExclusiveDevice`. This is probably the easiest way to use this crate when the SD card is the only device on the bus.
1616
- `embassy-sync-06`: adds support for using a blocking mutex from the `embassy-sync` crate. This allows sharing the bus between multiple tasks.

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
//! suitable for reading SD and SDHC cards over SPI.
1818
//!
1919
//! ```rust
20-
//! use embedded_sdmmc::{Error, Mode, SdCard, SdCardError, TimeSource, VolumeIdx, VolumeManager, SdCardDevice};
20+
//! use embedded_sdmmc::{Error, Mode, SdCard, SdCardError, TimeSource, VolumeIdx, VolumeManager, SdCardSpiDevice};
2121
//!
2222
//! fn example<S, D, T>(spi: S, delay: D, ts: T) -> Result<(), Error<SdCardError>>
2323
//! where
24-
//! S: SdCardDevice,
24+
//! S: SdCardSpiDevice,
2525
//! D: embedded_hal::delay::DelayNs,
2626
//! T: TimeSource,
2727
//! {

src/sdcard/device.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub trait SdCardSpiDevice {
2626
///
2727
/// This is a convenience method equivalent to `device.transaction(&mut [Operation::Read(buf)])`.
2828
///
29-
/// See also: [`SdCardDevice::transaction`], [`embedded_hal::spi::SpiBus::read`]
29+
/// See also: [`SdCardSpiDevice::transaction`], [`embedded_hal::spi::SpiBus::read`]
3030
#[inline]
3131
fn read(&mut self, buf: &mut [u8]) -> Result<(), SdCardDeviceError> {
3232
self.transaction(&mut [Operation::Read(buf)])
@@ -36,7 +36,7 @@ pub trait SdCardSpiDevice {
3636
///
3737
/// This is a convenience method equivalent to `device.transaction(&mut [Operation::Write(buf)])`.
3838
///
39-
/// See also: [`SdCardDevice::transaction`], [`embedded_hal::spi::SpiBus::write`]
39+
/// See also: [`SdCardSpiDevice::transaction`], [`embedded_hal::spi::SpiBus::write`]
4040
#[inline]
4141
fn write(&mut self, buf: &[u8]) -> Result<(), SdCardDeviceError> {
4242
self.transaction(&mut [Operation::Write(buf)])
@@ -46,7 +46,7 @@ pub trait SdCardSpiDevice {
4646
///
4747
/// This is a convenience method equivalent to `device.transaction(&mut [Operation::Transfer(read, write)]`.
4848
///
49-
/// See also: [`SdCardDevice::transaction`], [`embedded_hal::spi::SpiBus::transfer`]
49+
/// See also: [`SdCardSpiDevice::transaction`], [`embedded_hal::spi::SpiBus::transfer`]
5050
#[inline]
5151
fn transfer(&mut self, read: &mut [u8], write: &[u8]) -> Result<(), SdCardDeviceError> {
5252
self.transaction(&mut [Operation::Transfer(read, write)])
@@ -56,7 +56,7 @@ pub trait SdCardSpiDevice {
5656
///
5757
/// This is a convenience method equivalent to `device.transaction(&mut [Operation::TransferInPlace(buf)]`.
5858
///
59-
/// See also: [`SdCardDevice::transaction`], [`embedded_hal::spi::SpiBus::transfer_in_place`]
59+
/// See also: [`SdCardSpiDevice::transaction`], [`embedded_hal::spi::SpiBus::transfer_in_place`]
6060
#[inline]
6161
fn transfer_in_place(&mut self, buf: &mut [u8]) -> Result<(), SdCardDeviceError> {
6262
self.transaction(&mut [Operation::TransferInPlace(buf)])

0 commit comments

Comments
 (0)