Skip to content

Commit c6977f7

Browse files
committed
move CardType as well
1 parent 4ccf9ae commit c6977f7

3 files changed

Lines changed: 19 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ The format is based on [Keep a Changelog] and this project adheres to [Semantic
1919
- `crc7` function now returns the actual CRC7 value without left-shifting by and XOR-ing by/with 1.
2020
- Bumped `embedded-io` to 0.7
2121
- `CardType::SDHC` renamed to `CardType::SdhcSdcx`
22+
- `CardType` is now inside the `sdcard` module
2223

2324
### Added
2425

src/sdcard/mod.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,24 @@ pub mod cid;
3333
pub mod csd;
3434
pub mod spi;
3535

36+
/// The different types of card we support.
37+
#[cfg_attr(feature = "defmt-log", derive(defmt::Format))]
38+
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
39+
pub enum CardType {
40+
/// An standard-capacity SD Card supporting v1.x of the standard.
41+
///
42+
/// Uses byte-addressing internally, so limited to 2GiB in size.
43+
SD1,
44+
/// An standard-capacity SD Card supporting v2.x of the standard.
45+
///
46+
/// Uses byte-addressing internally, so limited to 2GiB in size.
47+
SD2,
48+
/// An high-capacity 'SDHC' Card or an extended-capacity 'SDXC' card.
49+
///
50+
/// Uses block-addressing internally to support capacities above 2GiB.
51+
SdhcSdxc,
52+
}
53+
3654
// Possible errors the SD card can return
3755
/// Card indicates last operation was a success
3856
pub const ERROR_OK: u8 = 0x00;

src/sdcard/spi.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -630,24 +630,6 @@ impl core::fmt::Display for Error {
630630

631631
impl core::error::Error for Error {}
632632

633-
/// The different types of card we support.
634-
#[cfg_attr(feature = "defmt-log", derive(defmt::Format))]
635-
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
636-
pub enum CardType {
637-
/// An standard-capacity SD Card supporting v1.x of the standard.
638-
///
639-
/// Uses byte-addressing internally, so limited to 2GiB in size.
640-
SD1,
641-
/// An standard-capacity SD Card supporting v2.x of the standard.
642-
///
643-
/// Uses byte-addressing internally, so limited to 2GiB in size.
644-
SD2,
645-
/// An high-capacity 'SDHC' Card or an extended-capacity 'SDXC' card.
646-
///
647-
/// Uses block-addressing internally to support capacities above 2GiB.
648-
SdhcSdxc,
649-
}
650-
651633
/// This an object you can use to busy-wait with a timeout.
652634
///
653635
/// Will let you call `delay` up to `max_retries` times before `delay` returns

0 commit comments

Comments
 (0)