File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,13 @@ where
237
237
return Err ( Error :: WriteError ) ;
238
238
}
239
239
} else {
240
+ // > It is recommended using this command preceding CMD25, some of the cards will be faster for Multiple
241
+ // > Write Blocks operation. Note that the host should send ACMD23 just before WRITE command if the host
242
+ // > wants to use the pre-erased feature
243
+ s. card_acmd ( ACMD23 , blocks. len ( ) as u32 ) ?;
244
+ // wait for card to be ready before sending the next command
245
+ s. wait_not_busy ( Delay :: new_write ( ) ) ?;
246
+
240
247
// Start a multi-block write
241
248
s. card_command ( CMD25 , start_idx) ?;
242
249
for block in blocks. iter ( ) {
Original file line number Diff line number Diff line change @@ -60,6 +60,12 @@ pub const CMD55: u8 = 0x37;
60
60
pub const CMD58 : u8 = 0x3A ;
61
61
/// CRC_ON_OFF - enable or disable CRC checking
62
62
pub const CMD59 : u8 = 0x3B ;
63
+ /// Pre-erased before writing
64
+ ///
65
+ /// > It is recommended using this command preceding CMD25, some of the cards will be faster for Multiple
66
+ /// > Write Blocks operation. Note that the host should send ACMD23 just before WRITE command if the host
67
+ /// > wants to use the pre-erased feature
68
+ pub const ACMD23 : u8 = 0x17 ;
63
69
/// SD_SEND_OP_COMD - Sends host capacity support information and activates
64
70
/// the card's initialization process
65
71
pub const ACMD41 : u8 = 0x29 ;
You can’t perform that action at this time.
0 commit comments