MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Overview

The sdmmc common function and definition.

Data Structures

struct  sd_detect_card_t
 sd card detect More...
 
struct  sd_io_voltage_t
 io voltage control configuration More...
 
struct  sd_usr_param_t
 sdcard user parameter More...
 
struct  sdio_card_int_t
 card interrupt application callback More...
 
struct  sdio_usr_param_t
 sdio user parameter More...
 
struct  sdio_fbr_t
 sdio card FBR register More...
 
struct  sdio_common_cis_t
 sdio card common CIS More...
 
struct  sdio_func_cis_t
 sdio card function CIS More...
 
struct  sd_status_t
 SD card status. More...
 
struct  sd_cid_t
 SD card CID register. More...
 
struct  sd_csd_t
 SD card CSD register. More...
 
struct  sd_scr_t
 SD card SCR register. More...
 
struct  mmc_cid_t
 MMC card CID register. More...
 
struct  mmc_csd_t
 MMC card CSD register. More...
 
struct  mmc_extended_csd_t
 MMC card Extended CSD register (unit: byte). More...
 
struct  mmc_extended_csd_config_t
 MMC Extended CSD configuration. More...
 
struct  mmc_boot_config_t
 MMC card boot configuration definition. More...
 

Macros

#define SWAP_WORD_BYTE_SEQUENCE(x)   (__REV(x))
 Reverse byte sequence in uint32_t.
 
#define SWAP_HALF_WROD_BYTE_SEQUENCE(x)   (__REV16(x))
 Reverse byte sequence for each half word in uint32_t.
 
#define FSL_SDMMC_MAX_VOLTAGE_RETRIES   (1000U)
 Maximum loop count to check the card operation voltage range.
 
#define FSL_SDMMC_MAX_CMD_RETRIES   (10U)
 Maximum loop count to send the cmd.
 
#define FSL_SDMMC_DEFAULT_BLOCK_SIZE   (512U)
 Default block size.
 
#define SDMMC_DATA_BUFFER_ALIGN_CACHE   sizeof(uint32_t)
 make sure the internal buffer address is cache align
 
#define FSL_SDMMC_CARD_INTERNAL_BUFFER_SIZE   (FSL_SDMMC_DEFAULT_BLOCK_SIZE + SDMMC_DATA_BUFFER_ALIGN_CACHE)
 sdmmc card internal buffer size
 
#define FSL_SDMMC_CARD_MAX_BUS_FREQ(max, target)   (max == 0U ? target : (max > target ? target : max))
 get maximum freq
 
#define SDMMC_LOG(format,...)
 SD/MMC error log. More...
 
#define SDMMC_CLOCK_400KHZ   (400000U)
 SD/MMC card initialization clock frequency.
 
#define SD_CLOCK_25MHZ   (25000000U)
 SD card bus frequency 1 in high-speed mode.
 
#define SD_CLOCK_50MHZ   (50000000U)
 SD card bus frequency 2 in high-speed mode.
 
#define SD_CLOCK_100MHZ   (100000000U)
 SD card bus frequency in SDR50 mode.
 
#define SD_CLOCK_208MHZ   (208000000U)
 SD card bus frequency in SDR104 mode.
 
#define MMC_CLOCK_26MHZ   (26000000U)
 MMC card bus frequency 1 in high-speed mode.
 
#define MMC_CLOCK_52MHZ   (52000000U)
 MMC card bus frequency 2 in high-speed mode.
 
#define MMC_CLOCK_DDR52   (52000000U)
 MMC card bus frequency in high-speed DDR52 mode.
 
#define MMC_CLOCK_HS200   (200000000U)
 MMC card bus frequency in high-speed HS200 mode.
 
#define MMC_CLOCK_HS400   (400000000U)
 MMC card bus frequency in high-speed HS400 mode.
 
#define SDMMC_MASK(bit)   (1U << (bit))
 mask convert
 
#define SDMMC_R1_ALL_ERROR_FLAG
 R1 all the error flag.
 
#define SDMMC_R1_CURRENT_STATE(x)   (((x)&0x00001E00U) >> 9U)
 R1: current state.
 
#define SDSPI_R7_VERSION_SHIFT   (28U)
 The bit mask for COMMAND VERSION field in R7.
 
#define SDSPI_R7_VERSION_MASK   (0xFU)
 The bit mask for COMMAND VERSION field in R7.
 
#define SDSPI_R7_VOLTAGE_SHIFT   (8U)
 The bit shift for VOLTAGE ACCEPTED field in R7.
 
#define SDSPI_R7_VOLTAGE_MASK   (0xFU)
 The bit mask for VOLTAGE ACCEPTED field in R7.
 
#define SDSPI_R7_VOLTAGE_27_36_MASK   (0x1U << SDSPI_R7_VOLTAGE_SHIFT)
 The bit mask for VOLTAGE 2.7V to 3.6V field in R7.
 
#define SDSPI_R7_ECHO_SHIFT   (0U)
 The bit shift for ECHO field in R7.
 
#define SDSPI_R7_ECHO_MASK   (0xFFU)
 The bit mask for ECHO field in R7.
 
#define SDSPI_DATA_ERROR_TOKEN_MASK   (0xFU)
 Data error token mask.
 
#define SDSPI_DATA_RESPONSE_TOKEN_MASK   (0x1FU)
 Mask for data response bits.
 
#define SDIO_CCCR_REG_NUMBER   (0x16U)
 sdio card cccr register number
 
#define SDIO_IO_READY_TIMEOUT_UNIT   (10U)
 sdio IO ready timeout steps
 
#define SDIO_CMD_ARGUMENT_RW_POS   (31U)
 read/write flag position
 
#define SDIO_CMD_ARGUMENT_FUNC_NUM_POS   (28U)
 function number position
 
#define SDIO_DIRECT_CMD_ARGUMENT_RAW_POS   (27U)
 direct raw flag position
 
#define SDIO_CMD_ARGUMENT_REG_ADDR_POS   (9U)
 direct reg addr position
 
#define SDIO_CMD_ARGUMENT_REG_ADDR_MASK   (0x1FFFFU)
 direct reg addr mask
 
#define SDIO_DIRECT_CMD_DATA_MASK   (0xFFU)
 data mask
 
#define SDIO_EXTEND_CMD_ARGUMENT_BLOCK_MODE_POS   (27U)
 extended command argument block mode bit position
 
#define SDIO_EXTEND_CMD_ARGUMENT_OP_CODE_POS   (26U)
 extended command argument OP Code bit position
 
#define SDIO_EXTEND_CMD_BLOCK_MODE_MASK   (0x08000000U)
 block mode mask
 
#define SDIO_EXTEND_CMD_OP_CODE_MASK   (0x04000000U)
 op code mask
 
#define SDIO_EXTEND_CMD_COUNT_MASK   (0x1FFU)
 byte/block count mask
 
#define SDIO_MAX_BLOCK_SIZE   (2048U)
 max block size
 
#define SDIO_FBR_BASE(x)   (x * 0x100U)
 function basic register
 
#define SDIO_TPL_CODE_END   (0xFFU)
 tuple end
 
#define SDIO_TPL_CODE_MANIFID   (0x20U)
 manufacturer ID
 
#define SDIO_TPL_CODE_FUNCID   (0x21U)
 function ID
 
#define SDIO_TPL_CODE_FUNCE   (0x22U)
 function extension tuple
 
#define SDIO_OCR_VOLTAGE_WINDOW_MASK   (0xFFFFU << 8U)
 sdio ocr voltage window mask
 
#define SDIO_OCR_IO_NUM_MASK   (7U << kSDIO_OcrIONumber)
 sdio ocr reigster IO NUMBER mask
 
#define SDIO_CCCR_SUPPORT_HIGHSPEED   (1u << 9U)
 UHS timing mode flag.
 
#define SDIO_CCCR_DRIVER_TYPE_MASK   (3U << 4U)
 Driver type flag.
 
#define SDIO_CCCR_ASYNC_INT_MASK   (1U)
 aync interrupt flag
 
#define SDIO_CCCR_SUPPORT_8BIT_BUS   (1U << 18U)
 8 bit data bus flag
 
#define MMC_OCR_V170TO195_SHIFT   (7U)
 The bit mask for VOLTAGE WINDOW 1.70V to 1.95V field in OCR.
 
#define MMC_OCR_V170TO195_MASK   (0x00000080U)
 The bit mask for VOLTAGE WINDOW 1.70V to 1.95V field in OCR.
 
#define MMC_OCR_V200TO260_SHIFT   (8U)
 The bit shift for VOLTAGE WINDOW 2.00V to 2.60V field in OCR.
 
#define MMC_OCR_V200TO260_MASK   (0x00007F00U)
 The bit mask for VOLTAGE WINDOW 2.00V to 2.60V field in OCR.
 
#define MMC_OCR_V270TO360_SHIFT   (15U)
 The bit shift for VOLTAGE WINDOW 2.70V to 3.60V field in OCR.
 
#define MMC_OCR_V270TO360_MASK   (0x00FF8000U)
 The bit mask for VOLTAGE WINDOW 2.70V to 3.60V field in OCR.
 
#define MMC_OCR_ACCESS_MODE_SHIFT   (29U)
 The bit shift for ACCESS MODE field in OCR.
 
#define MMC_OCR_ACCESS_MODE_MASK   (0x60000000U)
 The bit mask for ACCESS MODE field in OCR.
 
#define MMC_OCR_BUSY_SHIFT   (31U)
 The bit shift for BUSY field in OCR.
 
#define MMC_OCR_BUSY_MASK   (1U << MMC_OCR_BUSY_SHIFT)
 The bit mask for BUSY field in OCR.
 
#define MMC_TRANSFER_SPEED_FREQUENCY_UNIT_SHIFT   (0U)
 The bit shift for FREQUENCY UNIT field in TRANSFER SPEED(TRAN-SPEED in Extended CSD)
 
#define MMC_TRANSFER_SPEED_FREQUENCY_UNIT_MASK   (0x07U)
 The bit mask for FRQEUENCY UNIT in TRANSFER SPEED.
 
#define MMC_TRANSFER_SPEED_MULTIPLIER_SHIFT   (3U)
 The bit shift for MULTIPLIER field in TRANSFER SPEED.
 
#define MMC_TRANSFER_SPEED_MULTIPLIER_MASK   (0x78U)
 The bit mask for MULTIPLIER field in TRANSFER SPEED.
 
#define READ_MMC_TRANSFER_SPEED_FREQUENCY_UNIT(CSD)   (((CSD.transferSpeed) & MMC_TRANSFER_SPEED_FREQUENCY_UNIT_MASK) >> MMC_TRANSFER_SPEED_FREQUENCY_UNIT_SHIFT)
 Read the value of FREQUENCY UNIT in TRANSFER SPEED. More...
 
#define READ_MMC_TRANSFER_SPEED_MULTIPLIER(CSD)   (((CSD.transferSpeed) & MMC_TRANSFER_SPEED_MULTIPLIER_MASK) >> MMC_TRANSFER_SPEED_MULTIPLIER_SHIFT)
 Read the value of MULTIPLER filed in TRANSFER SPEED. More...
 
#define MMC_POWER_CLASS_4BIT_MASK   (0x0FU)
 The power class value bit mask when bus in 4 bit mode.
 
#define MMC_POWER_CLASS_8BIT_MASK   (0xF0U)
 The power class current value bit mask when bus in 8 bit mode.
 
#define MMC_DATA_BUS_WIDTH_TYPE_NUMBER   (3U)
 The number of data bus width type.
 
#define MMC_PARTITION_CONFIG_PARTITION_ACCESS_SHIFT   (0U)
 The bit shift for PARTITION ACCESS filed in BOOT CONFIG (BOOT_CONFIG in Extend CSD)
 
#define MMC_PARTITION_CONFIG_PARTITION_ACCESS_MASK   (0x00000007U)
 The bit mask for PARTITION ACCESS field in BOOT CONFIG.
 
#define MMC_PARTITION_CONFIG_PARTITION_ENABLE_SHIFT   (3U)
 The bit shift for PARTITION ENABLE field in BOOT CONFIG.
 
#define MMC_PARTITION_CONFIG_PARTITION_ENABLE_MASK   (0x00000038U)
 The bit mask for PARTITION ENABLE field in BOOT CONFIG.
 
#define MMC_PARTITION_CONFIG_BOOT_ACK_SHIFT   (6U)
 The bit shift for ACK field in BOOT CONFIG.
 
#define MMC_PARTITION_CONFIG_BOOT_ACK_MASK   (0x00000040U)
 The bit mask for ACK field in BOOT CONFIG.
 
#define MMC_BOOT_BUS_CONDITION_BUS_WIDTH_SHIFT   (0U)
 The bit shift for BOOT BUS WIDTH field in BOOT CONFIG.
 
#define MMC_BOOT_BUS_CONDITION_BUS_WIDTH_MASK   (3U)
 The bit mask for BOOT BUS WIDTH field in BOOT CONFIG.
 
#define MMC_BOOT_BUS_CONDITION_RESET_BUS_CONDITION_SHIFT   (2U)
 The bit shift for BOOT BUS WIDTH RESET field in BOOT CONFIG.
 
#define MMC_BOOT_BUS_CONDITION_RESET_BUS_CONDITION_MASK   (4U)
 The bit mask for BOOT BUS WIDTH RESET field in BOOT CONFIG.
 
#define MMC_BOOT_BUS_CONDITION_BOOT_MODE_SHIFT   (3U)
 The bit shift for BOOT MODE field in BOOT CONFIG.
 
#define MMC_BOOT_BUS_CONDITION_BOOT_MODE_MASK   (0x18U)
 The bit mask for BOOT MODE field in BOOT CONFIG.
 
#define MMC_EXTENDED_CSD_BYTES   (512U)
 The length of Extended CSD register, unit as bytes. More...
 
#define MMC_DEFAULT_RELATIVE_ADDRESS   (2U)
 MMC card default relative address.
 
#define SD_PRODUCT_NAME_BYTES   (5U)
 SD card product name length united as bytes. More...
 
#define SD_AU_START_VALUE   (1U)
 SD AU start value.
 
#define SD_UHS_AU_START_VALUE   (7U)
 SD UHS AU start value.
 
#define SD_TRANSFER_SPEED_RATE_UNIT_SHIFT   (0U)
 The bit shift for RATE UNIT field in TRANSFER SPEED.
 
#define SD_TRANSFER_SPEED_RATE_UNIT_MASK   (0x07U)
 The bit mask for RATE UNIT field in TRANSFER SPEED.
 
#define SD_TRANSFER_SPEED_TIME_VALUE_SHIFT   (2U)
 The bit shift for TIME VALUE field in TRANSFER SPEED.
 
#define SD_TRANSFER_SPEED_TIME_VALUE_MASK   (0x78U)
 The bit mask for TIME VALUE field in TRANSFER SPEED.
 
#define SD_RD_TRANSFER_SPEED_RATE_UNIT(x)   (((x.transferSpeed) & SD_TRANSFER_SPEED_RATE_UNIT_MASK) >> SD_TRANSFER_SPEED_RATE_UNIT_SHIFT)
 Read the value of FREQUENCY UNIT in TRANSFER SPEED field.
 
#define SD_RD_TRANSFER_SPEED_TIME_VALUE(x)   (((x.transferSpeed) & SD_TRANSFER_SPEED_TIME_VALUE_MASK) >> SD_TRANSFER_SPEED_TIME_VALUE_SHIFT)
 Read the value of TIME VALUE in TRANSFER SPEED field.
 
#define MMC_PRODUCT_NAME_BYTES   (6U)
 MMC card product name length united as bytes. More...
 
#define MMC_SWITCH_COMMAND_SET_SHIFT   (0U)
 The bit shift for COMMAND SET field in SWITCH command. More...
 
#define MMC_SWITCH_COMMAND_SET_MASK   (0x00000007U)
 The bit mask for COMMAND set field in SWITCH command. More...
 
#define MMC_SWITCH_VALUE_SHIFT   (8U)
 The bit shift for VALUE field in SWITCH command.
 
#define MMC_SWITCH_VALUE_MASK   (0x0000FF00U)
 The bit mask for VALUE field in SWITCH command.
 
#define MMC_SWITCH_BYTE_INDEX_SHIFT   (16U)
 The bit shift for BYTE INDEX field in SWITCH command.
 
#define MMC_SWITCH_BYTE_INDEX_MASK   (0x00FF0000U)
 The bit mask for BYTE INDEX field in SWITCH command.
 
#define MMC_SWITCH_ACCESS_MODE_SHIFT   (24U)
 The bit shift for ACCESS MODE field in SWITCH command.
 
#define MMC_SWTICH_ACCESS_MODE_MASK   (0x03000000U)
 The bit mask for ACCESS MODE field in SWITCH command.
 

Typedefs

typedef void(* sd_cd_t )(bool isInserted, void *userData)
 card detect aoolication callback definition
 
typedef bool(* sd_cd_status_t )(void)
 card detect status
 
typedef void(* sd_io_voltage_func_t )(sdmmc_operation_voltage_t voltage)
 card switch voltage function pointer
 
typedef void(* sd_pwr_t )(bool enable)
 card power control function pointer
 
typedef void(* sd_io_strength_t )(uint32_t busFreq)
 card io strength control
 
typedef void(* sdio_int_t )(void *userData)
 card interrupt function pointer
 

Enumerations

enum  _sdmmc_status {
  kStatus_SDMMC_NotSupportYet = MAKE_STATUS(kStatusGroup_SDMMC, 0U),
  kStatus_SDMMC_TransferFailed = MAKE_STATUS(kStatusGroup_SDMMC, 1U),
  kStatus_SDMMC_SetCardBlockSizeFailed = MAKE_STATUS(kStatusGroup_SDMMC, 2U),
  kStatus_SDMMC_HostNotSupport = MAKE_STATUS(kStatusGroup_SDMMC, 3U),
  kStatus_SDMMC_CardNotSupport = MAKE_STATUS(kStatusGroup_SDMMC, 4U),
  kStatus_SDMMC_AllSendCidFailed = MAKE_STATUS(kStatusGroup_SDMMC, 5U),
  kStatus_SDMMC_SendRelativeAddressFailed = MAKE_STATUS(kStatusGroup_SDMMC, 6U),
  kStatus_SDMMC_SendCsdFailed = MAKE_STATUS(kStatusGroup_SDMMC, 7U),
  kStatus_SDMMC_SelectCardFailed = MAKE_STATUS(kStatusGroup_SDMMC, 8U),
  kStatus_SDMMC_SendScrFailed = MAKE_STATUS(kStatusGroup_SDMMC, 9U),
  kStatus_SDMMC_SetDataBusWidthFailed = MAKE_STATUS(kStatusGroup_SDMMC, 10U),
  kStatus_SDMMC_GoIdleFailed = MAKE_STATUS(kStatusGroup_SDMMC, 11U),
  kStatus_SDMMC_HandShakeOperationConditionFailed,
  kStatus_SDMMC_SendApplicationCommandFailed,
  kStatus_SDMMC_SwitchFailed = MAKE_STATUS(kStatusGroup_SDMMC, 14U),
  kStatus_SDMMC_StopTransmissionFailed = MAKE_STATUS(kStatusGroup_SDMMC, 15U),
  kStatus_SDMMC_WaitWriteCompleteFailed = MAKE_STATUS(kStatusGroup_SDMMC, 16U),
  kStatus_SDMMC_SetBlockCountFailed = MAKE_STATUS(kStatusGroup_SDMMC, 17U),
  kStatus_SDMMC_SetRelativeAddressFailed = MAKE_STATUS(kStatusGroup_SDMMC, 18U),
  kStatus_SDMMC_SwitchBusTimingFailed = MAKE_STATUS(kStatusGroup_SDMMC, 19U),
  kStatus_SDMMC_SendExtendedCsdFailed = MAKE_STATUS(kStatusGroup_SDMMC, 20U),
  kStatus_SDMMC_ConfigureBootFailed = MAKE_STATUS(kStatusGroup_SDMMC, 21U),
  kStatus_SDMMC_ConfigureExtendedCsdFailed = MAKE_STATUS(kStatusGroup_SDMMC, 22U),
  kStatus_SDMMC_EnableHighCapacityEraseFailed,
  kStatus_SDMMC_SendTestPatternFailed = MAKE_STATUS(kStatusGroup_SDMMC, 24U),
  kStatus_SDMMC_ReceiveTestPatternFailed = MAKE_STATUS(kStatusGroup_SDMMC, 25U),
  kStatus_SDMMC_SDIO_ResponseError = MAKE_STATUS(kStatusGroup_SDMMC, 26U),
  kStatus_SDMMC_SDIO_InvalidArgument,
  kStatus_SDMMC_SDIO_SendOperationConditionFail,
  kStatus_SDMMC_InvalidVoltage = MAKE_STATUS(kStatusGroup_SDMMC, 29U),
  kStatus_SDMMC_SDIO_SwitchHighSpeedFail = MAKE_STATUS(kStatusGroup_SDMMC, 30U),
  kStatus_SDMMC_SDIO_ReadCISFail = MAKE_STATUS(kStatusGroup_SDMMC, 31U),
  kStatus_SDMMC_SDIO_InvalidCard = MAKE_STATUS(kStatusGroup_SDMMC, 32U),
  kStatus_SDMMC_TuningFail = MAKE_STATUS(kStatusGroup_SDMMC, 33U),
  kStatus_SDMMC_SwitchVoltageFail = MAKE_STATUS(kStatusGroup_SDMMC, 34U),
  kStatus_SDMMC_SwitchVoltage18VFail33VSuccess = MAKE_STATUS(kStatusGroup_SDMMC, 35U),
  kStatus_SDMMC_ReTuningRequest = MAKE_STATUS(kStatusGroup_SDMMC, 36U),
  kStatus_SDMMC_SetDriverStrengthFail = MAKE_STATUS(kStatusGroup_SDMMC, 37U),
  kStatus_SDMMC_SetPowerClassFail = MAKE_STATUS(kStatusGroup_SDMMC, 38U),
  kStatus_SDMMC_HostNotReady = MAKE_STATUS(kStatusGroup_SDMMC, 39U),
  kStatus_SDMMC_CardDetectFailed = MAKE_STATUS(kStatusGroup_SDMMC, 40U),
  kStatus_SDMMC_AuSizeNotSetProperly = MAKE_STATUS(kStatusGroup_SDMMC, 41U)
}
 SD/MMC card API's running status. More...
 
enum  _sdmmc_signal_line {
  kSDMMC_SignalLineCmd = 1U,
  kSDMMC_SignalLineData0 = 2U,
  kSDMMC_SignalLineData1 = 4U,
  kSDMMC_SignalLineData2 = 8U,
  kSDMMC_SignalLineData3 = 16U,
  kSDMMC_SignalLineData4 = 32U,
  kSDMMC_SignalLineData5 = 64U,
  kSDMMC_SignalLineData6 = 128U,
  kSDMMC_SignalLineData7 = 256U
}
 sdmmc signal line More...
 
enum  sdmmc_operation_voltage_t {
  kSDMMC_OperationVoltageNone = 0U,
  kSDMMC_OperationVoltage330V = 1U,
  kSDMMC_OperationVoltage300V = 2U,
  kSDMMC_OperationVoltage180V = 3U
}
 card operation voltage More...
 
enum  _sdmmc_bus_width {
  kSDMMC_BusWdith1Bit = 0U,
  kSDMMC_BusWdith4Bit = 1U,
  kSDMMC_BusWdith8Bit = 2U
}
 card bus width More...
 
enum  _sdmmc_capability_flag { kSDMMC_Support8BitWidth = 1U }
 sdmmc capability flag More...
 
enum  sd_detect_card_type_t {
  kSD_DetectCardByGpioCD,
  kSD_DetectCardByHostCD,
  kSD_DetectCardByHostDATA3
}
 sd card detect type More...
 
enum  _sd_card_cd_status {
  kSD_Inserted = 1U,
  kSD_Removed = 0U
}
 @ brief SD card detect status More...
 
enum  sd_io_voltage_ctrl_type_t {
  kSD_IOVoltageCtrlNotSupport = 0U,
  kSD_IOVoltageCtrlByHost = 1U,
  kSD_IOVoltageCtrlByGpio = 2U
}
 io voltage control type More...
 
enum  _sdmmc_r1_card_status_flag {
  kSDMMC_R1OutOfRangeFlag = 31,
  kSDMMC_R1AddressErrorFlag = 30,
  kSDMMC_R1BlockLengthErrorFlag = 29,
  kSDMMC_R1EraseSequenceErrorFlag = 28,
  kSDMMC_R1EraseParameterErrorFlag = 27,
  kSDMMC_R1WriteProtectViolationFlag = 26,
  kSDMMC_R1CardIsLockedFlag = 25,
  kSDMMC_R1LockUnlockFailedFlag = 24,
  kSDMMC_R1CommandCrcErrorFlag = 23,
  kSDMMC_R1IllegalCommandFlag = 22,
  kSDMMC_R1CardEccFailedFlag = 21,
  kSDMMC_R1CardControllerErrorFlag = 20,
  kSDMMC_R1ErrorFlag = 19,
  kSDMMC_R1CidCsdOverwriteFlag = 16,
  kSDMMC_R1WriteProtectEraseSkipFlag = 15,
  kSDMMC_R1CardEccDisabledFlag = 14,
  kSDMMC_R1EraseResetFlag = 13,
  kSDMMC_R1ReadyForDataFlag = 8,
  kSDMMC_R1SwitchErrorFlag = 7,
  kSDMMC_R1ApplicationCommandFlag = 5,
  kSDMMC_R1AuthenticationSequenceErrorFlag = 3
}
 Card status bit in R1. More...
 
enum  sdmmc_r1_current_state_t {
  kSDMMC_R1StateIdle = 0U,
  kSDMMC_R1StateReady = 1U,
  kSDMMC_R1StateIdentify = 2U,
  kSDMMC_R1StateStandby = 3U,
  kSDMMC_R1StateTransfer = 4U,
  kSDMMC_R1StateSendData = 5U,
  kSDMMC_R1StateReceiveData = 6U,
  kSDMMC_R1StateProgram = 7U,
  kSDMMC_R1StateDisconnect = 8U
}
 CURRENT_STATE filed in R1. More...
 
enum  _sdspi_r1_error_status_flag {
  kSDSPI_R1InIdleStateFlag = (1U << 0U),
  kSDSPI_R1EraseResetFlag = (1U << 1U),
  kSDSPI_R1IllegalCommandFlag = (1U << 2U),
  kSDSPI_R1CommandCrcErrorFlag = (1U << 3U),
  kSDSPI_R1EraseSequenceErrorFlag = (1U << 4U),
  kSDSPI_R1AddressErrorFlag = (1U << 5U),
  kSDSPI_R1ParameterErrorFlag = (1U << 6U)
}
 Error bit in SPI mode R1. More...
 
enum  _sdspi_r2_error_status_flag {
  kSDSPI_R2CardLockedFlag = (1U << 0U),
  kSDSPI_R2WriteProtectEraseSkip = (1U << 1U),
  kSDSPI_R2LockUnlockFailed = (1U << 1U),
  kSDSPI_R2ErrorFlag = (1U << 2U),
  kSDSPI_R2CardControllerErrorFlag = (1U << 3U),
  kSDSPI_R2CardEccFailedFlag = (1U << 4U),
  kSDSPI_R2WriteProtectViolationFlag = (1U << 5U),
  kSDSPI_R2EraseParameterErrorFlag = (1U << 6U),
  kSDSPI_R2OutOfRangeFlag = (1U << 7U),
  kSDSPI_R2CsdOverwriteFlag = (1U << 7U)
}
 Error bit in SPI mode R2. More...
 
enum  _sdspi_data_error_token {
  kSDSPI_DataErrorTokenError = (1U << 0U),
  kSDSPI_DataErrorTokenCardControllerError = (1U << 1U),
  kSDSPI_DataErrorTokenCardEccFailed = (1U << 2U),
  kSDSPI_DataErrorTokenOutOfRange = (1U << 3U)
}
 Data Error Token mask bit. More...
 
enum  sdspi_data_token_t {
  kSDSPI_DataTokenBlockRead = 0xFEU,
  kSDSPI_DataTokenSingleBlockWrite = 0xFEU,
  kSDSPI_DataTokenMultipleBlockWrite = 0xFCU,
  kSDSPI_DataTokenStopTransfer = 0xFDU
}
 Data Token. More...
 
enum  sdspi_data_response_token_t {
  kSDSPI_DataResponseTokenAccepted = 0x05U,
  kSDSPI_DataResponseTokenCrcError = 0x0BU,
  kSDSPI_DataResponseTokenWriteError = 0x0DU
}
 Data Response Token. More...
 
enum  sd_command_t {
  kSD_SendRelativeAddress = 3U,
  kSD_Switch = 6U,
  kSD_SendInterfaceCondition = 8U,
  kSD_VoltageSwitch = 11U,
  kSD_SpeedClassControl = 20U,
  kSD_EraseWriteBlockStart = 32U,
  kSD_EraseWriteBlockEnd = 33U,
  kSD_SendTuningBlock = 19U
}
 SD card individual commands. More...
 
enum  sdspi_command_t { kSDSPI_CommandCrc = 59U }
 SDSPI individual commands. More...
 
enum  sd_application_command_t {
  kSD_ApplicationSetBusWdith = 6U,
  kSD_ApplicationStatus = 13U,
  kSD_ApplicationSendNumberWriteBlocks = 22U,
  kSD_ApplicationSetWriteBlockEraseCount = 23U,
  kSD_ApplicationSendOperationCondition = 41U,
  kSD_ApplicationSetClearCardDetect = 42U,
  kSD_ApplicationSendScr = 51U
}
 SD card individual application commands. More...
 
enum  _sdmmc_command_class {
  kSDMMC_CommandClassBasic = (1U << 0U),
  kSDMMC_CommandClassBlockRead = (1U << 2U),
  kSDMMC_CommandClassBlockWrite = (1U << 4U),
  kSDMMC_CommandClassErase = (1U << 5U),
  kSDMMC_CommandClassWriteProtect = (1U << 6U),
  kSDMMC_CommandClassLockCard = (1U << 7U),
  kSDMMC_CommandClassApplicationSpecific = (1U << 8U),
  kSDMMC_CommandClassInputOutputMode = (1U << 9U),
  kSDMMC_CommandClassSwitch = (1U << 10U)
}
 SD card command class. More...
 
enum  _sd_ocr_flag {
  kSD_OcrPowerUpBusyFlag = 31,
  kSD_OcrHostCapacitySupportFlag = 30,
  kSD_OcrCardCapacitySupportFlag = kSD_OcrHostCapacitySupportFlag,
  kSD_OcrSwitch18RequestFlag = 24,
  kSD_OcrSwitch18AcceptFlag = kSD_OcrSwitch18RequestFlag,
  kSD_OcrVdd27_28Flag = 15,
  kSD_OcrVdd28_29Flag = 16,
  kSD_OcrVdd29_30Flag = 17,
  kSD_OcrVdd30_31Flag = 18,
  kSD_OcrVdd31_32Flag = 19,
  kSD_OcrVdd32_33Flag = 20,
  kSD_OcrVdd33_34Flag = 21,
  kSD_OcrVdd34_35Flag = 22,
  kSD_OcrVdd35_36Flag = 23
}
 OCR register in SD card. More...
 
enum  _sd_specification_version {
  kSD_SpecificationVersion1_0 = (1U << 0U),
  kSD_SpecificationVersion1_1 = (1U << 1U),
  kSD_SpecificationVersion2_0 = (1U << 2U),
  kSD_SpecificationVersion3_0 = (1U << 3U)
}
 SD card specification version number. More...
 
enum  sd_switch_mode_t {
  kSD_SwitchCheck = 0U,
  kSD_SwitchSet = 1U
}
 SD card switch mode. More...
 
enum  _sd_csd_flag {
  kSD_CsdReadBlockPartialFlag = (1U << 0U),
  kSD_CsdWriteBlockMisalignFlag = (1U << 1U),
  kSD_CsdReadBlockMisalignFlag = (1U << 2U),
  kSD_CsdDsrImplementedFlag = (1U << 3U),
  kSD_CsdEraseBlockEnabledFlag = (1U << 4U),
  kSD_CsdWriteProtectGroupEnabledFlag = (1U << 5U),
  kSD_CsdWriteBlockPartialFlag = (1U << 6U),
  kSD_CsdFileFormatGroupFlag = (1U << 7U),
  kSD_CsdCopyFlag = (1U << 8U),
  kSD_CsdPermanentWriteProtectFlag = (1U << 9U),
  kSD_CsdTemporaryWriteProtectFlag = (1U << 10U)
}
 SD card CSD register flags. More...
 
enum  _sd_scr_flag {
  kSD_ScrDataStatusAfterErase = (1U << 0U),
  kSD_ScrSdSpecification3 = (1U << 1U)
}
 SD card SCR register flags. More...
 
enum  _sd_timing_function {
  kSD_FunctionSDR12Deafult = 0U,
  kSD_FunctionSDR25HighSpeed = 1U,
  kSD_FunctionSDR50 = 2U,
  kSD_FunctionSDR104 = 3U,
  kSD_FunctionDDR50 = 4U
}
 SD timing function number. More...
 
enum  _sd_group_num {
  kSD_GroupTimingMode = 0U,
  kSD_GroupCommandSystem = 1U,
  kSD_GroupDriverStrength = 2U,
  kSD_GroupCurrentLimit = 3U
}
 SD group number. More...
 
enum  sd_timing_mode_t {
  kSD_TimingSDR12DefaultMode = 0U,
  kSD_TimingSDR25HighSpeedMode = 1U,
  kSD_TimingSDR50Mode = 2U,
  kSD_TimingSDR104Mode = 3U,
  kSD_TimingDDR50Mode = 4U
}
 SD card timing mode flags. More...
 
enum  sd_driver_strength_t {
  kSD_DriverStrengthTypeB = 0U,
  kSD_DriverStrengthTypeA = 1U,
  kSD_DriverStrengthTypeC = 2U,
  kSD_DriverStrengthTypeD = 3U
}
 SD card driver strength. More...
 
enum  sd_max_current_t {
  kSD_CurrentLimit200MA = 0U,
  kSD_CurrentLimit400MA = 1U,
  kSD_CurrentLimit600MA = 2U,
  kSD_CurrentLimit800MA = 3U
}
 SD card current limit. More...
 
enum  sdmmc_command_t {
  kSDMMC_GoIdleState = 0U,
  kSDMMC_AllSendCid = 2U,
  kSDMMC_SetDsr = 4U,
  kSDMMC_SelectCard = 7U,
  kSDMMC_SendCsd = 9U,
  kSDMMC_SendCid = 10U,
  kSDMMC_StopTransmission = 12U,
  kSDMMC_SendStatus = 13U,
  kSDMMC_GoInactiveState = 15U,
  kSDMMC_SetBlockLength = 16U,
  kSDMMC_ReadSingleBlock = 17U,
  kSDMMC_ReadMultipleBlock = 18U,
  kSDMMC_SetBlockCount = 23U,
  kSDMMC_WriteSingleBlock = 24U,
  kSDMMC_WriteMultipleBlock = 25U,
  kSDMMC_ProgramCsd = 27U,
  kSDMMC_SetWriteProtect = 28U,
  kSDMMC_ClearWriteProtect = 29U,
  kSDMMC_SendWriteProtect = 30U,
  kSDMMC_Erase = 38U,
  kSDMMC_LockUnlock = 42U,
  kSDMMC_ApplicationCommand = 55U,
  kSDMMC_GeneralCommand = 56U,
  kSDMMC_ReadOcr = 58U
}
 SD/MMC card common commands. More...
 
enum  _sdio_cccr_reg {
  kSDIO_RegCCCRSdioVer = 0x00U,
  kSDIO_RegSDVersion = 0x01U,
  kSDIO_RegIOEnable = 0x02U,
  kSDIO_RegIOReady = 0x03U,
  kSDIO_RegIOIntEnable = 0x04U,
  kSDIO_RegIOIntPending = 0x05U,
  kSDIO_RegIOAbort = 0x06U,
  kSDIO_RegBusInterface = 0x07U,
  kSDIO_RegCardCapability = 0x08U,
  kSDIO_RegCommonCISPointer = 0x09U,
  kSDIO_RegBusSuspend = 0x0C,
  kSDIO_RegFunctionSelect = 0x0DU,
  kSDIO_RegExecutionFlag = 0x0EU,
  kSDIO_RegReadyFlag = 0x0FU,
  kSDIO_RegFN0BlockSizeLow = 0x10U,
  kSDIO_RegFN0BlockSizeHigh = 0x11U,
  kSDIO_RegPowerControl = 0x12U,
  kSDIO_RegBusSpeed = 0x13U,
  kSDIO_RegUHSITimingSupport = 0x14U,
  kSDIO_RegDriverStrength = 0x15U,
  kSDIO_RegInterruptExtension = 0x16U
}
 sdio card cccr register addr More...
 
enum  sdio_command_t {
  kSDIO_SendRelativeAddress = 3U,
  kSDIO_SendOperationCondition = 5U,
  kSDIO_SendInterfaceCondition = 8U,
  kSDIO_RWIODirect = 52U,
  kSDIO_RWIOExtended = 53U
}
 sdio card individual commands More...
 
enum  sdio_func_num_t {
  kSDIO_FunctionNum0,
  kSDIO_FunctionNum1,
  kSDIO_FunctionNum2,
  kSDIO_FunctionNum3,
  kSDIO_FunctionNum4,
  kSDIO_FunctionNum5,
  kSDIO_FunctionNum6,
  kSDIO_FunctionNum7,
  kSDIO_FunctionMemory
}
 sdio card individual commands More...
 
enum  _sdio_status_flag {
  kSDIO_StatusCmdCRCError = 0x8000U,
  kSDIO_StatusIllegalCmd = 0x4000U,
  kSDIO_StatusR6Error = 0x2000U,
  kSDIO_StatusError = 0x0800U,
  kSDIO_StatusFunctionNumError = 0x0200U,
  kSDIO_StatusOutofRange = 0x0100U
}
 sdio command response flag More...
 
enum  _sdio_ocr_flag {
  kSDIO_OcrPowerUpBusyFlag = 31,
  kSDIO_OcrIONumber = 28,
  kSDIO_OcrMemPresent = 27,
  kSDIO_OcrVdd20_21Flag = 8,
  kSDIO_OcrVdd21_22Flag = 9,
  kSDIO_OcrVdd22_23Flag = 10,
  kSDIO_OcrVdd23_24Flag = 11,
  kSDIO_OcrVdd24_25Flag = 12,
  kSDIO_OcrVdd25_26Flag = 13,
  kSDIO_OcrVdd26_27Flag = 14,
  kSDIO_OcrVdd27_28Flag = 15,
  kSDIO_OcrVdd28_29Flag = 16,
  kSDIO_OcrVdd29_30Flag = 17,
  kSDIO_OcrVdd30_31Flag = 18,
  kSDIO_OcrVdd31_32Flag = 19,
  kSDIO_OcrVdd32_33Flag = 20,
  kSDIO_OcrVdd33_34Flag = 21,
  kSDIO_OcrVdd34_35Flag = 22,
  kSDIO_OcrVdd35_36Flag = 23
}
 sdio operation condition flag More...
 
enum  _sdio_capability_flag {
  kSDIO_CCCRSupportDirectCmdDuringDataTrans = (1U << 0U),
  kSDIO_CCCRSupportMultiBlock = (1U << 1U),
  kSDIO_CCCRSupportReadWait = (1U << 2U),
  kSDIO_CCCRSupportSuspendResume = (1U << 3U),
  kSDIO_CCCRSupportIntDuring4BitDataTrans = (1U << 4U),
  kSDIO_CCCRSupportLowSpeed1Bit = (1U << 6U),
  kSDIO_CCCRSupportLowSpeed4Bit = (1U << 7U),
  kSDIO_CCCRSupportMasterPowerControl = (1U << 8U),
  kSDIO_CCCRSupportHighSpeed = (1U << 9U),
  kSDIO_CCCRSupportContinuousSPIInt = (1U << 10U)
}
 sdio capability flag More...
 
enum  _sdio_fbr_flag {
  kSDIO_FBRSupportCSA = (1U << 0U),
  kSDIO_FBRSupportPowerSelection = (1U << 1U)
}
 sdio fbr flag More...
 
enum  sdio_bus_width_t {
  kSDIO_DataBus1Bit = 0x00U,
  kSDIO_DataBus4Bit = 0X02U,
  kSDIO_DataBus8Bit = 0X03U
}
 sdio bus width More...
 
enum  mmc_command_t {
  kMMC_SendOperationCondition = 1U,
  kMMC_SetRelativeAddress = 3U,
  kMMC_SleepAwake = 5U,
  kMMC_Switch = 6U,
  kMMC_SendExtendedCsd = 8U,
  kMMC_ReadDataUntilStop = 11U,
  kMMC_BusTestRead = 14U,
  kMMC_SendingBusTest = 19U,
  kMMC_WriteDataUntilStop = 20U,
  kMMC_SendTuningBlock = 21U,
  kMMC_ProgramCid = 26U,
  kMMC_EraseGroupStart = 35U,
  kMMC_EraseGroupEnd = 36U,
  kMMC_FastInputOutput = 39U,
  kMMC_GoInterruptState = 40U
}
 MMC card individual commands. More...
 
enum  mmc_classified_voltage_t {
  kMMC_ClassifiedVoltageHigh = 0U,
  kMMC_ClassifiedVoltageDual = 1U
}
 MMC card classified as voltage range. More...
 
enum  mmc_classified_density_t { kMMC_ClassifiedDensityWithin2GB = 0U }
 MMC card classified as density level. More...
 
enum  mmc_access_mode_t {
  kMMC_AccessModeByte = 0U,
  kMMC_AccessModeSector = 2U
}
 MMC card access mode(Access mode in OCR). More...
 
enum  mmc_voltage_window_t {
  kMMC_VoltageWindowNone = 0U,
  kMMC_VoltageWindow120 = 0x01U,
  kMMC_VoltageWindow170to195 = 0x02U,
  kMMC_VoltageWindows270to360 = 0x1FFU
}
 MMC card voltage window(VDD voltage window in OCR). More...
 
enum  mmc_csd_structure_version_t {
  kMMC_CsdStrucureVersion10 = 0U,
  kMMC_CsdStrucureVersion11 = 1U,
  kMMC_CsdStrucureVersion12 = 2U,
  kMMC_CsdStrucureVersionInExtcsd = 3U
}
 CSD structure version(CSD_STRUCTURE in CSD). More...
 
enum  mmc_specification_version_t {
  kMMC_SpecificationVersion0 = 0U,
  kMMC_SpecificationVersion1 = 1U,
  kMMC_SpecificationVersion2 = 2U,
  kMMC_SpecificationVersion3 = 3U,
  kMMC_SpecificationVersion4 = 4U
}
 MMC card specification version(SPEC_VERS in CSD). More...
 
enum  _mmc_extended_csd_revision {
  kMMC_ExtendedCsdRevision10 = 0U,
  kMMC_ExtendedCsdRevision11 = 1U,
  kMMC_ExtendedCsdRevision12 = 2U,
  kMMC_ExtendedCsdRevision13 = 3U,
  kMMC_ExtendedCsdRevision14 = 4U,
  kMMC_ExtendedCsdRevision15 = 5U,
  kMMC_ExtendedCsdRevision16 = 6U,
  kMMC_ExtendedCsdRevision17 = 7U
}
 MMC card Extended CSD fix version(EXT_CSD_REV in Extended CSD) More...
 
enum  mmc_command_set_t {
  kMMC_CommandSetStandard = 0U,
  kMMC_CommandSet1 = 1U,
  kMMC_CommandSet2 = 2U,
  kMMC_CommandSet3 = 3U,
  kMMC_CommandSet4 = 4U
}
 MMC card command set(COMMAND_SET in Extended CSD) More...
 
enum  _mmc_support_boot_mode {
  kMMC_SupportAlternateBoot = 1U,
  kMMC_SupportDDRBoot = 2U,
  kMMC_SupportHighSpeedBoot = 4U
}
 boot support(BOOT_INFO in Extended CSD) More...
 
enum  mmc_high_speed_timing_t {
  kMMC_HighSpeedTimingNone = 0U,
  kMMC_HighSpeedTiming = 1U,
  kMMC_HighSpeed200Timing = 2U,
  kMMC_HighSpeed400Timing = 3U,
  kMMC_EnhanceHighSpeed400Timing = 4U
}
 MMC card high-speed timing(HS_TIMING in Extended CSD) More...
 
enum  mmc_data_bus_width_t {
  kMMC_DataBusWidth1bit = 0U,
  kMMC_DataBusWidth4bit = 1U,
  kMMC_DataBusWidth8bit = 2U,
  kMMC_DataBusWidth4bitDDR = 5U,
  kMMC_DataBusWidth8bitDDR = 6U,
  kMMC_DataBusWidth8bitDDRSTROBE = 0x86U
}
 MMC card data bus width(BUS_WIDTH in Extended CSD) More...
 
enum  mmc_boot_partition_enable_t {
  kMMC_BootPartitionEnableNot = 0U,
  kMMC_BootPartitionEnablePartition1 = 1U,
  kMMC_BootPartitionEnablePartition2 = 2U,
  kMMC_BootPartitionEnableUserAera = 7U
}
 MMC card boot partition enabled(BOOT_PARTITION_ENABLE in Extended CSD) More...
 
enum  mmc_boot_timing_mode_t {
  kMMC_BootModeSDRWithDefaultTiming = 0U,
  kMMC_BootModeSDRWithHighSpeedTiming = 1U,
  kMMC_BootModeDDRTiming = 2U
}
 boot mode configuration Note: HS200 & HS400 is not support during BOOT operation. More...
 
enum  mmc_boot_partition_wp_t {
  kMMC_BootPartitionWPDisable = 0x50U,
  kMMC_BootPartitionPwrWPToBothPartition,
  kMMC_BootPartitionPermWPToBothPartition = 0x04U,
  kMMC_BootPartitionPwrWPToPartition1 = (1U << 7U) | 1U,
  kMMC_BootPartitionPwrWPToPartition2 = (1U << 7U) | 3U,
  kMMC_BootPartitionPermWPToPartition1,
  kMMC_BootPartitionPermWPToPartition2,
  kMMC_BootPartitionPermWPToPartition1PwrWPToPartition2,
  kMMC_BootPartitionPermWPToPartition2PwrWPToPartition1
}
 MMC card boot partition write protect configurations All the bits in BOOT_WP register, except the two R/W bits B_PERM_WP_DIS and B_PERM_WP_EN, shall only be written once per power cycle.The protection mdde intended for both boot areas will be set with a single write. More...
 
enum  _mmc_boot_partition_wp_status {
  kMMC_BootPartitionNotProtected = 0U,
  kMMC_BootPartitionPwrProtected = 1U,
  kMMC_BootPartitionPermProtected = 2U
}
 MMC card boot partition write protect status. More...
 
enum  mmc_access_partition_t {
  kMMC_AccessPartitionUserAera = 0U,
  kMMC_AccessPartitionBoot1 = 1U,
  kMMC_AccessPartitionBoot2 = 2U,
  kMMC_AccessRPMB = 3U,
  kMMC_AccessGeneralPurposePartition1 = 4U,
  kMMC_AccessGeneralPurposePartition2 = 5U,
  kMMC_AccessGeneralPurposePartition3 = 6U,
  kMMC_AccessGeneralPurposePartition4 = 7U
}
 MMC card partition to be accessed(BOOT_PARTITION_ACCESS in Extended CSD) More...
 
enum  _mmc_csd_flag {
  kMMC_CsdReadBlockPartialFlag = (1U << 0U),
  kMMC_CsdWriteBlockMisalignFlag = (1U << 1U),
  kMMC_CsdReadBlockMisalignFlag = (1U << 2U),
  kMMC_CsdDsrImplementedFlag = (1U << 3U),
  kMMC_CsdWriteProtectGroupEnabledFlag = (1U << 4U),
  kMMC_CsdWriteBlockPartialFlag = (1U << 5U),
  kMMC_ContentProtectApplicationFlag = (1U << 6U),
  kMMC_CsdFileFormatGroupFlag = (1U << 7U),
  kMMC_CsdCopyFlag = (1U << 8U),
  kMMC_CsdPermanentWriteProtectFlag = (1U << 9U),
  kMMC_CsdTemporaryWriteProtectFlag = (1U << 10U)
}
 MMC card CSD register flags. More...
 
enum  mmc_extended_csd_access_mode_t {
  kMMC_ExtendedCsdAccessModeCommandSet = 0U,
  kMMC_ExtendedCsdAccessModeSetBits = 1U,
  kMMC_ExtendedCsdAccessModeClearBits = 2U,
  kMMC_ExtendedCsdAccessModeWriteBits = 3U
}
 Extended CSD register access mode(Access mode in CMD6). More...
 
enum  mmc_extended_csd_index_t {
  kMMC_ExtendedCsdIndexBootPartitionWP = 173U,
  kMMC_ExtendedCsdIndexEraseGroupDefinition = 175U,
  kMMC_ExtendedCsdIndexBootBusConditions = 177U,
  kMMC_ExtendedCsdIndexBootConfigWP = 178U,
  kMMC_ExtendedCsdIndexPartitionConfig = 179U,
  kMMC_ExtendedCsdIndexBusWidth = 183U,
  kMMC_ExtendedCsdIndexHighSpeedTiming = 185U,
  kMMC_ExtendedCsdIndexPowerClass = 187U,
  kMMC_ExtendedCsdIndexCommandSet = 191U
}
 EXT CSD byte index. More...
 
enum  _mmc_driver_strength {
  kMMC_DriverStrength0 = 0U,
  kMMC_DriverStrength1 = 1U,
  kMMC_DriverStrength2 = 2U,
  kMMC_DriverStrength3 = 3U,
  kMMC_DriverStrength4 = 4U
}
 mmc driver strength More...
 
enum  mmc_extended_csd_flags_t {
  kMMC_ExtCsdExtPartitionSupport = (1 << 0U),
  kMMC_ExtCsdEnhancePartitionSupport = (1 << 1U),
  kMMC_ExtCsdPartitioningSupport = (1 << 2U),
  kMMC_ExtCsdPrgCIDCSDInDDRModeSupport = (1 << 3U),
  kMMC_ExtCsdBKOpsSupport = (1 << 4U),
  kMMC_ExtCsdDataTagSupport = (1 << 5U),
  kMMC_ExtCsdModeOperationCodeSupport = (1 << 6U)
}
 mmc extended csd flags More...
 
enum  mmc_boot_mode_t {
  kMMC_BootModeNormal = 0U,
  kMMC_BootModeAlternative = 1U
}
 MMC card boot mode. More...
 

common function

tuning pattern

status_t SDMMC_SelectCard (sdmmchost_t *host, uint32_t relativeAddress, bool isSelected)
 Selects the card to put it into transfer state. More...
 
status_t SDMMC_SendApplicationCommand (sdmmchost_t *host, uint32_t relativeAddress)
 Sends an application command. More...
 
status_t SDMMC_SetBlockCount (sdmmchost_t *host, uint32_t blockCount)
 Sets the block count. More...
 
status_t SDMMC_GoIdle (sdmmchost_t *host)
 Sets the card to be idle state. More...
 
status_t SDMMC_SetBlockSize (sdmmchost_t *host, uint32_t blockSize)
 Sets data block size. More...
 
status_t SDMMC_SetCardInactive (sdmmchost_t *host)
 Sets card to inactive status. More...
 

Data Structure Documentation

struct sd_detect_card_t

Data Fields

sd_detect_card_type_t type
 card detect type
 
uint32_t cdDebounce_ms
 card detect debounce delay ms
 
sd_cd_t callback
 card inserted callback which is meaningful for interrupt case
 
sd_cd_status_t cardDetected
 used to check sd cd status when card detect through GPIO
 
void * userData
 user data
 
struct sd_io_voltage_t

Data Fields

sd_io_voltage_ctrl_type_t type
 io voltage switch type
 
sd_io_voltage_func_t func
 io voltage switch function
 
struct sd_usr_param_t

Data Fields

sd_pwr_t pwr
 power control configuration pointer
 
sd_io_strength_t ioStrength
 swicth sd io strength
 
sd_io_voltage_tioVoltage
 switch io voltage
 
sd_detect_card_tcd
 card detect
 
uint32_t maxFreq
 board support maximum frequency
 
uint32_t capability
 board capability flag
 
struct sdio_card_int_t

Data Fields

void * userData
 user data
 
sdio_int_t cardInterrupt
 card int call back
 
struct sdio_usr_param_t

Data Fields

sd_pwr_t pwr
 power control configuration pointer
 
sd_io_strength_t ioStrength
 swicth sd io strength
 
sd_io_voltage_tioVoltage
 switch io voltage
 
sd_detect_card_tcd
 card detect
 
sdio_card_int_tsdioInt
 card int
 
uint32_t maxFreq
 board support maximum frequency
 
uint32_t capability
 board capability flag
 
struct sdio_fbr_t

Data Fields

uint8_t flags
 current io flags
 
uint8_t ioStdFunctionCode
 current io standard function code
 
uint8_t ioExtFunctionCode
 current io extended function code
 
uint32_t ioPointerToCIS
 current io pointer to CIS
 
uint32_t ioPointerToCSA
 current io pointer to CSA
 
uint16_t ioBlockSize
 current io block size
 
struct sdio_common_cis_t

Data Fields

uint16_t mID
 manufacturer code
 
uint16_t mInfo
 manufacturer information
 
uint8_t funcID
 function ID
 
uint16_t fn0MaxBlkSize
 function 0 max block size
 
uint8_t maxTransSpeed
 max data transfer speed for all function
 
struct sdio_func_cis_t

Data Fields

uint8_t funcID
 function ID
 
uint8_t funcInfo
 function info
 
uint8_t ioVersion
 level of application specification this io support
 
uint32_t cardPSN
 product serial number
 
uint32_t ioCSASize
 avaliable CSA size for io
 
uint8_t ioCSAProperty
 CSA property.
 
uint16_t ioMaxBlockSize
 io max transfer data size
 
uint32_t ioOCR
 io ioeration condition
 
uint8_t ioOPMinPwr
 min current in operation mode
 
uint8_t ioOPAvgPwr
 average current in operation mode
 
uint8_t ioOPMaxPwr
 max current in operation mode
 
uint8_t ioSBMinPwr
 min current in standby mode
 
uint8_t ioSBAvgPwr
 average current in standby mode
 
uint8_t ioSBMaxPwr
 max current in standby mode
 
uint16_t ioMinBandWidth
 io min transfer bandwidth
 
uint16_t ioOptimumBandWidth
 io optimum transfer bandwidth
 
uint16_t ioReadyTimeout
 timeout value from enalbe to ready
 
uint16_t ioHighCurrentAvgCurrent
 
 the average peak current (mA)

when IO operating in high current mode

 
uint16_t ioHighCurrentMaxCurrent
 
 the max peak current (mA)

when IO operating in high current mode

 
uint16_t ioLowCurrentAvgCurrent
 
 the average peak current (mA)

when IO operating in lower current mode

 
uint16_t ioLowCurrentMaxCurrent
 
 the max peak current (mA)

when IO operating in lower current mode

 
struct sd_status_t

Data Fields

uint8_t busWidth
 current buswidth
 
uint8_t secureMode
 secured mode
 
uint16_t cardType
 sdcard type
 
uint32_t protectedSize
 size of protected area
 
uint8_t speedClass
 speed class of card
 
uint8_t performanceMove
 Performance of move indicated by 1[MB/S]step.
 
uint8_t auSize
 size of AU
 
uint16_t eraseSize
 number of AUs to be erased at a time
 
uint8_t eraseTimeout
 timeout value for erasing areas specified by UNIT OF ERASE AU
 
uint8_t eraseOffset
 fixed offset value added to erase time
 
uint8_t uhsSpeedGrade
 speed grade for UHS mode
 
uint8_t uhsAuSize
 size of AU for UHS mode
 
struct sd_cid_t

Data Fields

uint8_t manufacturerID
 Manufacturer ID [127:120].
 
uint16_t applicationID
 OEM/Application ID [119:104].
 
uint8_t productName [SD_PRODUCT_NAME_BYTES]
 Product name [103:64].
 
uint8_t productVersion
 Product revision [63:56].
 
uint32_t productSerialNumber
 Product serial number [55:24].
 
uint16_t manufacturerData
 Manufacturing date [19:8].
 
struct sd_csd_t

Data Fields

uint8_t csdStructure
 CSD structure [127:126].
 
uint8_t dataReadAccessTime1
 Data read access-time-1 [119:112].
 
uint8_t dataReadAccessTime2
 Data read access-time-2 in clock cycles (NSAC*100) [111:104].
 
uint8_t transferSpeed
 Maximum data transfer rate [103:96].
 
uint16_t cardCommandClass
 Card command classes [95:84].
 
uint8_t readBlockLength
 Maximum read data block length [83:80].
 
uint16_t flags
 Flags in _sd_csd_flag.
 
uint32_t deviceSize
 Device size [73:62].
 
uint8_t readCurrentVddMin
 Maximum read current at VDD min [61:59].
 
uint8_t readCurrentVddMax
 Maximum read current at VDD max [58:56].
 
uint8_t writeCurrentVddMin
 Maximum write current at VDD min [55:53].
 
uint8_t writeCurrentVddMax
 Maximum write current at VDD max [52:50].
 
uint8_t deviceSizeMultiplier
 Device size multiplier [49:47].
 
uint8_t eraseSectorSize
 Erase sector size [45:39].
 
uint8_t writeProtectGroupSize
 Write protect group size [38:32].
 
uint8_t writeSpeedFactor
 Write speed factor [28:26].
 
uint8_t writeBlockLength
 Maximum write data block length [25:22].
 
uint8_t fileFormat
 File format [11:10].
 
struct sd_scr_t

Data Fields

uint8_t scrStructure
 SCR Structure [63:60].
 
uint8_t sdSpecification
 SD memory card specification version [59:56].
 
uint16_t flags
 SCR flags in _sd_scr_flag.
 
uint8_t sdSecurity
 Security specification supported [54:52].
 
uint8_t sdBusWidths
 Data bus widths supported [51:48].
 
uint8_t extendedSecurity
 Extended security support [46:43].
 
uint8_t commandSupport
 Command support bits [33:32] 33-support CMD23, 32-support cmd20.
 
uint32_t reservedForManufacturer
 reserved for manufacturer usage [31:0]
 
struct mmc_cid_t

Data Fields

uint8_t manufacturerID
 Manufacturer ID.
 
uint16_t applicationID
 OEM/Application ID.
 
uint8_t productName [MMC_PRODUCT_NAME_BYTES]
 Product name.
 
uint8_t productVersion
 Product revision.
 
uint32_t productSerialNumber
 Product serial number.
 
uint8_t manufacturerData
 Manufacturing date.
 
struct mmc_csd_t

Data Fields

uint8_t csdStructureVersion
 CSD structure [127:126].
 
uint8_t systemSpecificationVersion
 System specification version [125:122].
 
uint8_t dataReadAccessTime1
 Data read access-time 1 [119:112].
 
uint8_t dataReadAccessTime2
 Data read access-time 2 in CLOCK cycles (NSAC*100) [111:104].
 
uint8_t transferSpeed
 Max. More...
 
uint16_t cardCommandClass
 card command classes [95:84]
 
uint8_t readBlockLength
 Max. More...
 
uint16_t flags
 Contain flags in _mmc_csd_flag.
 
uint16_t deviceSize
 Device size [73:62].
 
uint8_t readCurrentVddMin
 Max. More...
 
uint8_t readCurrentVddMax
 Max. More...
 
uint8_t writeCurrentVddMin
 Max. More...
 
uint8_t writeCurrentVddMax
 Max. More...
 
uint8_t deviceSizeMultiplier
 Device size multiplier [49:47].
 
uint8_t eraseGroupSize
 Erase group size [46:42].
 
uint8_t eraseGroupSizeMultiplier
 Erase group size multiplier [41:37].
 
uint8_t writeProtectGroupSize
 Write protect group size [36:32].
 
uint8_t defaultEcc
 Manufacturer default ECC [30:29].
 
uint8_t writeSpeedFactor
 Write speed factor [28:26].
 
uint8_t maxWriteBlockLength
 Max. More...
 
uint8_t fileFormat
 File format [11:10].
 
uint8_t eccCode
 ECC code [9:8].
 

Field Documentation

uint8_t mmc_csd_t::transferSpeed

bus clock frequency [103:96]

uint8_t mmc_csd_t::readBlockLength

read data block length [83:80]

uint8_t mmc_csd_t::readCurrentVddMin

read current @ VDD min [61:59]

uint8_t mmc_csd_t::readCurrentVddMax

read current @ VDD max [58:56]

uint8_t mmc_csd_t::writeCurrentVddMin

write current @ VDD min [55:53]

uint8_t mmc_csd_t::writeCurrentVddMax

write current @ VDD max [52:50]

uint8_t mmc_csd_t::maxWriteBlockLength

write data block length [25:22]

struct mmc_extended_csd_t

Data Fields

uint8_t partitionAttribute
 < secure removal type[16] More...
 
uint8_t userWP
 < max enhance area size [159-157] More...
 
uint8_t bootPartitionWP
 boot write protect register[173]
 
uint8_t bootWPStatus
 boot write protect status register[174]
 
uint8_t highDensityEraseGroupDefinition
 High-density erase group definition [175].
 
uint8_t bootDataBusConditions
 Boot bus conditions [177].
 
uint8_t bootConfigProtect
 Boot config protection [178].
 
uint8_t partitionConfig
 Boot configuration [179].
 
uint8_t eraseMemoryContent
 Erased memory content [181].
 
uint8_t dataBusWidth
 Data bus width mode [183].
 
uint8_t highSpeedTiming
 High-speed interface timing [185].
 
uint8_t powerClass
 Power class [187].
 
uint8_t commandSetRevision
 Command set revision [189].
 
uint8_t commandSet
 Command set [191].
 
uint8_t extendecCsdVersion
 Extended CSD revision [192].
 
uint8_t csdStructureVersion
 CSD structure version [194].
 
uint8_t cardType
 Card Type [196].
 
uint8_t ioDriverStrength
 IO driver strength [197].
 
uint8_t powerClass52MHz195V
 < out of interrupt busy timing [198] More...
 
uint8_t powerClass26MHz195V
 Power Class for 26MHz @ 1.95V [201].
 
uint8_t powerClass52MHz360V
 Power Class for 52MHz @ 3.6V [202].
 
uint8_t powerClass26MHz360V
 Power Class for 26MHz @ 3.6V [203].
 
uint8_t minimumReadPerformance4Bit26MHz
 Minimum Read Performance for 4bit at 26MHz [205].
 
uint8_t minimumWritePerformance4Bit26MHz
 Minimum Write Performance for 4bit at 26MHz [206].
 
uint8_t minimumReadPerformance8Bit26MHz4Bit52MHz
 Minimum read Performance for 8bit at 26MHz/4bit @52MHz [207].
 
uint8_t minimumWritePerformance8Bit26MHz4Bit52MHz
 Minimum Write Performance for 8bit at 26MHz/4bit @52MHz [208].
 
uint8_t minimumReadPerformance8Bit52MHz
 Minimum Read Performance for 8bit at 52MHz [209].
 
uint8_t minimumWritePerformance8Bit52MHz
 Minimum Write Performance for 8bit at 52MHz [210].
 
uint32_t sectorCount
 Sector Count [215:212].
 
uint8_t sleepAwakeTimeout
 < sleep notification timeout [216] More...
 
uint8_t sleepCurrentVCCQ
 < Production state awareness timeout [218] More...
 
uint8_t sleepCurrentVCC
 Sleep current (VCC) [220].
 
uint8_t highCapacityWriteProtectGroupSize
 High-capacity write protect group size [221].
 
uint8_t reliableWriteSectorCount
 Reliable write sector count [222].
 
uint8_t highCapacityEraseTimeout
 High-capacity erase timeout [223].
 
uint8_t highCapacityEraseUnitSize
 High-capacity erase unit size [224].
 
uint8_t accessSize
 Access size [225].
 
uint8_t minReadPerformance8bitAt52MHZDDR
 < secure trim multiplier[229] More...
 
uint8_t minWritePerformance8bitAt52MHZDDR
 Minimum write performance for 8bit at DDR 52MHZ[235].
 
uint8_t powerClass200MHZVCCQ130VVCC360V
 power class for 200MHZ, at VCCQ= 1.3V,VCC=3.6V[236]
 
uint8_t powerClass200MHZVCCQ195VVCC360V
 power class for 200MHZ, at VCCQ= 1.95V,VCC=3.6V[237]
 
uint8_t powerClass52MHZDDR195V
 power class for 52MHZ,DDR at Vcc 1.95V[238]
 
uint8_t powerClass52MHZDDR360V
 power class for 52MHZ,DDR at Vcc 3.6V[239]
 
uint32_t cacheSize
 < 1st initialization time after partitioning[241] More...
 
uint8_t powerClass200MHZDDR360V
 power class for 200MHZ, DDR at VCC=2.6V[253]
 
uint8_t extPartitionSupport
 < fw VERSION [261-254] More...
 
uint8_t supportedCommandSet
 < large unit size[495] More...
 

Field Documentation

uint8_t mmc_extended_csd_t::partitionAttribute

< product state awareness enablement[17]

< max preload data size[21-18]

< pre-load data size[25-22]

< FFU status [26]

< mode operation code[29]

< mode config [30]

< control to turn on/off cache[33]

< power off notification[34]

< packed cmd fail index [35]

< packed cmd status[36]

< context configuration[51-37]

< extended partitions attribut[53-52]

< exception events status[55-54]

< exception events control[57-56]

< number of group to be released[58]

< class 6 command control[59]

< 1st initiallization after disabling sector size emu[60]

< sector size[61]

< sector size emulation[62]

< native sector size[63]

< period wakeup [131]

< package case temperature is controlled[132]

< production state awareness[133]

< enhanced user data start addr [139-136]

< enhanced user data area size[142-140]

< general purpose partition size[154-143] partition attribute [156]

uint8_t mmc_extended_csd_t::userWP

< HPI management [161]

< write reliability parameter register[166]

< write reliability setting register[167]

< RPMB size multi [168]

< FW configuration[169] user write protect register[171]

uint8_t mmc_extended_csd_t::powerClass52MHz195V

< partition switch timing [199] Power Class for 52MHz @ 1.95V [200]

uint8_t mmc_extended_csd_t::sleepAwakeTimeout

Sleep/awake timeout [217]

uint8_t mmc_extended_csd_t::sleepCurrentVCCQ

Sleep current (VCCQ) [219]

uint8_t mmc_extended_csd_t::minReadPerformance8bitAt52MHZDDR

< secure erase multiplier[230]

< secure feature support[231]

< trim multiplier[232] Minimum read performance for 8bit at DDR 52MHZ[234]

uint32_t mmc_extended_csd_t::cacheSize

< correct prg sectors number[245-242]

< background operations status[246]

< power off notification timeout[247]

< generic CMD6 timeout[248] cache size[252-249]

uint8_t mmc_extended_csd_t::extPartitionSupport

< device version[263-262]

< optimal trim size[264]

< optimal write size[265]

< optimal read size[266]

< pre EOL information[267]

< device life time estimation typeA[268]

< device life time estimation typeB[269]

< number of FW sectors correctly programmed[305-302]

< FFU argument[490-487]

< operation code timeout[491]

< support mode [493] extended partition attribute support[494]

uint8_t mmc_extended_csd_t::supportedCommandSet

< context management capability[496]

< tag resource size[497]

< tag unit size[498]

< max packed write cmd[500]

< max packed read cmd[501]

< HPI feature[503] Supported Command Sets [504]

struct mmc_extended_csd_config_t

Data Fields

mmc_command_set_t commandSet
 Command set.
 
uint8_t ByteValue
 The value to set.
 
uint8_t ByteIndex
 The byte index in Extended CSD(mmc_extended_csd_index_t)
 
mmc_extended_csd_access_mode_t accessMode
 Access mode.
 
struct mmc_boot_config_t

Data Fields

mmc_boot_mode_t bootMode
 mmc boot mode
 
bool enableBootAck
 Enable boot ACK.
 
mmc_boot_partition_enable_t bootPartition
 Boot partition.
 
mmc_boot_timing_mode_t bootTimingMode
 boot mode
 
mmc_data_bus_width_t bootDataBusWidth
 Boot data bus width.
 
bool retainBootbusCondition
 If retain boot bus width and boot mode conditions.
 
bool pwrBootConfigProtection
 
 Disable the change of boot configuration register bits from at this point

until next power cycle or next H/W reset operation

 
bool premBootConfigProtection
 Disable the change of boot configuration register bits permanently.
 
mmc_boot_partition_wp_t bootPartitionWP
 boot partition write protect configurations
 

Macro Definition Documentation

#define SDMMC_LOG (   format,
  ... 
)
#define READ_MMC_TRANSFER_SPEED_FREQUENCY_UNIT (   CSD)    (((CSD.transferSpeed) & MMC_TRANSFER_SPEED_FREQUENCY_UNIT_MASK) >> MMC_TRANSFER_SPEED_FREQUENCY_UNIT_SHIFT)
#define READ_MMC_TRANSFER_SPEED_MULTIPLIER (   CSD)    (((CSD.transferSpeed) & MMC_TRANSFER_SPEED_MULTIPLIER_MASK) >> MMC_TRANSFER_SPEED_MULTIPLIER_SHIFT)
#define MMC_EXTENDED_CSD_BYTES   (512U)
#define SD_PRODUCT_NAME_BYTES   (5U)
#define MMC_PRODUCT_NAME_BYTES   (6U)
#define MMC_SWITCH_COMMAND_SET_SHIFT   (0U)
#define MMC_SWITCH_COMMAND_SET_MASK   (0x00000007U)

Enumeration Type Documentation

Enumerator
kStatus_SDMMC_NotSupportYet 

Haven't supported.

kStatus_SDMMC_TransferFailed 

Send command failed.

kStatus_SDMMC_SetCardBlockSizeFailed 

Set block size failed.

kStatus_SDMMC_HostNotSupport 

Host doesn't support.

kStatus_SDMMC_CardNotSupport 

Card doesn't support.

kStatus_SDMMC_AllSendCidFailed 

Send CID failed.

kStatus_SDMMC_SendRelativeAddressFailed 

Send relative address failed.

kStatus_SDMMC_SendCsdFailed 

Send CSD failed.

kStatus_SDMMC_SelectCardFailed 

Select card failed.

kStatus_SDMMC_SendScrFailed 

Send SCR failed.

kStatus_SDMMC_SetDataBusWidthFailed 

Set bus width failed.

kStatus_SDMMC_GoIdleFailed 

Go idle failed.

kStatus_SDMMC_HandShakeOperationConditionFailed 

Send Operation Condition failed.

kStatus_SDMMC_SendApplicationCommandFailed 

Send application command failed.

kStatus_SDMMC_SwitchFailed 

Switch command failed.

kStatus_SDMMC_StopTransmissionFailed 

Stop transmission failed.

kStatus_SDMMC_WaitWriteCompleteFailed 

Wait write complete failed.

kStatus_SDMMC_SetBlockCountFailed 

Set block count failed.

kStatus_SDMMC_SetRelativeAddressFailed 

Set relative address failed.

kStatus_SDMMC_SwitchBusTimingFailed 

Switch high speed failed.

kStatus_SDMMC_SendExtendedCsdFailed 

Send EXT_CSD failed.

kStatus_SDMMC_ConfigureBootFailed 

Configure boot failed.

kStatus_SDMMC_ConfigureExtendedCsdFailed 

Configure EXT_CSD failed.

kStatus_SDMMC_EnableHighCapacityEraseFailed 

Enable high capacity erase failed.

kStatus_SDMMC_SendTestPatternFailed 

Send test pattern failed.

kStatus_SDMMC_ReceiveTestPatternFailed 

Receive test pattern failed.

kStatus_SDMMC_SDIO_ResponseError 

sdio response error

kStatus_SDMMC_SDIO_InvalidArgument 

sdio invalid argument response error

kStatus_SDMMC_SDIO_SendOperationConditionFail 

sdio send operation condition fail

kStatus_SDMMC_InvalidVoltage 

invaild voltage

kStatus_SDMMC_SDIO_SwitchHighSpeedFail 

switch to high speed fail

kStatus_SDMMC_SDIO_ReadCISFail 

read CIS fail

kStatus_SDMMC_SDIO_InvalidCard 

invaild SDIO card

kStatus_SDMMC_TuningFail 

tuning fail

kStatus_SDMMC_SwitchVoltageFail 

switch voltage fail

kStatus_SDMMC_SwitchVoltage18VFail33VSuccess 

switch voltage fail

kStatus_SDMMC_ReTuningRequest 

retuning request

kStatus_SDMMC_SetDriverStrengthFail 

set driver strength fail

kStatus_SDMMC_SetPowerClassFail 

set power class fail

kStatus_SDMMC_HostNotReady 

host controller not ready

kStatus_SDMMC_CardDetectFailed 

card detect failed

kStatus_SDMMC_AuSizeNotSetProperly 

AU size not set properly.

Enumerator
kSDMMC_SignalLineCmd 

cmd line

kSDMMC_SignalLineData0 

data line

kSDMMC_SignalLineData1 

data line

kSDMMC_SignalLineData2 

data line

kSDMMC_SignalLineData3 

data line

kSDMMC_SignalLineData4 

data line

kSDMMC_SignalLineData5 

data line

kSDMMC_SignalLineData6 

data line

kSDMMC_SignalLineData7 

data line

Enumerator
kSDMMC_OperationVoltageNone 

indicate current voltage setting is not setting by suser

kSDMMC_OperationVoltage330V 

card operation voltage around 3.3v

kSDMMC_OperationVoltage300V 

card operation voltage around 3.0v

kSDMMC_OperationVoltage180V 

card operation voltage around 1.8v

Enumerator
kSDMMC_BusWdith1Bit 

card bus 1 width

kSDMMC_BusWdith4Bit 

card bus 4 width

kSDMMC_BusWdith8Bit 

card bus 8 width

Enumerator
kSDMMC_Support8BitWidth 

8 bit data width capability

Enumerator
kSD_DetectCardByGpioCD 

sd card detect by CD pin through GPIO

kSD_DetectCardByHostCD 

sd card detect by CD pin through host

kSD_DetectCardByHostDATA3 

sd card detect by DAT3 pin through host

Enumerator
kSD_Inserted 

card is inserted

kSD_Removed 

card is removed

Enumerator
kSD_IOVoltageCtrlNotSupport 

io voltage control not support

kSD_IOVoltageCtrlByHost 

io voltage control by host

kSD_IOVoltageCtrlByGpio 

io voltage control by gpio

Enumerator
kSDMMC_R1OutOfRangeFlag 

Out of range status bit.

kSDMMC_R1AddressErrorFlag 

Address error status bit.

kSDMMC_R1BlockLengthErrorFlag 

Block length error status bit.

kSDMMC_R1EraseSequenceErrorFlag 

Erase sequence error status bit.

kSDMMC_R1EraseParameterErrorFlag 

Erase parameter error status bit.

kSDMMC_R1WriteProtectViolationFlag 

Write protection violation status bit.

kSDMMC_R1CardIsLockedFlag 

Card locked status bit.

kSDMMC_R1LockUnlockFailedFlag 

lock/unlock error status bit

kSDMMC_R1CommandCrcErrorFlag 

CRC error status bit.

kSDMMC_R1IllegalCommandFlag 

Illegal command status bit.

kSDMMC_R1CardEccFailedFlag 

Card ecc error status bit.

kSDMMC_R1CardControllerErrorFlag 

Internal card controller error status bit.

kSDMMC_R1ErrorFlag 

A general or an unknown error status bit.

kSDMMC_R1CidCsdOverwriteFlag 

Cid/csd overwrite status bit.

kSDMMC_R1WriteProtectEraseSkipFlag 

Write protection erase skip status bit.

kSDMMC_R1CardEccDisabledFlag 

Card ecc disabled status bit.

kSDMMC_R1EraseResetFlag 

Erase reset status bit.

kSDMMC_R1ReadyForDataFlag 

Ready for data status bit.

kSDMMC_R1SwitchErrorFlag 

Switch error status bit.

kSDMMC_R1ApplicationCommandFlag 

Application command enabled status bit.

kSDMMC_R1AuthenticationSequenceErrorFlag 

error in the sequence of authentication process

Enumerator
kSDMMC_R1StateIdle 

R1: current state: idle.

kSDMMC_R1StateReady 

R1: current state: ready.

kSDMMC_R1StateIdentify 

R1: current state: identification.

kSDMMC_R1StateStandby 

R1: current state: standby.

kSDMMC_R1StateTransfer 

R1: current state: transfer.

kSDMMC_R1StateSendData 

R1: current state: sending data.

kSDMMC_R1StateReceiveData 

R1: current state: receiving data.

kSDMMC_R1StateProgram 

R1: current state: programming.

kSDMMC_R1StateDisconnect 

R1: current state: disconnect.

Enumerator
kSDSPI_R1InIdleStateFlag 

In idle state.

kSDSPI_R1EraseResetFlag 

Erase reset.

kSDSPI_R1IllegalCommandFlag 

Illegal command.

kSDSPI_R1CommandCrcErrorFlag 

Com crc error.

kSDSPI_R1EraseSequenceErrorFlag 

Erase sequence error.

kSDSPI_R1AddressErrorFlag 

Address error.

kSDSPI_R1ParameterErrorFlag 

Parameter error.

Enumerator
kSDSPI_R2CardLockedFlag 

Card is locked.

kSDSPI_R2WriteProtectEraseSkip 

Write protect erase skip.

kSDSPI_R2LockUnlockFailed 

Lock/unlock command failed.

kSDSPI_R2ErrorFlag 

Unknown error.

kSDSPI_R2CardControllerErrorFlag 

Card controller error.

kSDSPI_R2CardEccFailedFlag 

Card ecc failed.

kSDSPI_R2WriteProtectViolationFlag 

Write protect violation.

kSDSPI_R2EraseParameterErrorFlag 

Erase parameter error.

kSDSPI_R2OutOfRangeFlag 

Out of range.

kSDSPI_R2CsdOverwriteFlag 

CSD overwrite.

Enumerator
kSDSPI_DataErrorTokenError 

Data error.

kSDSPI_DataErrorTokenCardControllerError 

Card controller error.

kSDSPI_DataErrorTokenCardEccFailed 

Card ecc error.

kSDSPI_DataErrorTokenOutOfRange 

Out of range.

Enumerator
kSDSPI_DataTokenBlockRead 

Single block read, multiple block read.

kSDSPI_DataTokenSingleBlockWrite 

Single block write.

kSDSPI_DataTokenMultipleBlockWrite 

Multiple block write.

kSDSPI_DataTokenStopTransfer 

Stop transmission.

Enumerator
kSDSPI_DataResponseTokenAccepted 

Data accepted.

kSDSPI_DataResponseTokenCrcError 

Data rejected due to CRC error.

kSDSPI_DataResponseTokenWriteError 

Data rejected due to write error.

Enumerator
kSD_SendRelativeAddress 

Send Relative Address.

kSD_Switch 

Switch Function.

kSD_SendInterfaceCondition 

Send Interface Condition.

kSD_VoltageSwitch 

Voltage Switch.

kSD_SpeedClassControl 

Speed Class control.

kSD_EraseWriteBlockStart 

Write Block Start.

kSD_EraseWriteBlockEnd 

Write Block End.

kSD_SendTuningBlock 

Send Tuning Block.

Enumerator
kSDSPI_CommandCrc 

Command crc protection on/off.

Enumerator
kSD_ApplicationSetBusWdith 

Set Bus Width.

kSD_ApplicationStatus 

Send SD status.

kSD_ApplicationSendNumberWriteBlocks 

Send Number Of Written Blocks.

kSD_ApplicationSetWriteBlockEraseCount 

Set Write Block Erase Count.

kSD_ApplicationSendOperationCondition 

Send Operation Condition.

kSD_ApplicationSetClearCardDetect 

Set Connnect/Disconnect pull up on detect pin.

kSD_ApplicationSendScr 

Send Scr.

Enumerator
kSDMMC_CommandClassBasic 

Card command class 0.

kSDMMC_CommandClassBlockRead 

Card command class 2.

kSDMMC_CommandClassBlockWrite 

Card command class 4.

kSDMMC_CommandClassErase 

Card command class 5.

kSDMMC_CommandClassWriteProtect 

Card command class 6.

kSDMMC_CommandClassLockCard 

Card command class 7.

kSDMMC_CommandClassApplicationSpecific 

Card command class 8.

kSDMMC_CommandClassInputOutputMode 

Card command class 9.

kSDMMC_CommandClassSwitch 

Card command class 10.

Enumerator
kSD_OcrPowerUpBusyFlag 

Power up busy status.

kSD_OcrHostCapacitySupportFlag 

Card capacity status.

kSD_OcrCardCapacitySupportFlag 

Card capacity status.

kSD_OcrSwitch18RequestFlag 

Switch to 1.8V request.

kSD_OcrSwitch18AcceptFlag 

Switch to 1.8V accepted.

kSD_OcrVdd27_28Flag 

VDD 2.7-2.8.

kSD_OcrVdd28_29Flag 

VDD 2.8-2.9.

kSD_OcrVdd29_30Flag 

VDD 2.9-3.0.

kSD_OcrVdd30_31Flag 

VDD 2.9-3.0.

kSD_OcrVdd31_32Flag 

VDD 3.0-3.1.

kSD_OcrVdd32_33Flag 

VDD 3.1-3.2.

kSD_OcrVdd33_34Flag 

VDD 3.2-3.3.

kSD_OcrVdd34_35Flag 

VDD 3.3-3.4.

kSD_OcrVdd35_36Flag 

VDD 3.4-3.5.

Enumerator
kSD_SpecificationVersion1_0 

SD card version 1.0-1.01.

kSD_SpecificationVersion1_1 

SD card version 1.10.

kSD_SpecificationVersion2_0 

SD card version 2.00.

kSD_SpecificationVersion3_0 

SD card version 3.0.

Enumerator
kSD_SwitchCheck 

SD switch mode 0: check function.

kSD_SwitchSet 

SD switch mode 1: set function.

Enumerator
kSD_CsdReadBlockPartialFlag 

Partial blocks for read allowed [79:79].

kSD_CsdWriteBlockMisalignFlag 

Write block misalignment [78:78].

kSD_CsdReadBlockMisalignFlag 

Read block misalignment [77:77].

kSD_CsdDsrImplementedFlag 

DSR implemented [76:76].

kSD_CsdEraseBlockEnabledFlag 

Erase single block enabled [46:46].

kSD_CsdWriteProtectGroupEnabledFlag 

Write protect group enabled [31:31].

kSD_CsdWriteBlockPartialFlag 

Partial blocks for write allowed [21:21].

kSD_CsdFileFormatGroupFlag 

File format group [15:15].

kSD_CsdCopyFlag 

Copy flag [14:14].

kSD_CsdPermanentWriteProtectFlag 

Permanent write protection [13:13].

kSD_CsdTemporaryWriteProtectFlag 

Temporary write protection [12:12].

Enumerator
kSD_ScrDataStatusAfterErase 

Data status after erases [55:55].

kSD_ScrSdSpecification3 

Specification version 3.00 or higher [47:47].

Enumerator
kSD_FunctionSDR12Deafult 

SDR12 mode & default.

kSD_FunctionSDR25HighSpeed 

SDR25 & high speed.

kSD_FunctionSDR50 

SDR50 mode.

kSD_FunctionSDR104 

SDR104 mode.

kSD_FunctionDDR50 

DDR50 mode.

Enumerator
kSD_GroupTimingMode 

acess mode group

kSD_GroupCommandSystem 

command system group

kSD_GroupDriverStrength 

driver strength group

kSD_GroupCurrentLimit 

current limit group

Enumerator
kSD_TimingSDR12DefaultMode 

Identification mode & SDR12.

kSD_TimingSDR25HighSpeedMode 

High speed mode & SDR25.

kSD_TimingSDR50Mode 

SDR50 mode.

kSD_TimingSDR104Mode 

SDR104 mode.

kSD_TimingDDR50Mode 

DDR50 mode.

Enumerator
kSD_DriverStrengthTypeB 

default driver strength

kSD_DriverStrengthTypeA 

driver strength TYPE A

kSD_DriverStrengthTypeC 

driver strength TYPE C

kSD_DriverStrengthTypeD 

driver strength TYPE D

Enumerator
kSD_CurrentLimit200MA 

default current limit

kSD_CurrentLimit400MA 

current limit to 400MA

kSD_CurrentLimit600MA 

current limit to 600MA

kSD_CurrentLimit800MA 

current limit to 800MA

Enumerator
kSDMMC_GoIdleState 

Go Idle State.

kSDMMC_AllSendCid 

All Send CID.

kSDMMC_SetDsr 

Set DSR.

kSDMMC_SelectCard 

Select Card.

kSDMMC_SendCsd 

Send CSD.

kSDMMC_SendCid 

Send CID.

kSDMMC_StopTransmission 

Stop Transmission.

kSDMMC_SendStatus 

Send Status.

kSDMMC_GoInactiveState 

Go Inactive State.

kSDMMC_SetBlockLength 

Set Block Length.

kSDMMC_ReadSingleBlock 

Read Single Block.

kSDMMC_ReadMultipleBlock 

Read Multiple Block.

kSDMMC_SetBlockCount 

Set Block Count.

kSDMMC_WriteSingleBlock 

Write Single Block.

kSDMMC_WriteMultipleBlock 

Write Multiple Block.

kSDMMC_ProgramCsd 

Program CSD.

kSDMMC_SetWriteProtect 

Set Write Protect.

kSDMMC_ClearWriteProtect 

Clear Write Protect.

kSDMMC_SendWriteProtect 

Send Write Protect.

kSDMMC_Erase 

Erase.

kSDMMC_LockUnlock 

Lock Unlock.

kSDMMC_ApplicationCommand 

Send Application Command.

kSDMMC_GeneralCommand 

General Purpose Command.

kSDMMC_ReadOcr 

Read OCR.

Enumerator
kSDIO_RegCCCRSdioVer 

CCCR & SDIO version.

kSDIO_RegSDVersion 

SD version.

kSDIO_RegIOEnable 

io enable register

kSDIO_RegIOReady 

io ready register

kSDIO_RegIOIntEnable 

io interrupt enable register

kSDIO_RegIOIntPending 

io interrupt pending register

kSDIO_RegIOAbort 

io abort register

kSDIO_RegBusInterface 

bus interface register

kSDIO_RegCardCapability 

card capability register

kSDIO_RegCommonCISPointer 

common CIS pointer register

kSDIO_RegBusSuspend 

bus suspend register

kSDIO_RegFunctionSelect 

function select register

kSDIO_RegExecutionFlag 

execution flag register

kSDIO_RegReadyFlag 

ready flag register

kSDIO_RegFN0BlockSizeLow 

FN0 block size register.

kSDIO_RegFN0BlockSizeHigh 

FN0 block size register.

kSDIO_RegPowerControl 

power control register

kSDIO_RegBusSpeed 

bus speed register

kSDIO_RegUHSITimingSupport 

UHS-I timing support register.

kSDIO_RegDriverStrength 

Driver strength register.

kSDIO_RegInterruptExtension 

Interrupt extension register.

Enumerator
kSDIO_SendRelativeAddress 

send relative address

kSDIO_SendOperationCondition 

send operation condition

kSDIO_SendInterfaceCondition 

send interface condition

kSDIO_RWIODirect 

read/write IO direct command

kSDIO_RWIOExtended 

read/write IO extended command

Enumerator
kSDIO_FunctionNum0 

sdio function0

kSDIO_FunctionNum1 

sdio function1

kSDIO_FunctionNum2 

sdio function2

kSDIO_FunctionNum3 

sdio function3

kSDIO_FunctionNum4 

sdio function4

kSDIO_FunctionNum5 

sdio function5

kSDIO_FunctionNum6 

sdio function6

kSDIO_FunctionNum7 

sdio function7

kSDIO_FunctionMemory 

for combo card

Enumerator
kSDIO_StatusCmdCRCError 

the CRC check of the previous cmd fail

kSDIO_StatusIllegalCmd 

cmd illegal for the card state

kSDIO_StatusR6Error 

special for R6 error status

kSDIO_StatusError 

A general or an unknown error occurred.

kSDIO_StatusFunctionNumError 

invail function error

kSDIO_StatusOutofRange 

cmd argument was out of the allowed range

Enumerator
kSDIO_OcrPowerUpBusyFlag 

Power up busy status.

kSDIO_OcrIONumber 

number of IO function

kSDIO_OcrMemPresent 

memory present flag

kSDIO_OcrVdd20_21Flag 

VDD 2.0-2.1.

kSDIO_OcrVdd21_22Flag 

VDD 2.1-2.2.

kSDIO_OcrVdd22_23Flag 

VDD 2.2-2.3.

kSDIO_OcrVdd23_24Flag 

VDD 2.3-2.4.

kSDIO_OcrVdd24_25Flag 

VDD 2.4-2.5.

kSDIO_OcrVdd25_26Flag 

VDD 2.5-2.6.

kSDIO_OcrVdd26_27Flag 

VDD 2.6-2.7.

kSDIO_OcrVdd27_28Flag 

VDD 2.7-2.8.

kSDIO_OcrVdd28_29Flag 

VDD 2.8-2.9.

kSDIO_OcrVdd29_30Flag 

VDD 2.9-3.0.

kSDIO_OcrVdd30_31Flag 

VDD 2.9-3.0.

kSDIO_OcrVdd31_32Flag 

VDD 3.0-3.1.

kSDIO_OcrVdd32_33Flag 

VDD 3.1-3.2.

kSDIO_OcrVdd33_34Flag 

VDD 3.2-3.3.

kSDIO_OcrVdd34_35Flag 

VDD 3.3-3.4.

kSDIO_OcrVdd35_36Flag 

VDD 3.4-3.5.

Enumerator
kSDIO_CCCRSupportDirectCmdDuringDataTrans 

support direct cmd during data transfer

kSDIO_CCCRSupportMultiBlock 

support multi block mode

kSDIO_CCCRSupportReadWait 

support read wait

kSDIO_CCCRSupportSuspendResume 

support suspend resume

kSDIO_CCCRSupportIntDuring4BitDataTrans 

support interrupt during 4-bit data transfer

kSDIO_CCCRSupportLowSpeed1Bit 

support low speed 1bit mode

kSDIO_CCCRSupportLowSpeed4Bit 

support low speed 4bit mode

kSDIO_CCCRSupportMasterPowerControl 

support master power control

kSDIO_CCCRSupportHighSpeed 

support high speed

kSDIO_CCCRSupportContinuousSPIInt 

support continuous SPI interrupt

Enumerator
kSDIO_FBRSupportCSA 

function support CSA

kSDIO_FBRSupportPowerSelection 

function support power selection

Enumerator
kSDIO_DataBus1Bit 

1 bit bus mode

kSDIO_DataBus4Bit 

4 bit bus mode

kSDIO_DataBus8Bit 

8 bit bus mode

Enumerator
kMMC_SendOperationCondition 

Send Operation Condition.

kMMC_SetRelativeAddress 

Set Relative Address.

kMMC_SleepAwake 

Sleep Awake.

kMMC_Switch 

Switch.

kMMC_SendExtendedCsd 

Send EXT_CSD.

kMMC_ReadDataUntilStop 

Read Data Until Stop.

kMMC_BusTestRead 

Test Read.

kMMC_SendingBusTest 

test bus width cmd

kMMC_WriteDataUntilStop 

Write Data Until Stop.

kMMC_SendTuningBlock 

MMC sending tuning block.

kMMC_ProgramCid 

Program CID.

kMMC_EraseGroupStart 

Erase Group Start.

kMMC_EraseGroupEnd 

Erase Group End.

kMMC_FastInputOutput 

Fast IO.

kMMC_GoInterruptState 

Go interrupt State.

Enumerator
kMMC_ClassifiedVoltageHigh 

High-voltage MMC card.

kMMC_ClassifiedVoltageDual 

Dual-voltage MMC card.

Enumerator
kMMC_ClassifiedDensityWithin2GB 

Density byte is less than or equal 2GB.

Enumerator
kMMC_AccessModeByte 

The card should be accessed as byte.

kMMC_AccessModeSector 

The card should be accessed as sector.

Enumerator
kMMC_VoltageWindowNone 

voltage window is not define by user

kMMC_VoltageWindow120 

Voltage window is 1.20V.

kMMC_VoltageWindow170to195 

Voltage window is 1.70V to 1.95V.

kMMC_VoltageWindows270to360 

Voltage window is 2.70V to 3.60V.

Enumerator
kMMC_CsdStrucureVersion10 

CSD version No.

1.0

kMMC_CsdStrucureVersion11 

CSD version No.

1.1

kMMC_CsdStrucureVersion12 

CSD version No.

1.2

kMMC_CsdStrucureVersionInExtcsd 

Version coded in Extended CSD.

Enumerator
kMMC_SpecificationVersion0 

Allocated by MMCA.

kMMC_SpecificationVersion1 

Allocated by MMCA.

kMMC_SpecificationVersion2 

Allocated by MMCA.

kMMC_SpecificationVersion3 

Allocated by MMCA.

kMMC_SpecificationVersion4 

Version 4.1/4.2/4.3/4.41-4.5-4.51-5.0.

Enumerator
kMMC_ExtendedCsdRevision10 

Revision 1.0.

kMMC_ExtendedCsdRevision11 

Revision 1.1.

kMMC_ExtendedCsdRevision12 

Revision 1.2.

kMMC_ExtendedCsdRevision13 

Revision 1.3 MMC4.3.

kMMC_ExtendedCsdRevision14 

Revision 1.4 obsolete.

kMMC_ExtendedCsdRevision15 

Revision 1.5 MMC4.41.

kMMC_ExtendedCsdRevision16 

Revision 1.6 MMC4.5.

kMMC_ExtendedCsdRevision17 

Revision 1.7 MMC5.0.

Enumerator
kMMC_CommandSetStandard 

Standard MMC.

kMMC_CommandSet1 

Command set 1.

kMMC_CommandSet2 

Command set 2.

kMMC_CommandSet3 

Command set 3.

kMMC_CommandSet4 

Command set 4.

Enumerator
kMMC_SupportAlternateBoot 

support alternative boot mode

kMMC_SupportDDRBoot 

support DDR boot mode

kMMC_SupportHighSpeedBoot 

support high speed boot mode

Enumerator
kMMC_HighSpeedTimingNone 

MMC card using none high-speed timing.

kMMC_HighSpeedTiming 

MMC card using high-speed timing.

kMMC_HighSpeed200Timing 

MMC card high speed 200 timing.

kMMC_HighSpeed400Timing 

MMC card high speed 400 timing.

kMMC_EnhanceHighSpeed400Timing 

MMC card high speed 400 timing.

Enumerator
kMMC_DataBusWidth1bit 

MMC data bus width is 1 bit.

kMMC_DataBusWidth4bit 

MMC data bus width is 4 bits.

kMMC_DataBusWidth8bit 

MMC data bus width is 8 bits.

kMMC_DataBusWidth4bitDDR 

MMC data bus width is 4 bits ddr.

kMMC_DataBusWidth8bitDDR 

MMC data bus width is 8 bits ddr.

kMMC_DataBusWidth8bitDDRSTROBE 

MMC data bus width is 8 bits ddr strobe mode.

Enumerator
kMMC_BootPartitionEnableNot 

Device not boot enabled (default)

kMMC_BootPartitionEnablePartition1 

Boot partition 1 enabled for boot.

kMMC_BootPartitionEnablePartition2 

Boot partition 2 enabled for boot.

kMMC_BootPartitionEnableUserAera 

User area enabled for boot.

Enumerator
kMMC_BootModeSDRWithDefaultTiming 

boot mode single data rate with backward compatiable timings

kMMC_BootModeSDRWithHighSpeedTiming 

boot mode single data rate with high speed timing

kMMC_BootModeDDRTiming 

boot mode dual date rate

Enumerator
kMMC_BootPartitionWPDisable 

boot partition write protection disable

kMMC_BootPartitionPwrWPToBothPartition 

power on period write protection apply to both boot partitions

kMMC_BootPartitionPermWPToBothPartition 

permanent write protection apply to both boot partitions

kMMC_BootPartitionPwrWPToPartition1 

power on period write protection apply to partition1

kMMC_BootPartitionPwrWPToPartition2 

power on period write protection apply to partition2

kMMC_BootPartitionPermWPToPartition1 

permanent write protection apply to partition1

kMMC_BootPartitionPermWPToPartition2 

permanent write protection apply to partition2

kMMC_BootPartitionPermWPToPartition1PwrWPToPartition2 

permanent write protection apply to partition1, power on period write protection apply to partition2

kMMC_BootPartitionPermWPToPartition2PwrWPToPartition1 

permanent write protection apply to partition2, power on period write protection apply to partition1

Enumerator
kMMC_BootPartitionNotProtected 

boot partition not protected

kMMC_BootPartitionPwrProtected 

boot partition is power on period write protected

kMMC_BootPartitionPermProtected 

boot partition is permanently protected

Enumerator
kMMC_AccessPartitionUserAera 

No access to boot partition (default), normal partition.

kMMC_AccessPartitionBoot1 

Read/Write boot partition 1.

kMMC_AccessPartitionBoot2 

Read/Write boot partition 2.

kMMC_AccessRPMB 

Replay protected mem block.

kMMC_AccessGeneralPurposePartition1 

access to general purpose partition 1

kMMC_AccessGeneralPurposePartition2 

access to general purpose partition 2

kMMC_AccessGeneralPurposePartition3 

access to general purpose partition 3

kMMC_AccessGeneralPurposePartition4 

access to general purpose partition 4

Enumerator
kMMC_CsdReadBlockPartialFlag 

Partial blocks for read allowed.

kMMC_CsdWriteBlockMisalignFlag 

Write block misalignment.

kMMC_CsdReadBlockMisalignFlag 

Read block misalignment.

kMMC_CsdDsrImplementedFlag 

DSR implemented.

kMMC_CsdWriteProtectGroupEnabledFlag 

Write protect group enabled.

kMMC_CsdWriteBlockPartialFlag 

Partial blocks for write allowed.

kMMC_ContentProtectApplicationFlag 

Content protect application.

kMMC_CsdFileFormatGroupFlag 

File format group.

kMMC_CsdCopyFlag 

Copy flag.

kMMC_CsdPermanentWriteProtectFlag 

Permanent write protection.

kMMC_CsdTemporaryWriteProtectFlag 

Temporary write protection.

Enumerator
kMMC_ExtendedCsdAccessModeCommandSet 

Command set related setting.

kMMC_ExtendedCsdAccessModeSetBits 

Set bits in specific byte in Extended CSD.

kMMC_ExtendedCsdAccessModeClearBits 

Clear bits in specific byte in Extended CSD.

kMMC_ExtendedCsdAccessModeWriteBits 

Write a value to specific byte in Extended CSD.

Enumerator
kMMC_ExtendedCsdIndexBootPartitionWP 

Boot partition write protect.

kMMC_ExtendedCsdIndexEraseGroupDefinition 

Erase Group Def.

kMMC_ExtendedCsdIndexBootBusConditions 

Boot Bus conditions.

kMMC_ExtendedCsdIndexBootConfigWP 

Boot config write protect.

kMMC_ExtendedCsdIndexPartitionConfig 

Partition Config, before BOOT_CONFIG.

kMMC_ExtendedCsdIndexBusWidth 

Bus Width.

kMMC_ExtendedCsdIndexHighSpeedTiming 

High-speed Timing.

kMMC_ExtendedCsdIndexPowerClass 

Power Class.

kMMC_ExtendedCsdIndexCommandSet 

Command Set.

Enumerator
kMMC_DriverStrength0 

Driver type0 ,nominal impedance 50ohm.

kMMC_DriverStrength1 

Driver type1 ,nominal impedance 33ohm.

kMMC_DriverStrength2 

Driver type2 ,nominal impedance 66ohm.

kMMC_DriverStrength3 

Driver type3 ,nominal impedance 100ohm.

kMMC_DriverStrength4 

Driver type4 ,nominal impedance 40ohm.

Enumerator
kMMC_ExtCsdExtPartitionSupport 

partitioning support[160]

kMMC_ExtCsdEnhancePartitionSupport 

partitioning support[160]

kMMC_ExtCsdPartitioningSupport 

partitioning support[160]

kMMC_ExtCsdPrgCIDCSDInDDRModeSupport 

CMD26 and CMD27 are support dual data rate [130].

kMMC_ExtCsdBKOpsSupport 

background operation feature support [502]

kMMC_ExtCsdDataTagSupport 

data tag support[499]

kMMC_ExtCsdModeOperationCodeSupport 

mode operation code support[493]

Enumerator
kMMC_BootModeNormal 

Normal boot.

kMMC_BootModeAlternative 

Alternative boot.

Function Documentation

status_t SDMMC_SelectCard ( sdmmchost_t host,
uint32_t  relativeAddress,
bool  isSelected 
)
Parameters
hosthost handler.
relativeAddressRelative address.
isSelectedTrue to put card into transfer state.
Return values
kStatus_SDMMC_TransferFailedTransfer failed.
kStatus_SuccessOperate successfully.
status_t SDMMC_SendApplicationCommand ( sdmmchost_t host,
uint32_t  relativeAddress 
)
Parameters
hosthost handler.
relativeAddressCard relative address.
Return values
kStatus_SDMMC_TransferFailedTransfer failed.
kStatus_SDMMC_CardNotSupportCard doesn't support.
kStatus_SuccessOperate successfully.
status_t SDMMC_SetBlockCount ( sdmmchost_t host,
uint32_t  blockCount 
)
Parameters
hosthost handler.
blockCountBlock count.
Return values
kStatus_SDMMC_TransferFailedTransfer failed.
kStatus_SuccessOperate successfully.
status_t SDMMC_GoIdle ( sdmmchost_t host)
Parameters
hosthost handler.
Return values
kStatus_SDMMC_TransferFailedTransfer failed.
kStatus_SuccessOperate successfully.
status_t SDMMC_SetBlockSize ( sdmmchost_t host,
uint32_t  blockSize 
)
Parameters
hosthost handler.
blockSizeBlock size.
Return values
kStatus_SDMMC_TransferFailedTransfer failed.
kStatus_SuccessOperate successfully.
status_t SDMMC_SetCardInactive ( sdmmchost_t host)
Parameters
hosthost handler.
Return values
kStatus_SDMMC_TransferFailedTransfer failed.
kStatus_SuccessOperate successfully.