embedded_hal_sdmmc/command.rs
1//! SD/MMC command types.
2
3use super::response::ResponseType;
4
5mod types;
6
7pub use types::*;
8
9/// Represents common functionality for SD/MMC command types.
10pub trait Command {
11 /// Gets the SD/MMC command type.
12 fn command_type(&self) -> CommandType;
13
14 /// Gets the SD/MMC response type expected for the command.
15 fn response_type(&self) -> ResponseType;
16
17 /// Gets the SD/MMC command argument.
18 ///
19 /// # Note
20 ///
21 /// Returns `0` for commands that do not expect an argument.
22 fn argument(&self) -> u32;
23
24 /// Gets the SD/MMC command argument.
25 ///
26 /// # Note
27 ///
28 /// No effect for commands that do not expect an argument.
29 fn set_argument(&mut self, arg: u32);
30
31 /// Gets the CRC-7 of the command.
32 fn crc(&self) -> u8;
33
34 /// Sets the CRC-7 of the command.
35 fn set_crc(&mut self, crc: u8);
36}