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/v1/mmcsd.h |
MMCSD Driver API/interface file. | |
Data Structures | |
struct | MMCSD_sysCfg |
Structure holding the hs mmcsd controller system configurations. More... | |
struct | MMCSD_cmd |
Structure for MMCSD command. More... | |
struct | MMCSD_cmdObj |
Structure holding the hs mmcsd controller command object. More... | |
struct | MMCSD_ioDelayParams |
struct | MMCSD_Params |
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 |
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... | |
Typedefs | |
typedef void * | MMCSD_Handle |
typedef int32_t(* | MMCSD_iodelayFxn) (uint32_t instanceNum, MMCSD_ioDelayParams *iodelayParams) |
Return status of MMCSD. More... | |
typedef int32_t(* | MMCSD_switchVoltage) (uint32_t controllerNum, MMCSD_BusVoltage voltage) |
A function pointer to set the voltage of the MMC I/O Cells and PBAIS to the desired voltage. More... | |
typedef uint32_t(* | MMCSD_inputClockControl) (uint32_t instNum, uint32_t *clkFreq, MMCSD_inputClkCtrlMode_e) |
A function pointer to read/configure the input clock to the MMC controller. More... | |
Enumerations | |
enum | MMCSD_resetLineMask { MMCSD_RESET_LINE_MASK_DATA = CSL_MMC_SYSCTL_SRD_MASK, MMCSD_RESET_LINE_MASK_CMD = CSL_MMC_SYSCTL_SRC_MASK, MMCSD_RESET_LINE_MASK_ALL = CSL_MMC_SYSCTL_SRA_MASK } |
MMCSD instance attributes - used during init time. More... | |
enum | MMCSD_clkAct { MMCSD_CLK_ACT_ICLK_FCLK_OFF = CSL_MMC_SYSCONFIG_CLOCKACTIVITY_NONE, MMCSD_CLK_ACT_FCLK_OFF = CSL_MMC_SYSCONFIG_CLOCKACTIVITY_FUNC, MMCSD_CLK_ACT_ICLK_OFF = CSL_MMC_SYSCONFIG_CLOCKACTIVITY_OCP, MMCSD_CLK_ACT_ICLK_FLCK_ON = CSL_MMC_SYSCONFIG_CLOCKACTIVITY_BOTH } |
Enumerates the clock activity configurations during wake up . More... | |
enum | MMCSD_standbyMode { MMCSD_STANDBY_MODE_FORCE = CSL_MMC_SYSCONFIG_STANDBYMODE_FORCE, MMCSD_STANDBY_MODE_NONE = CSL_MMC_SYSCONFIG_STANDBYMODE_NOIDLE, MMCSD_STANDBY_MODE_SMART = CSL_MMC_SYSCONFIG_STANDBYMODE_SMART, MMCSD_STANDBY_MODE_SMART_WAKEUP } |
Enumerates the standby modes. More... | |
enum | MMCSD_pwrCtrl { MMCSD_PWR_CTRL_ON = CSL_MMC_HCTL_SDBP_PWRON, MMCSD_PWR_CTRL_OFF = CSL_MMC_HCTL_SDBP_PWROFF } |
Enumerates macros to configure power on/off. More... | |
enum | MMCSD_suppVolt { MMCSD_SUPP_VOLT_1P8 = CSL_MMC_CAPA_VS18_MASK, MMCSD_SUPP_VOLT_3P0 = CSL_MMC_CAPA_VS30_MASK, MMCSD_SUPP_VOLT_3P3 = CSL_MMC_CAPA_VS33_MASK } |
Enumerates the list of supported bus voltages. More... | |
enum | MMCSD_cmdType { MMCSD_CMD_TYPE_OTHER = CSL_MMC_CMD_CMD_TYPE_NORMAL, MMCSD_CMD_TYPE_BUS_SUSPEND = CSL_MMC_CMD_CMD_TYPE_SUSPEND, MMCSD_CMD_TYPE_FUNC_SEL = CSL_MMC_CMD_CMD_TYPE_RESUME, MMCSD_CMD_TYPE_IO_ABORT = CSL_MMC_CMD_CMD_TYPE_ABORT } |
Enumerates the list of command types. More... | |
enum | MMCSD_rspType { MMCSD_RSP_TYPE_NONE = CSL_MMC_CMD_RSP_TYPE_NORSP, MMCSD_RSP_TYPE_LEN_136 = CSL_MMC_CMD_RSP_TYPE_LGHT36, MMCSD_RSP_TYPE_LEN_48 = CSL_MMC_CMD_RSP_TYPE_LGHT48, MMCSD_RSP_TYPE_LEN_48_BUSY = CSL_MMC_CMD_RSP_TYPE_LGHT48B } |
Enumerates the list of response types. More... | |
enum | MMCSD_xFerType { MMCSD_XFER_TYPE_TX = CSL_MMC_CMD_DDIR_WRITE, MMCSD_XFER_TYPE_RX = CSL_MMC_CMD_DDIR_READ } |
Enumerates the list of response types. More... | |
enum | MMCSD_intrMask { MMCSD_INTR_MASK_BADACCESS = CSL_MMC_IE_BADA_ENABLE_MASK, MMCSD_INTR_MASK_CARDERROR = CSL_MMC_IE_CERR_ENABLE_MASK, MMCSD_INTR_MASK_ADMAERROR = CSL_MMC_IE_ADMAE_ENABLE_MASK, MMCSD_INTR_MASK_ACMD12ERR = CSL_MMC_IE_ACE_ENABLE_MASK, MMCSD_INTR_MASK_DATABITERR = CSL_MMC_IE_DEB_ENABLE_MASK, MMCSD_INTR_MASK_DATACRCERR = CSL_MMC_IE_DCRC_ENABLE_MASK, MMCSD_INTR_MASK_DATATIMEOUT = CSL_MMC_IE_DTO_ENABLE_MASK, MMCSD_INTR_MASK_CMDINDXERR = CSL_MMC_IE_CIE_ENABLE_MASK, MMCSD_INTR_MASK_CMDBITERR = CSL_MMC_IE_CEB_ENABLE_MASK, MMCSD_INTR_MASK_CMDCRCERR = CSL_MMC_IE_CCRC_ENABLE_MASK, MMCSD_INTR_MASK_CMDTIMEOUT = CSL_MMC_IE_CTO_ENABLE_MASK, MMCSD_INTR_MASK_ERR = CSL_MMC_IE_NULL_MASK, MMCSD_INTR_MASK_CARDREM = CSL_MMC_IE_CREM_ENABLE_MASK, MMCSD_INTR_MASK_CARDINS = CSL_MMC_IE_CINS_ENABLE_MASK, MMCSD_INTR_MASK_BUFRDRDY = CSL_MMC_IE_BRR_ENABLE_MASK, MMCSD_INTR_MASK_BUFWRRDY = CSL_MMC_IE_BWR_ENABLE_MASK, MMCSD_INTR_MASK_TRNFCOMP = CSL_MMC_IE_TC_ENABLE_MASK, MMCSD_INTR_MASK_CMDCOMP = CSL_MMC_IE_CC_ENABLE_MASK } |
Enumerates the controller's interrupt masks. More... | |
enum | MMCSD_idleMode { MMCSD_IDLE_MODE_FORCE = CSL_MMC_SYSCONFIG_SIDLEMODE_FORCE, MMCSD_IDLE_MODE_NONE = CSL_MMC_SYSCONFIG_SIDLEMODE_NOIDLE, MMCSD_IDLE_MODE_SMART = CSL_MMC_SYSCONFIG_SIDLEMODE_SMART } |
Enumerates the idle modes. More... | |
enum | MMCSD_busVolt { MMCSD_BUS_VOLT_1P8 = CSL_MMC_HCTL_SDVS__1V8, MMCSD_BUS_VOLT_3P0 = CSL_MMC_HCTL_SDVS__3V0, MMCSD_BUS_VOLT_3P3 = CSL_MMC_HCTL_SDVS__3V3 } |
Enumerates mmc sd controller's bus voltages. More... | |
enum | MMCSD_BusVoltage { MMCSD_BUS_VOLTAGE_1_8V = 0x1U, MMCSD_BUS_VOLTAGE_3_0V = 0x2U, MMCSD_BUS_VOLTAGE_3_3V = 0x4U } |
enum | MMCSD_inputClkCtrlMode_e { MMCSD_INPUT_CLOCK_CTRL_GET, MMCSD_INPUT_CLOCK_CTRL_SET } |
ENUMs to read/configure the input clock to the MMC controller. More... | |
Macros | |
#define | MMCSD_CARD_SD (0U) |
Determines the type of card is SD. More... | |
#define | MMCSD_CARD_MMC (1U) |
Determines the type of card is MMC. More... | |
#define | MMCSD_CARD_EMMC (2U) |
Determines the type of card is MMC. More... | |
#define | MMCSD_CARD_TYPE_NO_DEVICE (3U) |
#define | MMCSD_CMD_SETBUSWIDTH (MMCSD_CMD_RESERVED + 0U) |
Set bus width of MMCSD. More... | |
#define | MMCSD_CMD_SETFREQUENCY (MMCSD_CMD_RESERVED + 1U) |
Set bus frequency of MMCSD. More... | |
#define | MMCSD_CMD_GETBUSWIDTH (MMCSD_CMD_RESERVED + 2U) |
Get bus width of MMCSD. More... | |
#define | MMCSD_CMD_GETFREQUENCY (MMCSD_CMD_RESERVED + 3U) |
Get bus frequency of MMCSD. More... | |
#define | MMCSD_CMD_GETMEDIAPARAMS (MMCSD_CMD_RESERVED + 4U) |
Get media (SD/eMMC/MMC) parameters. More... | |
#define | MMCSD_INVALID_MUXNUM (-1) |
Invalid Mux num. More... | |
#define | MMCSD_INVALID_MUX_EVENTNUM (-1) |
Invalid Mux In/Out event num. More... | |
#define | MMCSD_BUS_WIDTH_1BIT (1U) |
Card bus width configuration for 1-bit mode. More... | |
#define | MMCSD_BUS_WIDTH_4BIT (4U) |
Card bus width configuration for 4-bit mode. More... | |
#define | MMCSD_BUS_WIDTH_8BIT (8U) |
Card bus width configuration for 8-bit mode. More... | |
#define | MMCSD_TRANSPEED_25MBPS (0x32U) |
Card bus frequency configuration for 25 Mbps. More... | |
#define | MMCSD_TRANSPEED_50MBPS (0x5AU) |
Card bus frequency configuration for 50 Mbps. More... | |
#define | MMCSD_TRANSPEED_DEFAULT (0x32U) |
Card bus frequency configuration for 25 Mbps. More... | |
#define | MMCSD_TRANSPEED_HS (0x5AU) |
Card bus frequency configuration for 50 Mbps. More... | |
#define | MMCSD_TRANSPEED_SDR12 (0x32U) |
Card bus frequency configuration for 25 Mbps. More... | |
#define | MMCSD_TRANSPEED_SDR25 (0x5AU) |
Card bus frequency configuration for 50 Mbps. More... | |
#define | MMCSD_TRANSPEED_SDR50 (0xBU) |
Card bus frequency configuration for 100 Mbps. More... | |
#define | MMCSD_TRANSPEED_SDR104 (0x2BU) |
Card bus frequency configuration for 200 Mbps. More... | |
#define | MMCSD_TRANSPEED_DDR50 (0x3BU) |
Card bus frequency configuration for 100 Mbps. More... | |
#define | MMCSD_TRANSPEED_HS200 (0x2BU) |
Card bus frequency configuration for 200 Mbps. More... | |
#define | MMCSD_LOOPBACK_ANY (0x0U) |
MMC any loop back. More... | |
#define | MMCSD_LOOPBACK_INTERNAL (0x1U) |
MMC internal loop back. More... | |
#define | MMCSD_LOOPBACK_PAD (0x2U) |
MMC pad loop back. More... | |
#define | MMCSD_VOLTAGE_ANY (0x0U) |
MMC any operating voltage. More... | |
#define MMCSD_CARD_SD (0U) |
Determines the type of card is SD.
#define MMCSD_CARD_MMC (1U) |
Determines the type of card is MMC.
#define MMCSD_CARD_EMMC (2U) |
Determines the type of card is MMC.
#define MMCSD_CARD_TYPE_NO_DEVICE (3U) |
#define MMCSD_CMD_SETBUSWIDTH (MMCSD_CMD_RESERVED + 0U) |
Set bus width of MMCSD.
#define MMCSD_CMD_SETFREQUENCY (MMCSD_CMD_RESERVED + 1U) |
Set bus frequency of MMCSD.
#define MMCSD_CMD_GETBUSWIDTH (MMCSD_CMD_RESERVED + 2U) |
Get bus width of MMCSD.
#define MMCSD_CMD_GETFREQUENCY (MMCSD_CMD_RESERVED + 3U) |
Get bus frequency of MMCSD.
#define MMCSD_CMD_GETMEDIAPARAMS (MMCSD_CMD_RESERVED + 4U) |
Get media (SD/eMMC/MMC) parameters.
#define MMCSD_INVALID_MUXNUM (-1) |
Invalid Mux num.
#define MMCSD_INVALID_MUX_EVENTNUM (-1) |
Invalid Mux In/Out event num.
#define MMCSD_BUS_WIDTH_1BIT (1U) |
Card bus width configuration for 1-bit mode.
#define MMCSD_BUS_WIDTH_4BIT (4U) |
Card bus width configuration for 4-bit mode.
#define MMCSD_BUS_WIDTH_8BIT (8U) |
Card bus width configuration for 8-bit mode.
#define MMCSD_TRANSPEED_25MBPS (0x32U) |
Card bus frequency configuration for 25 Mbps.
#define MMCSD_TRANSPEED_50MBPS (0x5AU) |
Card bus frequency configuration for 50 Mbps.
#define MMCSD_TRANSPEED_DEFAULT (0x32U) |
Card bus frequency configuration for 25 Mbps.
#define MMCSD_TRANSPEED_HS (0x5AU) |
Card bus frequency configuration for 50 Mbps.
#define MMCSD_TRANSPEED_SDR12 (0x32U) |
Card bus frequency configuration for 25 Mbps.
#define MMCSD_TRANSPEED_SDR25 (0x5AU) |
Card bus frequency configuration for 50 Mbps.
#define MMCSD_TRANSPEED_SDR50 (0xBU) |
Card bus frequency configuration for 100 Mbps.
#define MMCSD_TRANSPEED_SDR104 (0x2BU) |
Card bus frequency configuration for 200 Mbps.
#define MMCSD_TRANSPEED_DDR50 (0x3BU) |
Card bus frequency configuration for 100 Mbps.
#define MMCSD_TRANSPEED_HS200 (0x2BU) |
Card bus frequency configuration for 200 Mbps.
#define MMCSD_LOOPBACK_ANY (0x0U) |
MMC any loop back.
#define MMCSD_LOOPBACK_INTERNAL (0x1U) |
MMC internal loop back.
#define MMCSD_LOOPBACK_PAD (0x2U) |
MMC pad loop back.
#define MMCSD_VOLTAGE_ANY (0x0U) |
MMC any operating voltage.
typedef void* MMCSD_Handle |
typedef int32_t(* MMCSD_iodelayFxn) (uint32_t instanceNum, MMCSD_ioDelayParams *iodelayParams) |
Return status of MMCSD.
typedef int32_t(* MMCSD_switchVoltage) (uint32_t controllerNum, MMCSD_BusVoltage voltage) |
A function pointer to set the voltage of the MMC I/O Cells and PBAIS to the desired voltage.
typedef uint32_t(* MMCSD_inputClockControl) (uint32_t instNum, uint32_t *clkFreq, MMCSD_inputClkCtrlMode_e) |
A function pointer to read/configure the input clock to the MMC controller.
enum MMCSD_resetLineMask |
enum MMCSD_clkAct |
Enumerates the clock activity configurations during wake up .
enum MMCSD_standbyMode |
enum MMCSD_pwrCtrl |
enum MMCSD_suppVolt |
enum MMCSD_cmdType |
enum MMCSD_rspType |
enum MMCSD_xFerType |
enum MMCSD_intrMask |
Enumerates the controller's interrupt masks.
enum MMCSD_idleMode |
enum MMCSD_busVolt |
enum MMCSD_BusVoltage |
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() |
|
extern |
Externally defined driver configuration array.
|
extern |
Externally defined driver configuration array size.