Skip to main content

ResponseType

Enum ResponseType 

Source
#[repr(C)]
pub enum ResponseType { None = 0, R1 = 1, R1b = 2, R2 = 3, R3 = 4, R4 = 5, R5 = 6, R6 = 7, R7 = 8, }
Expand description

Represents the response types used in the SD/MMC protocol.

Variants§

§

None = 0

No response type.

§

R1 = 1

The standard response sent for most command types.

§

R1b = 2

The same as the R1 response, but drives a BUSY signal on the DAT line(s).

§

R2 = 3

136-bit response that includes the contents of the card CID or CSD register.

§

R3 = 4

Returns the contents of the card OCR register.

§

R4 = 5

SDIO response to the IO_SEND_OP_COND command.

Returns the card IO_OCR register contents, and other operating conditions.

§

R5 = 6

SDIO response to the IO_RW_DIRECT commands.

§

R6 = 7

Response containing the published RCA information.

§

R7 = 8

Response containing the card interface condition.

Implementations§

Source§

impl ResponseType

Source

pub const LEN_8BIT: usize = 1

Represents the byte length for an 8-bit response.

Source

pub const LEN_16BIT: usize = 2

Represents the byte length for an 16-bit response.

Source

pub const LEN_40BIT: usize = 5

Represents the byte length for an 40-bit response.

Source

pub const LEN_48BIT: usize = 6

Represents the byte length for an 48-bit response.

Source

pub const LEN_136BIT: usize = 17

Represents the byte length for an 136-bit response.

Source

pub const LEN_NONE: usize = 0

Represents the byte length for no response.

Source

pub const fn new() -> Self

Creates a new ResponseType.

Source

pub const fn len(&self, mode: ResponseMode) -> usize

Gets the byte length of the ResponseType based on the operation mode.

Source

pub const fn has_crc(&self, mode: ResponseMode) -> bool

Gets whether the response type includes a CRC-7 checksum field.

Trait Implementations§

Source§

impl Clone for ResponseType

Source§

fn clone(&self) -> ResponseType

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ResponseType

Source§

impl Debug for ResponseType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ResponseType

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for ResponseType

Source§

impl PartialEq for ResponseType

Source§

fn eq(&self, other: &ResponseType) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ResponseType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.