This module contains APIs to program and use the MMCSD module. The APIs can be used by other drivers to get access to MMCSD and also by application to initiate data transfer operation.
Files | |
file | mmcsd/v0/mmcsd.h |
MMCSD Driver API/interface 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 |
struct | MMCSD_TuningPassOrFailWindow |
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... | |
uint32_t | MMCSD_getInputClk (MMCSD_Handle handle) |
This function returns the input clk frequency MMCSD was programmed at. More... | |
Typedefs | |
typedef void * | MMCSD_Handle |
#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_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_SDR104 (5U) |
#define MMCSD_PHY_MODE_SDR50 (6U) |
#define MMCSD_PHY_MODE_DDR50 (7U) |
#define MMCSD_PHY_MODE_SDR25 (8U) |
#define MMCSD_PHY_MODE_SDR12 (9U) |
#define MMCSD_PHY_MODE_HS (10U) |
#define MMCSD_PHY_MODE_DS (11U) |
#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) |
typedef void* MMCSD_Handle |
void MMCSD_init | ( | void | ) |
This function initializes the MMCSD module.
void MMCSD_deinit | ( | void | ) |
This function de-initializes the MMCSD module.
void MMCSD_Params_init | ( | MMCSD_Params * | mmcsdParams | ) |
Initialize data structure with defaults.
mmcsdParams | [out] Initialized parameters |
MMCSD_Handle MMCSD_open | ( | uint32_t | index, |
const MMCSD_Params * | openParams | ||
) |
This function opens a given MMCSD peripheral.
index | Index of config to use in the MMCSD_Config array |
openParams | Pointer to parameters to open the driver with |
void MMCSD_close | ( | MMCSD_Handle | handle | ) |
Function to close a MMCSD peripheral specified by the MMCSD handle.
handle | MMCSD_Handle returned from MMCSD_open() |
MMCSD_Handle MMCSD_getHandle | ( | uint32_t | index | ) |
This function returns the handle of an open MMCSD Instance from the instance index.
index | Index of config to use in the MMCSD_Config array |
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.
handle | MMCSD_Handle returned from MMCSD_open() |
buf | Pointer to a buffer to which the data is to be read into |
startBlk | Block to start reading data from |
numBlks | Number of blocks to read |
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.
handle | MMCSD_Handle returned from MMCSD_open() |
buf | Pointer to a buffer to which the data is to be read into |
startBlk | Block to start reading data from |
numBlks | Number of blocks to read |
uint32_t MMCSD_getBlockSize | ( | MMCSD_Handle | handle | ) |
This function returns the block size of the MMC/SD media connected to the MMCSD controller.
handle | MMCSD_Handle returned from MMCSD_open() |
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.
handle | MMCSD_Handle returned from MMCSD_open() |
uint32_t MMCSD_isHC | ( | MMCSD_Handle | handle | ) |
This function returns if the media connected is High Capacity (> 2GB in size) or not.
handle | MMCSD_Handle returned from MMCSD_open() |
int32_t MMCSD_enableBootPartition | ( | MMCSD_Handle | handle, |
uint32_t | partitionNum | ||
) |
This function enables the boot partition if the connected media is eMMC.
handle | MMCSD_Handle returned from MMCSD_open() |
partitionNum | Boot partition to be enabled. |
int32_t MMCSD_disableBootPartition | ( | MMCSD_Handle | handle | ) |
This function disables the boot partition if the connected media is eMMC.
handle | MMCSD_Handle returned from MMCSD_open() |
uint32_t MMCSD_getInputClk | ( | MMCSD_Handle | handle | ) |
This function returns the input clk frequency MMCSD was programmed at.
handle | An MMCSD_Handle returned from an MMCSD_open() |
|
extern |
Externally defined driver configuration array.
|
extern |
Externally defined driver configuration array size.