@@ -203,7 +203,7 @@ where
203203 fn read ( & mut self , blocks : & mut [ Block ] , start_block_idx : BlockIdx ) -> Result < ( ) , Error > {
204204 let start_idx = match self . card_type {
205205 Some ( CardType :: SD1 | CardType :: SD2 ) => start_block_idx. 0 * 512 ,
206- Some ( CardType :: SDHC ) => start_block_idx. 0 ,
206+ Some ( CardType :: SdhcSdxc ) => start_block_idx. 0 ,
207207 None => return Err ( Error :: CardNotFound ) ,
208208 } ;
209209
@@ -227,7 +227,7 @@ where
227227 fn write ( & mut self , blocks : & [ Block ] , start_block_idx : BlockIdx ) -> Result < ( ) , Error > {
228228 let start_idx = match self . card_type {
229229 Some ( CardType :: SD1 | CardType :: SD2 ) => start_block_idx. 0 * 512 ,
230- Some ( CardType :: SDHC ) => start_block_idx. 0 ,
230+ Some ( CardType :: SdhcSdxc ) => start_block_idx. 0 ,
231231 None => return Err ( Error :: CardNotFound ) ,
232232 } ;
233233 if blocks. len ( ) == 1 {
@@ -293,7 +293,7 @@ where
293293 self . read_data ( & mut csd_raw) ?;
294294 Ok ( csd:: Csd :: V1 ( csd:: CsdV1 :: from_be_bytes ( & csd_raw) ) )
295295 }
296- Some ( CardType :: SD2 | CardType :: SDHC ) => {
296+ Some ( CardType :: SD2 | CardType :: SdhcSdxc ) => {
297297 if self . card_command ( CMD9 , 0 ) ? != 0 {
298298 return Err ( Error :: RegisterReadError ) ;
299299 }
@@ -443,7 +443,7 @@ where
443443 let mut buffer = [ 0xFF ; 4 ] ;
444444 s. transfer_bytes ( & mut buffer) ?;
445445 if ( buffer[ 0 ] & 0xC0 ) == 0xC0 {
446- card_type = CardType :: SDHC ;
446+ card_type = CardType :: SdhcSdxc ;
447447 }
448448 // Ignore the other three bytes
449449 }
@@ -630,24 +630,6 @@ impl core::fmt::Display for Error {
630630
631631impl 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.
646- ///
647- /// Uses block-addressing internally to support capacities above 2GiB.
648- SDHC ,
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