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
impl CidResponse
pub fn from_raw(raw: [u8; 16]) -> Self
Sourcepub fn manufacturer_id(&self) -> u8
pub fn manufacturer_id(&self) -> u8
Manufacturer ID (MID) — 8-bit code assigned by the SD Association.
Sourcepub fn oem_id(&self) -> [u8; 2]
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.
Sourcepub fn product_name(&self) -> [u8; 5]
pub fn product_name(&self) -> [u8; 5]
Product name (PNM) — 5 ASCII characters.
Sourcepub fn product_revision(&self) -> (u8, u8)
pub fn product_revision(&self) -> (u8, u8)
Product revision (PRV) as a (major, minor) pair, both 4-bit BCD.
Sourcepub fn serial_number(&self) -> u32
pub fn serial_number(&self) -> u32
Product serial number (PSN) — 32-bit big-endian.
Sourcepub fn manufacture_date(&self) -> (u16, u8)
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
impl Clone for CidResponse
Source§fn clone(&self) -> CidResponse
fn clone(&self) -> CidResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more