AM64x MCU+ SDK  10.00.00
mmcsd/v0/mmcsd.h File Reference

Introduction

MMCSD Driver API/interface file.

Go to the source code of this file.

Data Structures

struct  MMCSD_Params
 MMCSD instance attributes - used during init time. More...
 
struct  MMCSD_EmmcDeviceData
 eMMC device properties More...
 
struct  MMCSD_SdDeviceData
 SD device properties. More...
 
struct  MMCSD_Transaction
 MMCSD transaction. More...
 
struct  MMCSD_Attrs
 MMCSD instance attributes - used during init time. More...
 
struct  MMCSD_Object
 MMCSD driver object. More...
 
struct  MMCSD_Config
 

Macros

#define MMCSD_CARD_TYPE_SD   (0U)
 
#define MMCSD_CARD_TYPE_EMMC   (1U)
 
#define MMCSD_CARD_TYPE_MMC   (2U)
 
#define MMCSD_CARD_TYPE_NO_DEVICE   (3U)
 
#define MMCSD_BUS_WIDTH_4BIT   (0x4U)
 
#define MMCSD_BUS_WIDTH_8BIT   (0x8U)
 
#define MMCSD_BUS_WIDTH_1BIT   (0x1U)
 
#define MMCSD_TRANSPEED_25MBPS   (0x32U)
 
#define MMCSD_TRANSPEED_50MBPS   (0x5AU)
 
#define MMCSD_TRANSPEED_DEFAULT   (0x32U)
 
#define MMCSD_TRANSPEED_HS   (0x5AU)
 
#define MMCSD_TRANSPEED_SDR12   (0x32U)
 
#define MMCSD_TRANSPEED_SDR25   (0x5AU)
 
#define MMCSD_TRANSPEED_SDR50   (0xBU)
 
#define MMCSD_TRANSPEED_SDR104   (0x2BU)
 
#define MMCSD_TRANSPEED_DDR50   (0x3BU)
 
#define MMCSD_TRANSPEED_HS200   (0x2BU)
 
#define MMCSD_TRANSPEED_HS400   (0x4BU)
 
#define MMCSD_BUS_VOLT_1_8V   (0x5U) /* Embedded */
 
#define MMCSD_BUS_VOLT_3_0V   (0x6U) /* Typical */
 
#define MMCSD_BUS_VOLT_3_3V   (0x7U) /* Flattop */
 
#define MMCSD_CMD_TYPE_NORMAL   (0U)
 
#define MMCSD_CMD_TYPE_BUS_SUSPEND   (1U)
 
#define MMCSD_CMD_TYPE_FUNC_SEL   (2U)
 
#define MMCSD_CMD_TYPE_IO_ABORT   (3U)
 
#define MMCSD_CMD_RSP_TYPE_NORSP   (0U)
 
#define MMCSD_CMD_RSP_TYPE_L136   (1U)
 
#define MMCSD_CMD_RSP_TYPE_L48   (2U)
 
#define MMCSD_CMD_RSP_TYPE_L48_BUSY   (3U)
 
#define MMCSD_CMD_XFER_TYPE_WRITE   (0U)
 
#define MMCSD_CMD_XFER_TYPE_READ   (1U)
 
#define MMCSD_SUPPORT_MMC_DS   (0x01U) /* DS (Up to 26Mhz) */
 
#define MMCSD_SUPPORT_MMC_HS_SDR   (0x02U) /* HS (Up to 52Mhz) */
 
#define MMCSD_SUPPORT_MMC_HS_DDR   (0x04U) /* HS (Up to 52Mhz) */
 
#define MMCSD_SUPPORT_MMC_HS200   (0x08U) /* HS200 (Up to 200Mhz) */
 
#define MMCSD_SUPPORT_MMC_HS400   (0x10U) /* HS400 (Up to 400Mhz) */
 
#define MMCSD_SUPPORT_MMC_HS400_ES   (0x20U) /* HS400 Enhanced Strobe (Up to 400Mhz) */
 
#define MMCSD_SUPPORT_MMC_ALL   (0xFFU) /* All modes */
 
#define MMCSD_SUPPORT_SD_DS   (0x01U)
 
#define MMCSD_SUPPORT_SD_HS   (0x02U)
 
#define MMCSD_SUPPORT_SD_SDR50   (0x04U)
 
#define MMCSD_SUPPORT_SD_SDR104   (0x08U)
 
#define MMCSD_SUPPORT_SD_DDR50   (0x10U)
 
#define MMCSD_SUPPORT_SD_ALL   (0xFFU) /* All modes */
 
#define MMCSD_PHY_TYPE_HW_PHY   (0U)
 
#define MMCSD_PHY_TYPE_SW_PHY   (1U)
 
#define MMCSD_PHY_TYPE_NO_PHY   (2U)
 
#define MMCSD_PHY_TUNING_TYPE_AUTO   (0U)
 
#define MMCSD_PHY_TUNING_TYPE_MANUAL   (1U)
 
#define MMCSD_PHY_MODE_HS400   (1U)
 
#define MMCSD_PHY_MODE_HS200   (2U)
 
#define MMCSD_PHY_MODE_HSSDR50   (3U)
 
#define MMCSD_PHY_MODE_HSDDR50   (4U)
 
#define MMCSD_PHY_MODE_ENHANCED_STROBE   (5U)
 
#define MMCSD_PHY_MODE_SDR104   (6U)
 
#define MMCSD_PHY_MODE_SDR50   (7U)
 
#define MMCSD_PHY_MODE_DDR50   (8U)
 
#define MMCSD_PHY_MODE_SDR25   (9U)
 
#define MMCSD_PHY_MODE_SDR12   (10U)
 
#define MMCSD_PHY_MODE_HS   (11U)
 
#define MMCSD_PHY_MODE_DS   (12U)
 
#define MMCSD_UHS_MODE_SDR12   (0U)
 
#define MMCSD_UHS_MODE_SDR25   (1U)
 
#define MMCSD_UHS_MODE_SDR50   (2U)
 
#define MMCSD_UHS_MODE_SDR104   (3U)
 
#define MMCSD_UHS_MODE_DDR50   (4U)
 
#define MMCSD_UHS_MODE_HS400   (5U)
 
#define MMCSD_UHS_MODE_UHS2   (7U)
 

Typedefs

typedef void * MMCSD_Handle
 

Functions

void MMCSD_init (void)
 This function initializes the MMCSD module. More...
 
void MMCSD_deinit (void)
 This function de-initializes the MMCSD module. More...
 
void MMCSD_Params_init (MMCSD_Params *mmcsdParams)
 Initialize data structure with defaults. More...
 
MMCSD_Handle MMCSD_open (uint32_t index, const MMCSD_Params *openParams)
 This function opens a given MMCSD peripheral. More...
 
void MMCSD_close (MMCSD_Handle handle)
 Function to close a MMCSD peripheral specified by the MMCSD handle. More...
 
MMCSD_Handle MMCSD_getHandle (uint32_t index)
 This function returns the handle of an open MMCSD Instance from the instance index. More...
 
int32_t MMCSD_read (MMCSD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks)
 Function to perform block reads from the MMC/SD media. More...
 
int32_t MMCSD_write (MMCSD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks)
 Function to perform block writes to the MMC/SD media. More...
 
uint32_t MMCSD_getBlockSize (MMCSD_Handle handle)
 This function returns the block size of the MMC/SD media connected to the MMCSD controller. More...
 
uint32_t MMCSD_getBlockCount (MMCSD_Handle handle)
 This function returns the block count of User Data Area of the MMC/SD media connected to the MMCSD controller. More...
 
uint32_t MMCSD_isHC (MMCSD_Handle handle)
 This function returns if the media connected is High Capacity (> 2GB in size) or not. More...
 
int32_t MMCSD_enableBootPartition (MMCSD_Handle handle, uint32_t partitionNum)
 This function enables the boot partition if the connected media is eMMC. More...
 
int32_t MMCSD_disableBootPartition (MMCSD_Handle handle)
 This function disables the boot partition if the connected media is eMMC. More...
 

Variables

MMCSD_Config gMmcsdConfig []
 Externally defined driver configuration array. More...
 
uint32_t gMmcsdConfigNum
 Externally defined driver configuration array size. More...