HPM SDK
HPMicro Software Development Kit
hpm_sdmmc_emmc.h File Reference
#include "hpm_sdmmc_common.h"
#include "hpm_sdmmc_card.h"
#include "hpm_sdmmc_port.h"

Go to the source code of this file.

Data Structures

union  emmc_switch_cmd_arg_t
 
union  emmc_ocr_t
 
union  emmc_cid_t
 
union  emmc_card_status_t
 
struct  emmc_csd_t
 
union  emmc_device_type_t
 
struct  emmc_ext_csd_t
 
union  emmc_power_class_t
 
struct  boot_info_t
 
struct  secure_feature_info_t
 
struct  emmc_boot_setting_t
 
struct  emmc_device_attribute_t
 
struct  emmc_config_partition_option_t
 

Macros

#define EMMC_EXT_CSD_INDEX_CMD_SET   (191)
 
#define EMMC_EXT_CSD_INDEX_POWER_CLASS   (187)
 
#define EMMC_EXT_CSD_INDEX_HS_TIMING   (185)
 
#define EMMC_EXT_CSD_INDEX_BUS_WDITH   (183)
 
#define EMMC_EXT_CSD_INDEX_PARTITION_CONFIG   (179)
 
#define EMMC_EXT_CSD_INDEX_BOOT_CONFIG_PROT   (178)
 
#define EMMC_EXT_CSD_INDEX_BOOT_BUS_CONDITIONS   (177)
 
#define EMMC_EXT_CSD_INDEX_ERASE_GROUP_DEF   (175)
 
#define EMMC_EXT_CSD_INDEX_BOOT_WP   (173)
 
#define EMMC_EXT_CSD_INDEX_USER_WP   (171)
 
#define EMMC_EXT_CSD_INDEX_FW_CONFIG   (169)
 
#define EMMC_EXT_CSD_INDEX_WR_REL_SET   (167)
 
#define EMMC_EXT_CSD_INDEX_SANITIZE_START   (165)
 
#define EMMC_EXT_CSD_INDEX_BKOPS_START   (164)
 
#define EMMC_EXT_CSD_INDEX_BKOPS_EN   (163)
 
#define EMMC_EXT_CSD_INDEX_RSTn_FUNCTION   (162)
 
#define EMMC_EXT_CSD_INDEX_HPI_MGMT   (161)
 
#define EMMC_EXT_CSD_INDEX_PARTITIONS_ATTRIBUTE   (156)
 
#define EMMC_EXT_CSD_INDEX_PARTITION_SETTING_COMPLETED   (155)
 
#define EMMC_EXT_CSD_INDEX_SEC_BAD_BLK_MGMNT   (134)
 
#define EMMC_EXT_CSD_INDEX_PRODUCTION_STATE_AWARENESS   (133)
 
#define EMMC_EXT_CSD_INDEX_PERIODIC_WAKEUP   (131)
 
#define EMMC_EXT_CSD_INDEX_USE_NATIVE_SECTOR   (62)
 
#define EMMC_EXT_CSD_INDEX_CLASS_6_CTRL   (59)
 
#define EMMC_EXT_CSD_INDEX_POWER_OFF_NOTIFICATION   (34)
 
#define EMMC_EXT_CSD_INDEX_CACHE_CTRL   (33)
 
#define EMMC_EXT_CSD_INDEX_FLUSH_CACHE   (32)
 
#define EMMC_EXT_CSD_INDEX_BARRIER_CTRL   (31)
 
#define EMMC_EXT_CSD_INDEX_MODE_CONFIG   (30)
 
#define EMMC_EXT_CSD_INDEX_PRODUCT_STATE_AWARENESS_ENABLEMENT   (17)
 
#define EMMC_EXT_CSD_INDEX_SECURE_REMOVAL_TYPE   (16)
 
#define EMMC_EXT_CSD_INDEX_CMDQ_MODE_EN   (15)
 

Typedefs

typedef enum vdd_current_min_def vdd_current_min_t
 
typedef enum vdd_current_max_def vdd_current_max_t
 
typedef enum _emmc_partition emmc_partition_t
 
typedef enum _emmc_hs_timing emmc_hs_timing_t
 
typedef struct _sdmmc_emmc emmc_card_t
 

Enumerations

enum  emmc_switch_cmd_access_mode_t { emmc_switch_cmd_access_mode_command_set = 0 , emmc_switch_cmd_access_mode_set_bits = 1 , emmc_switch_cmd_access_mode_clear_bits = 2 , emmc_switch_cmd_access_mode_write_byte = 3 }
 
enum  emmc_csd_vdd_current_min_t {
  emmc_csd_vdd_current_min_0_5ma , emmc_csd_vdd_current_min_1ma , emmc_csd_vdd_current_min_5ma , emmc_csd_vdd_current_min_10ma ,
  emmc_csd_vdd_current_min_25ma , emmc_csd_vdd_current_min_35ma , emmc_csd_vdd_current_min_60ma , emmc_csd_vdd_current_min_100ma
}
 
enum  emmc_csd_vdd_current_max_t {
  emmc_csd_vdd_current_max_1ma , emmc_csd_vdd_current_max_5ma , emmc_csd_vdd_current_max_10ma , emmc_csd_vdd_current_max_25ma ,
  emmc_csd_vdd_current_max_35ma , emmc_csd_vdd_current_max_45ma , emmc_csd_vdd_current_max_80ma , emmc_csd_vdd_current_max_200ma
}
 
enum  vdd_current_min_def {
  vdd_current_min_0_5ma , vdd_current_min_1ma , vdd_current_min_5ma , vdd_current_min_10ma ,
  vdd_current_min_25ma , vdd_current_min_35ma , vdd_current_min_60ma , vdd_current_min_100ma
}
 
enum  vdd_current_max_def {
  vdd_current_max_1ma , vdd_current_max_5ma , vdd_current_max_10ma , vdd_current_max_25ma ,
  vdd_current_max_35ma , vdd_current_max_45ma , vdd_current_max_80ma , vdd_current_max_200ma
}
 
enum  emmc_csd_file_format_t { emmc_csd_file_format_hard_disk_like_file_system_with_partition_table , emmc_csd_file_format_dos_fat_with_boot_sector_only , emmc_csd_file_format_universal_file_format , emmc_csd_file_format_others_or_unknown }
 
enum  emmc_power_class_3v6_t {
  emmc_power_3v6_max_rms_100ma_peak_200ma = 0 , emmc_power_3v6_max_rms_120ma_peak_220ma = 1 , emmc_power_3v6_max_rms_150ma_peak_250ma = 2 , emmc_power_3v6_max_rms_180ma_peak_280ma = 3 ,
  emmc_power_3v6_max_rms_200ma_peak_300ma = 4 , emmc_power_3v6_max_rms_220ma_peak_320ma = 5 , emmc_power_3v6_max_rms_250ma_peak_350ma = 6 , emmc_power_3v6_max_rms_300ma_peak_400ma = 7 ,
  emmc_power_3v6_max_rms_350ma_peak_450ma = 8 , emmc_power_3v6_max_rms_400ma_peak_500ma = 9 , emmc_power_3v6_max_rms_450ma_peak_550ma = 10 , emmc_power_3v6_max_rms_500ma_peak_600ma = 11 ,
  emmc_power_3v6_max_rms_600ma_peak_700ma = 12 , emmc_power_3v6_max_rms_700ma_peak_800ma = 13 , emmc_power_3v6_max_rms_800ma_peak_900ma = 14 , emmc_power_3v6_max_rms_gt800ma_peak_gt900ma = 15
}
 
enum  emmc_power_class_1v95_t {
  emmc_power_1v95_max_rms_65ma_peak_130ma = 0 , emmc_power_1v95_max_rms_70ma_peak_140ma = 1 , emmc_power_1v95_max_rms_80ma_peak_160ma = 2 , emmc_power_1v95_max_rms_90ma_peak_180ma = 3 ,
  emmc_power_1v95_max_rms_100ma_peak_200ma = 4 , emmc_power_1v95_max_rms_120ma_peak_220ma = 5 , emmc_power_1v95_max_rms_140ma_peak_240ma = 6 , emmc_power_1v95_max_rms_160ma_peak_260ma = 7 ,
  emmc_power_1v95_max_rms_180ma_peak_280ma = 8 , emmc_power_1v95_max_rms_200ma_peak_300ma = 9 , emmc_power_1v95_max_rms_250ma_peak_350ma = 10 , emmc_power_1v95_max_rms_300ma_peak_400ma = 11 ,
  emmc_power_1v95_max_rms_350ma_peak_450ma = 12 , emmc_power_1v95_max_rms_400ma_peak_500ma = 13 , emmc_power_1v95_max_rms_500ma_peak_600ma = 14 , emmc_power_1v95_max_rms_gt500ma_peak_gt600ma = 15
}
 
enum  emmc_bus_mode_t {
  emmc_bus_mode_x1_sdr = 0 , emmc_bus_mode_x4_sdr = 1 , emmc_bus_mode_x8_sdr = 2 , emmc_bus_mode_x4_ddr = 5 ,
  emmc_bus_mode_x8_ddr = 6 , emmc_bus_mode_x8_ddr_ds = 0x86
}
 
enum  emmc_write_protection_mode_t { emmc_write_protection_mode_legacy = 0 , emmc_write_protection_mode_secure = 1 }
 
enum  emmc_boot_partition_mode_t { emmc_boot_partition_mode_not_enabled = 0 , emmc_boot_partition_mode_boot_partition1 = 1 , emmc_boot_partition_mode_boot_partition2 = 2 , emmc_boot_partition_mode_user_area = 7 }
 
enum  emmc_partition_access_t {
  emmc_partition_access_boot_partition_disabled = 0 , emmc_partition_access_read_or_write_boot_partition1 = 1 , emmc_partition_access_read_or_write_boot_partition2 = 2 , emmc_partition_access_read_or_write_rpmb = 3 ,
  emmc_partition_access_access_to_gp_partition1 = 4 , emmc_partition_access_access_to_gp_partition2 = 5 , emmc_partition_access_access_to_gp_partition3 = 6 , emmc_partition_access_access_to_gp_partition4 = 7
}
 
enum  emmc_boot_mode_t { emmc_boot_mode_sdr_legacy = 0 , emmc_boot_mode_sdr_high_speed_timing , emmc_boot_mode_ddr }
 
enum  emmc_idle_option_t { emmc_idle_option_go_idle_state = 0 , emmc_idle_option_go_pre_idle_state = 0xF0F0F0F0U , emmc_idle_option_boot_initialization = 0xFFFFFFFAU }
 
enum  emmc_erase_option_t { emmc_erase_option_erase = 0 , emmc_erase_option_trim = 1 , emmc_erase_option_discard = 2 }
 
enum  emmc_boot_partition_enable_option_t { boot_partition_enable_option_not_enabled = 0 , boot_partition_enable_option_boot_partition1 = 1 , boot_partition_enable_option_boot_partition2 = 2 , boot_partition_enable_option_user_area = 7 }
 
enum  emmc_partition_access_option_t {
  partition_access_option_no_access_to_boot_partition = 0 , partition_access_option_read_write_boot_partition1 = 1 , partition_access_option_read_write_boot_partition2 = 2 , partition_access_option_read_write_rpmb = 3 ,
  partition_access_option_access_to_gp_partition1 = 4 , partition_access_option_access_to_gp_partition2 = 5 , partition_access_option_access_to_gp_partition3 = 6 , partition_access_option_access_to_gp_partition4 = 7
}
 

Functions

hpm_stat_t emmc_init (emmc_card_t *card)
 Intialize eMMC device, include both host and the device. More...
 
void emmc_deinit (emmc_card_t *card)
 
hpm_stat_t emmc_card_init (emmc_card_t *card)
 Initialize eMMC device. More...
 
hpm_stat_t emmc_send_cid (emmc_card_t *card)
 Request eMMC device to send CID to Host. More...
 
hpm_stat_t emmc_probe_device (emmc_card_t *card)
 Probe eMMC device. More...
 
hpm_stat_t emmc_select_card (emmc_card_t *card, bool is_selected)
 Select eMMC device. More...
 
hpm_stat_t emmc_go_idle (emmc_card_t *card, emmc_idle_option_t option)
 Go to Idle mode. More...
 
hpm_stat_t emmc_switch_function (emmc_card_t *card, emmc_switch_cmd_arg_t arg, uint32_t timeout_us)
 Switch eMMC function. More...
 
hpm_stat_t emmc_configure_partition (emmc_card_t *card, emmc_config_partition_option_t option)
 Configure eMMC Partition. More...
 
hpm_stat_t emmc_enable_high_density_erase_group (emmc_card_t *card, bool enable)
 Enable High Density Erase group. More...
 
hpm_stat_t emmc_program_csd (emmc_card_t *card, const uint32_t *raw_csd)
 Program CSD register. More...
 
hpm_stat_t emmc_read_blocks (emmc_card_t *card, uint8_t *buffer, uint32_t start_block, uint32_t block_count)
 Read eMMC blocks. More...
 
hpm_stat_t emmc_write_blocks (emmc_card_t *card, const uint8_t *buffer, uint32_t start_block, uint32_t block_count)
 Write eMMC blocks. More...
 
hpm_stat_t emmc_erase_blocks (emmc_card_t *card, uint32_t start_block, uint32_t block_count, emmc_erase_option_t option)
 Erase eMMC Blocks. More...
 
hpm_stat_t emmc_enter_sleep_mode (emmc_card_t *card)
 Switch eMMC device into sleep mode. More...
 
hpm_stat_t emmc_exit_sleep_mode (emmc_card_t *card)
 Switch eMMC device into standby mode. More...
 

Macro Definition Documentation

◆ EMMC_EXT_CSD_INDEX_BARRIER_CTRL

#define EMMC_EXT_CSD_INDEX_BARRIER_CTRL   (31)

◆ EMMC_EXT_CSD_INDEX_BKOPS_EN

#define EMMC_EXT_CSD_INDEX_BKOPS_EN   (163)

◆ EMMC_EXT_CSD_INDEX_BKOPS_START

#define EMMC_EXT_CSD_INDEX_BKOPS_START   (164)

◆ EMMC_EXT_CSD_INDEX_BOOT_BUS_CONDITIONS

#define EMMC_EXT_CSD_INDEX_BOOT_BUS_CONDITIONS   (177)

◆ EMMC_EXT_CSD_INDEX_BOOT_CONFIG_PROT

#define EMMC_EXT_CSD_INDEX_BOOT_CONFIG_PROT   (178)

◆ EMMC_EXT_CSD_INDEX_BOOT_WP

#define EMMC_EXT_CSD_INDEX_BOOT_WP   (173)

◆ EMMC_EXT_CSD_INDEX_BUS_WDITH

#define EMMC_EXT_CSD_INDEX_BUS_WDITH   (183)

◆ EMMC_EXT_CSD_INDEX_CACHE_CTRL

#define EMMC_EXT_CSD_INDEX_CACHE_CTRL   (33)

◆ EMMC_EXT_CSD_INDEX_CLASS_6_CTRL

#define EMMC_EXT_CSD_INDEX_CLASS_6_CTRL   (59)

◆ EMMC_EXT_CSD_INDEX_CMD_SET

#define EMMC_EXT_CSD_INDEX_CMD_SET   (191)

◆ EMMC_EXT_CSD_INDEX_CMDQ_MODE_EN

#define EMMC_EXT_CSD_INDEX_CMDQ_MODE_EN   (15)

◆ EMMC_EXT_CSD_INDEX_ERASE_GROUP_DEF

#define EMMC_EXT_CSD_INDEX_ERASE_GROUP_DEF   (175)

◆ EMMC_EXT_CSD_INDEX_FLUSH_CACHE

#define EMMC_EXT_CSD_INDEX_FLUSH_CACHE   (32)

◆ EMMC_EXT_CSD_INDEX_FW_CONFIG

#define EMMC_EXT_CSD_INDEX_FW_CONFIG   (169)

◆ EMMC_EXT_CSD_INDEX_HPI_MGMT

#define EMMC_EXT_CSD_INDEX_HPI_MGMT   (161)

◆ EMMC_EXT_CSD_INDEX_HS_TIMING

#define EMMC_EXT_CSD_INDEX_HS_TIMING   (185)

◆ EMMC_EXT_CSD_INDEX_MODE_CONFIG

#define EMMC_EXT_CSD_INDEX_MODE_CONFIG   (30)

◆ EMMC_EXT_CSD_INDEX_PARTITION_CONFIG

#define EMMC_EXT_CSD_INDEX_PARTITION_CONFIG   (179)

◆ EMMC_EXT_CSD_INDEX_PARTITION_SETTING_COMPLETED

#define EMMC_EXT_CSD_INDEX_PARTITION_SETTING_COMPLETED   (155)

◆ EMMC_EXT_CSD_INDEX_PARTITIONS_ATTRIBUTE

#define EMMC_EXT_CSD_INDEX_PARTITIONS_ATTRIBUTE   (156)

◆ EMMC_EXT_CSD_INDEX_PERIODIC_WAKEUP

#define EMMC_EXT_CSD_INDEX_PERIODIC_WAKEUP   (131)

◆ EMMC_EXT_CSD_INDEX_POWER_CLASS

#define EMMC_EXT_CSD_INDEX_POWER_CLASS   (187)

◆ EMMC_EXT_CSD_INDEX_POWER_OFF_NOTIFICATION

#define EMMC_EXT_CSD_INDEX_POWER_OFF_NOTIFICATION   (34)

◆ EMMC_EXT_CSD_INDEX_PRODUCT_STATE_AWARENESS_ENABLEMENT

#define EMMC_EXT_CSD_INDEX_PRODUCT_STATE_AWARENESS_ENABLEMENT   (17)

◆ EMMC_EXT_CSD_INDEX_PRODUCTION_STATE_AWARENESS

#define EMMC_EXT_CSD_INDEX_PRODUCTION_STATE_AWARENESS   (133)

◆ EMMC_EXT_CSD_INDEX_RSTn_FUNCTION

#define EMMC_EXT_CSD_INDEX_RSTn_FUNCTION   (162)

◆ EMMC_EXT_CSD_INDEX_SANITIZE_START

#define EMMC_EXT_CSD_INDEX_SANITIZE_START   (165)

◆ EMMC_EXT_CSD_INDEX_SEC_BAD_BLK_MGMNT

#define EMMC_EXT_CSD_INDEX_SEC_BAD_BLK_MGMNT   (134)

◆ EMMC_EXT_CSD_INDEX_SECURE_REMOVAL_TYPE

#define EMMC_EXT_CSD_INDEX_SECURE_REMOVAL_TYPE   (16)

◆ EMMC_EXT_CSD_INDEX_USE_NATIVE_SECTOR

#define EMMC_EXT_CSD_INDEX_USE_NATIVE_SECTOR   (62)

◆ EMMC_EXT_CSD_INDEX_USER_WP

#define EMMC_EXT_CSD_INDEX_USER_WP   (171)

◆ EMMC_EXT_CSD_INDEX_WR_REL_SET

#define EMMC_EXT_CSD_INDEX_WR_REL_SET   (167)

Typedef Documentation

◆ emmc_card_t

typedef struct _sdmmc_emmc emmc_card_t

◆ emmc_hs_timing_t

typedef enum _emmc_hs_timing emmc_hs_timing_t

◆ emmc_partition_t

typedef enum _emmc_partition emmc_partition_t

◆ vdd_current_max_t

◆ vdd_current_min_t

Enumeration Type Documentation

◆ emmc_boot_mode_t

Enumerator
emmc_boot_mode_sdr_legacy 
emmc_boot_mode_sdr_high_speed_timing 
emmc_boot_mode_ddr 

◆ emmc_boot_partition_enable_option_t

Enumerator
boot_partition_enable_option_not_enabled 
boot_partition_enable_option_boot_partition1 
boot_partition_enable_option_boot_partition2 
boot_partition_enable_option_user_area 

◆ emmc_boot_partition_mode_t

Enumerator
emmc_boot_partition_mode_not_enabled 
emmc_boot_partition_mode_boot_partition1 
emmc_boot_partition_mode_boot_partition2 
emmc_boot_partition_mode_user_area 

◆ emmc_bus_mode_t

Enumerator
emmc_bus_mode_x1_sdr 
emmc_bus_mode_x4_sdr 
emmc_bus_mode_x8_sdr 
emmc_bus_mode_x4_ddr 
emmc_bus_mode_x8_ddr 
emmc_bus_mode_x8_ddr_ds 

◆ emmc_csd_file_format_t

Enumerator
emmc_csd_file_format_hard_disk_like_file_system_with_partition_table 
emmc_csd_file_format_dos_fat_with_boot_sector_only 
emmc_csd_file_format_universal_file_format 
emmc_csd_file_format_others_or_unknown 

◆ emmc_csd_vdd_current_max_t

Enumerator
emmc_csd_vdd_current_max_1ma 
emmc_csd_vdd_current_max_5ma 
emmc_csd_vdd_current_max_10ma 
emmc_csd_vdd_current_max_25ma 
emmc_csd_vdd_current_max_35ma 
emmc_csd_vdd_current_max_45ma 
emmc_csd_vdd_current_max_80ma 
emmc_csd_vdd_current_max_200ma 

◆ emmc_csd_vdd_current_min_t

Enumerator
emmc_csd_vdd_current_min_0_5ma 
emmc_csd_vdd_current_min_1ma 
emmc_csd_vdd_current_min_5ma 
emmc_csd_vdd_current_min_10ma 
emmc_csd_vdd_current_min_25ma 
emmc_csd_vdd_current_min_35ma 
emmc_csd_vdd_current_min_60ma 
emmc_csd_vdd_current_min_100ma 

◆ emmc_erase_option_t

Enumerator
emmc_erase_option_erase 

eMMC Erase operation

emmc_erase_option_trim 

eMMC Trim operation

emmc_erase_option_discard 

eMMC Discard operation

◆ emmc_idle_option_t

Enumerator
emmc_idle_option_go_idle_state 
emmc_idle_option_go_pre_idle_state 
emmc_idle_option_boot_initialization 

◆ emmc_partition_access_option_t

Enumerator
partition_access_option_no_access_to_boot_partition 
partition_access_option_read_write_boot_partition1 
partition_access_option_read_write_boot_partition2 
partition_access_option_read_write_rpmb 
partition_access_option_access_to_gp_partition1 
partition_access_option_access_to_gp_partition2 
partition_access_option_access_to_gp_partition3 
partition_access_option_access_to_gp_partition4 

◆ emmc_partition_access_t

Enumerator
emmc_partition_access_boot_partition_disabled 
emmc_partition_access_read_or_write_boot_partition1 
emmc_partition_access_read_or_write_boot_partition2 
emmc_partition_access_read_or_write_rpmb 
emmc_partition_access_access_to_gp_partition1 
emmc_partition_access_access_to_gp_partition2 
emmc_partition_access_access_to_gp_partition3 
emmc_partition_access_access_to_gp_partition4 

◆ emmc_power_class_1v95_t

Enumerator
emmc_power_1v95_max_rms_65ma_peak_130ma 
emmc_power_1v95_max_rms_70ma_peak_140ma 
emmc_power_1v95_max_rms_80ma_peak_160ma 
emmc_power_1v95_max_rms_90ma_peak_180ma 
emmc_power_1v95_max_rms_100ma_peak_200ma 
emmc_power_1v95_max_rms_120ma_peak_220ma 
emmc_power_1v95_max_rms_140ma_peak_240ma 
emmc_power_1v95_max_rms_160ma_peak_260ma 
emmc_power_1v95_max_rms_180ma_peak_280ma 
emmc_power_1v95_max_rms_200ma_peak_300ma 
emmc_power_1v95_max_rms_250ma_peak_350ma 
emmc_power_1v95_max_rms_300ma_peak_400ma 
emmc_power_1v95_max_rms_350ma_peak_450ma 
emmc_power_1v95_max_rms_400ma_peak_500ma 
emmc_power_1v95_max_rms_500ma_peak_600ma 
emmc_power_1v95_max_rms_gt500ma_peak_gt600ma 

◆ emmc_power_class_3v6_t

Enumerator
emmc_power_3v6_max_rms_100ma_peak_200ma 
emmc_power_3v6_max_rms_120ma_peak_220ma 
emmc_power_3v6_max_rms_150ma_peak_250ma 
emmc_power_3v6_max_rms_180ma_peak_280ma 
emmc_power_3v6_max_rms_200ma_peak_300ma 
emmc_power_3v6_max_rms_220ma_peak_320ma 
emmc_power_3v6_max_rms_250ma_peak_350ma 
emmc_power_3v6_max_rms_300ma_peak_400ma 
emmc_power_3v6_max_rms_350ma_peak_450ma 
emmc_power_3v6_max_rms_400ma_peak_500ma 
emmc_power_3v6_max_rms_450ma_peak_550ma 
emmc_power_3v6_max_rms_500ma_peak_600ma 
emmc_power_3v6_max_rms_600ma_peak_700ma 
emmc_power_3v6_max_rms_700ma_peak_800ma 
emmc_power_3v6_max_rms_800ma_peak_900ma 
emmc_power_3v6_max_rms_gt800ma_peak_gt900ma 

◆ emmc_switch_cmd_access_mode_t

Enumerator
emmc_switch_cmd_access_mode_command_set 
emmc_switch_cmd_access_mode_set_bits 
emmc_switch_cmd_access_mode_clear_bits 
emmc_switch_cmd_access_mode_write_byte 

◆ emmc_write_protection_mode_t

Enumerator
emmc_write_protection_mode_legacy 
emmc_write_protection_mode_secure 

◆ vdd_current_max_def

Enumerator
vdd_current_max_1ma 
vdd_current_max_5ma 
vdd_current_max_10ma 
vdd_current_max_25ma 
vdd_current_max_35ma 
vdd_current_max_45ma 
vdd_current_max_80ma 
vdd_current_max_200ma 

◆ vdd_current_min_def

Enumerator
vdd_current_min_0_5ma 
vdd_current_min_1ma 
vdd_current_min_5ma 
vdd_current_min_10ma 
vdd_current_min_25ma 
vdd_current_min_35ma 
vdd_current_min_60ma 
vdd_current_min_100ma 

Function Documentation

◆ emmc_card_init()

hpm_stat_t emmc_card_init ( emmc_card_t card)

Initialize eMMC device.

Parameters
card
Returns

◆ emmc_configure_partition()

hpm_stat_t emmc_configure_partition ( emmc_card_t card,
emmc_config_partition_option_t  option 
)

Configure eMMC Partition.

Parameters
card
option
Returns

◆ emmc_deinit()

void emmc_deinit ( emmc_card_t card)

◆ emmc_enable_high_density_erase_group()

hpm_stat_t emmc_enable_high_density_erase_group ( emmc_card_t card,
bool  enable 
)

Enable High Density Erase group.

Parameters
card
enable
Returns

◆ emmc_enter_sleep_mode()

hpm_stat_t emmc_enter_sleep_mode ( emmc_card_t card)

Switch eMMC device into sleep mode.

Parameters
[in]card
Returns

◆ emmc_erase_blocks()

hpm_stat_t emmc_erase_blocks ( emmc_card_t card,
uint32_t  start_block,
uint32_t  block_count,
emmc_erase_option_t  option 
)

Erase eMMC Blocks.

Parameters
[in]card
[in]start_block
[in]block_count
[in]erase_option
Returns

◆ emmc_exit_sleep_mode()

hpm_stat_t emmc_exit_sleep_mode ( emmc_card_t card)

Switch eMMC device into standby mode.

Parameters
[in]card
Returns

◆ emmc_go_idle()

hpm_stat_t emmc_go_idle ( emmc_card_t card,
emmc_idle_option_t  option 
)

Go to Idle mode.

Parameters
card
option
Returns

◆ emmc_init()

hpm_stat_t emmc_init ( emmc_card_t card)

Intialize eMMC device, include both host and the device.

Parameters
card
Returns

◆ emmc_probe_device()

hpm_stat_t emmc_probe_device ( emmc_card_t card)

Probe eMMC device.

Parameters
card
Returns

◆ emmc_program_csd()

hpm_stat_t emmc_program_csd ( emmc_card_t card,
const uint32_t *  raw_csd 
)

Program CSD register.

Parameters
card
raw_csd
Returns

◆ emmc_read_blocks()

hpm_stat_t emmc_read_blocks ( emmc_card_t card,
uint8_t *  buffer,
uint32_t  start_block,
uint32_t  block_count 
)

Read eMMC blocks.

Parameters
card
buffer
start_block
block_count
Returns

◆ emmc_select_card()

hpm_stat_t emmc_select_card ( emmc_card_t card,
bool  is_selected 
)

Select eMMC device.

Parameters
card
is_selected
Returns

◆ emmc_send_cid()

hpm_stat_t emmc_send_cid ( emmc_card_t card)

Request eMMC device to send CID to Host.

Parameters
card
Returns

◆ emmc_switch_function()

hpm_stat_t emmc_switch_function ( emmc_card_t card,
emmc_switch_cmd_arg_t  arg,
uint32_t  timeout_us 
)

Switch eMMC function.

Parameters
card
arg
timeout_us
Returns

◆ emmc_write_blocks()

hpm_stat_t emmc_write_blocks ( emmc_card_t card,
const uint8_t *  buffer,
uint32_t  start_block,
uint32_t  block_count 
)

Write eMMC blocks.

Parameters
card
buffer
start_block
block_count
Returns