STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
emmc_card.h File Reference
#include <stdbool.h>
#include <stdint.h>
Include dependency graph for emmc_card.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  emmc_card_info_t

Macros

#define EMMC_CARD_MID_KIOXIA   0x11U /* CID MID */
#define EMMC_CARD_PNM   "004GA1" /* CID PNM */
#define EMMC_CARD_SEC_COUNT   0x00760000UL /* 3,959,422,976 B */
#define EMMC_CARD_EXT_CSD_REV_MIN   7U /* eMMC 5.0 */
#define EMMC_EXT_CSD_CACHE_CTRL   33U
#define EMMC_EXT_CSD_RST_N_FUNCTION   162U
#define EMMC_EXT_CSD_WR_REL_SET   167U
#define EMMC_EXT_CSD_BUS_WIDTH   183U
#define EMMC_EXT_CSD_HS_TIMING   185U
#define EMMC_EXT_CSD_REV   192U
#define EMMC_EXT_CSD_DEVICE_TYPE   196U
#define EMMC_EXT_CSD_SEC_COUNT   212U /* 4 bytes, little-endian */
#define EMMC_EXT_CSD_PRE_EOL_INFO   267U
#define EMMC_EXT_CSD_LIFE_TIME_A   268U
#define EMMC_EXT_CSD_LIFE_TIME_B   269U

Enumerations

enum  emmc_card_issue_t {
  EMMC_CARD_OK = 0 , EMMC_CARD_WRONG_MAKER = 1U << 0 , EMMC_CARD_WRONG_PART = 1U << 1 , EMMC_CARD_WRONG_SIZE = 1U << 2 ,
  EMMC_CARD_OLD_REVISION = 1U << 3 , EMMC_CARD_WEAR_WARNING = 1U << 4 , EMMC_CARD_NO_RELIABLE_WRITE = 1U << 5 , EMMC_CARD_CACHE_ON = 1U << 6
}

Functions

void emmc_card_parse (const uint32_t cid[4], const uint8_t ext_csd[512], emmc_card_info_t *out)
uint32_t emmc_card_check (const emmc_card_info_t *info)

Macro Definition Documentation

◆ EMMC_CARD_EXT_CSD_REV_MIN

#define EMMC_CARD_EXT_CSD_REV_MIN   7U /* eMMC 5.0 */

Definition at line 21 of file emmc_card.h.

Referenced by emmc_card_check().

◆ EMMC_CARD_MID_KIOXIA

#define EMMC_CARD_MID_KIOXIA   0x11U /* CID MID */

Definition at line 18 of file emmc_card.h.

Referenced by emmc_card_check().

◆ EMMC_CARD_PNM

#define EMMC_CARD_PNM   "004GA1" /* CID PNM */

Definition at line 19 of file emmc_card.h.

Referenced by emmc_card_check().

◆ EMMC_CARD_SEC_COUNT

#define EMMC_CARD_SEC_COUNT   0x00760000UL /* 3,959,422,976 B */

Definition at line 20 of file emmc_card.h.

Referenced by emmc_card_check().

◆ EMMC_EXT_CSD_BUS_WIDTH

#define EMMC_EXT_CSD_BUS_WIDTH   183U

Definition at line 27 of file emmc_card.h.

◆ EMMC_EXT_CSD_CACHE_CTRL

#define EMMC_EXT_CSD_CACHE_CTRL   33U

Definition at line 24 of file emmc_card.h.

Referenced by datasheet_ext_csd(), emmc_card_parse(), and test_each_issue().

◆ EMMC_EXT_CSD_DEVICE_TYPE

#define EMMC_EXT_CSD_DEVICE_TYPE   196U

Definition at line 30 of file emmc_card.h.

Referenced by datasheet_ext_csd(), and emmc_card_parse().

◆ EMMC_EXT_CSD_HS_TIMING

#define EMMC_EXT_CSD_HS_TIMING   185U

Definition at line 28 of file emmc_card.h.

◆ EMMC_EXT_CSD_LIFE_TIME_A

#define EMMC_EXT_CSD_LIFE_TIME_A   268U

Definition at line 33 of file emmc_card.h.

Referenced by datasheet_ext_csd(), and emmc_card_parse().

◆ EMMC_EXT_CSD_LIFE_TIME_B

#define EMMC_EXT_CSD_LIFE_TIME_B   269U

Definition at line 34 of file emmc_card.h.

Referenced by datasheet_ext_csd(), emmc_card_parse(), and test_each_issue().

◆ EMMC_EXT_CSD_PRE_EOL_INFO

#define EMMC_EXT_CSD_PRE_EOL_INFO   267U

Definition at line 32 of file emmc_card.h.

Referenced by datasheet_ext_csd(), emmc_card_parse(), and test_each_issue().

◆ EMMC_EXT_CSD_REV

#define EMMC_EXT_CSD_REV   192U

Definition at line 29 of file emmc_card.h.

Referenced by datasheet_ext_csd(), emmc_card_parse(), and test_each_issue().

◆ EMMC_EXT_CSD_RST_N_FUNCTION

#define EMMC_EXT_CSD_RST_N_FUNCTION   162U

Definition at line 25 of file emmc_card.h.

Referenced by datasheet_ext_csd(), and emmc_card_parse().

◆ EMMC_EXT_CSD_SEC_COUNT

#define EMMC_EXT_CSD_SEC_COUNT   212U /* 4 bytes, little-endian */

Definition at line 31 of file emmc_card.h.

Referenced by datasheet_ext_csd(), emmc_card_parse(), and test_each_issue().

◆ EMMC_EXT_CSD_WR_REL_SET

#define EMMC_EXT_CSD_WR_REL_SET   167U

Definition at line 26 of file emmc_card.h.

Referenced by datasheet_ext_csd(), emmc_card_parse(), and test_each_issue().

Enumeration Type Documentation

◆ emmc_card_issue_t

Enumerator
EMMC_CARD_OK 
EMMC_CARD_WRONG_MAKER 
EMMC_CARD_WRONG_PART 
EMMC_CARD_WRONG_SIZE 
EMMC_CARD_OLD_REVISION 
EMMC_CARD_WEAR_WARNING 
EMMC_CARD_NO_RELIABLE_WRITE 
EMMC_CARD_CACHE_ON 

Definition at line 53 of file emmc_card.h.

Function Documentation

◆ emmc_card_check()

◆ emmc_card_parse()