Skip to content

Commit 986469f

Browse files
committed
Rename SdCardDevice to SdCardSpiDevice
1 parent 9bf0162 commit 986469f

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ pub use crate::sdcard::Error as SdCardError;
117117
pub use crate::sdcard::SdCard;
118118

119119
#[doc(inline)]
120-
pub use crate::sdcard::SdCardDevice;
120+
pub use crate::sdcard::SdCardSpiDevice;
121121

122122
#[doc(inline)]
123123
pub use crate::sdcard::SdCardDeviceError;

src/sdcard/sd_card_device.rs renamed to src/sdcard/device.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! SD card device trait and provided implementations.
1+
//! SD card SPI device trait and provided implementations.
22
33
use core::cell::RefCell;
44

@@ -8,7 +8,7 @@ use embedded_hal::{
88
};
99

1010
/// Trait for SD cards connected via SPI.
11-
pub trait SdCardDevice {
11+
pub trait SdCardSpiDevice {
1212
/// Perform a transaction against the device.
1313
///
1414
/// This is similar to [`embedded_hal::spi::SpiDevice::transaction`], except that this sends
@@ -89,7 +89,7 @@ impl<'a, BUS, CS> RefCellSdCardDevice<'a, BUS, CS> {
8989
}
9090
}
9191

92-
impl<BUS, CS> SdCardDevice for RefCellSdCardDevice<'_, BUS, CS>
92+
impl<BUS, CS> SdCardSpiDevice for RefCellSdCardDevice<'_, BUS, CS>
9393
where
9494
BUS: SpiBus,
9595
CS: OutputPin,
@@ -133,7 +133,7 @@ mod embassy_sync_06 {
133133
}
134134
}
135135

136-
impl<CS, BUS, M> SdCardDevice for EmbassyMutexSdCardDevice<'_, BUS, CS, M>
136+
impl<CS, BUS, M> SdCardSpiDevice for EmbassyMutexSdCardDevice<'_, BUS, CS, M>
137137
where
138138
CS: OutputPin,
139139
BUS: SpiBus,
@@ -171,7 +171,7 @@ mod embedded_hal_bus_03 {
171171
// `ExclusiveDevice` represents exclusive access to the bus so there's no need to send the dummy
172172
// byte after deasserting the CS pin. We can delegate the implementation to the `embedded_hal` trait.
173173

174-
impl<CS, BUS, D> SdCardDevice for ExclusiveDevice<BUS, CS, D>
174+
impl<CS, BUS, D> SdCardSpiDevice for ExclusiveDevice<BUS, CS, D>
175175
where
176176
BUS: SpiBus,
177177
CS: OutputPin,

src/sdcard/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
//! This is currently optimised for readability and debugability, not
44
//! performance.
55
6+
mod device;
67
pub mod proto;
7-
mod sd_card_device;
88

99
use crate::{trace, Block, BlockCount, BlockDevice, BlockIdx};
1010
use core::cell::RefCell;
@@ -15,7 +15,7 @@ use proto::*;
1515
// ****************************************************************************
1616

1717
use crate::{debug, warn};
18-
pub use sd_card_device::*;
18+
pub use device::*;
1919

2020
// ****************************************************************************
2121
// Types and Implementations
@@ -39,15 +39,15 @@ pub use sd_card_device::*;
3939
/// [`SpiDevice`]: embedded_hal::spi::SpiDevice
4040
pub struct SdCard<SPI, DELAYER>
4141
where
42-
SPI: SdCardDevice,
42+
SPI: SdCardSpiDevice,
4343
DELAYER: embedded_hal::delay::DelayNs,
4444
{
4545
inner: RefCell<SdCardInner<SPI, DELAYER>>,
4646
}
4747

4848
impl<SPI, DELAYER> SdCard<SPI, DELAYER>
4949
where
50-
SPI: SdCardDevice,
50+
SPI: SdCardSpiDevice,
5151
DELAYER: embedded_hal::delay::DelayNs,
5252
{
5353
/// Create a new SD/MMC Card driver using a raw SPI interface.
@@ -168,7 +168,7 @@ where
168168

169169
impl<SPI, DELAYER> BlockDevice for SdCard<SPI, DELAYER>
170170
where
171-
SPI: SdCardDevice,
171+
SPI: SdCardSpiDevice,
172172
DELAYER: embedded_hal::delay::DelayNs,
173173
{
174174
type Error = Error;
@@ -208,7 +208,7 @@ where
208208
/// All the APIs required `&mut self`.
209209
struct SdCardInner<SPI, DELAYER>
210210
where
211-
SPI: SdCardDevice,
211+
SPI: SdCardSpiDevice,
212212
DELAYER: embedded_hal::delay::DelayNs,
213213
{
214214
spi: SPI,
@@ -219,7 +219,7 @@ where
219219

220220
impl<SPI, DELAYER> SdCardInner<SPI, DELAYER>
221221
where
222-
SPI: SdCardDevice,
222+
SPI: SdCardSpiDevice,
223223
DELAYER: embedded_hal::delay::DelayNs,
224224
{
225225
/// Read one or more blocks, starting at the given block index.

0 commit comments

Comments
 (0)