#pragma once #include #include namespace roro { // What an SD card says it is: its CID register, 16 bytes (SD Physical Layer spec, 5.2). struct SdCardId { uint8_t manufacturer = 0; // assigned by the SD Association; see sdManufacturerName() char oem[3] = {}; // two characters char product[6] = {}; // five characters uint8_t revisionMajor = 0, revisionMinor = 0; uint32_t serial = 0; int year = 0, month = 0; // manufactured }; SdCardId parseSdCid(const uint8_t cid[16]); // The usual holder of a manufacturer ID. The SD Association doesn't publish its list: these are // the commonly reported ones, and resold or counterfeit cards carry whatever their maker chose. const char* sdManufacturerName(uint8_t id); // "SanDisk (0x03) "SD" "SU08G" rev 8.0, serial 1234abcd, made 2014-03". std::string sdCardSummary(const SdCardId& id); } // namespace roro