pub struct Command {
pub index: u8,
pub argument: u32,
pub response: ResponseType,
}Expand description
SD/SDIO/MMC command packet submitted on the CMD line.
Fields§
§index: u8§argument: u32§response: ResponseTypeImplementations§
Source§impl Command
impl Command
pub const fn new(index: u8, argument: u32, response: ResponseType) -> Self
pub const fn index(self) -> u8
pub const fn argument(self) -> u32
pub const fn with_response(self, response: ResponseType) -> Self
Sourcepub const fn with_resp_type(self, response: ResponseType) -> Self
pub const fn with_resp_type(self, response: ResponseType) -> Self
Return a copy of this command with its response type overridden.
Kept as a compatibility alias for existing SD/MMC protocol helpers.
Sourcepub const fn data_direction(&self) -> Option<DataDirection>
pub const fn data_direction(&self) -> Option<DataDirection>
Direction of the data phase that follows this command when it is unambiguous from the command index alone.
SDIO CMD53 carries its direction in the argument; CMD6 is also
overloaded between ACMD6 and SWITCH_FUNC, so both return None.
Sourcepub const fn data_block_size(&self) -> Option<u32>
pub const fn data_block_size(&self) -> Option<u32>
Size in bytes of the data block when fixed by the command index.
Sourcepub fn to_spi_bytes(&self) -> [u8; 6]
pub fn to_spi_bytes(&self) -> [u8; 6]
Build the 6-byte SD SPI command packet.
Trait Implementations§
impl Copy for Command
impl Eq for Command
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more