Skip to main content

CidResponse

Struct CidResponse 

Source
pub struct CidResponse {
    pub raw: [u8; 16],
}
Expand description

CID register (CMD2/CMD10 response). Identifies the card’s manufacturer, product, serial number, and manufacturing date.

Field layout follows SD Physical Layer spec section 5.2; only SD cards are decoded here. eMMC uses a different field layout and is not supported.

Fields§

§raw: [u8; 16]

Implementations§

Source§

impl CidResponse

Source

pub fn from_raw(raw: [u8; 16]) -> Self

Source

pub fn manufacturer_id(&self) -> u8

Manufacturer ID (MID) — 8-bit code assigned by the SD Association.

Source

pub fn oem_id(&self) -> [u8; 2]

OEM/Application ID (OID) — two ASCII characters identifying the card OEM. Returned as a [u8; 2]; bytes outside printable ASCII are preserved verbatim so callers can detect non-conforming firmware.

Source

pub fn product_name(&self) -> [u8; 5]

Product name (PNM) — 5 ASCII characters.

Source

pub fn product_revision(&self) -> (u8, u8)

Product revision (PRV) as a (major, minor) pair, both 4-bit BCD.

Source

pub fn serial_number(&self) -> u32

Product serial number (PSN) — 32-bit big-endian.

Source

pub fn manufacture_date(&self) -> (u16, u8)

Manufacturing date as (year, month) where year is the absolute 4-digit year (SD spec offsets year by 2000).

Layout: bits 19:8 of bytes 13..=14 hold the date — 12 bits split as year (8 bits) and month (4 bits).

Trait Implementations§

Source§

impl Clone for CidResponse

Source§

fn clone(&self) -> CidResponse

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 Debug for CidResponse

Source§

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

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

impl Copy for CidResponse

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.