- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Data Structures | Defines | Typedefs | Enumerations | Functions
csl_mmcsd.h File Reference

Functional layer API header file for MMC/SD CSL. More...

`#include <soc.h>`
`#include <csl_types.h>`
`#include <csl_error.h>`
`#include <csl_dma.h>`
`#include <tistdtypes.h>`

Go to the source code of this file.

## Data Structures
struct | CSL_MmcsdCmd
| Command structure for the card. More...
struct | CSL_MmcsdResponse
| Response array received from the controller. More...
struct | CSL_MMCSetupNative
| Structure to store the some default configuration for MMCSD controller. More...
struct | CSL_MMCConfig
| MMC config structure for setting MMC/SD Control register. More...
struct | CSL_MMCSDCidStruct
| Structure to store the CID Information for MMC and SD card. More...
struct | CSL_MMCCardIdObj
| Card identification object. More...
struct | CSL_MMCSDCsdStruct
| Structure to store the CSD Information for MMC and SD card. More...
struct | CSL_MMCCardCsdObj
| CSD Information for MMC and SD card. More...
struct | CSL_MMCCardXCsdObj
| structure for extra feature of MMC and SD Object. More...
struct | CSL_MMCCardObj
| structure for card specific information. More...
struct | CSL_MMCCallBackObj
| structure array of isr function for MMCSD. More...
struct | CSL_MmcsdDmaConfig
| DMA configuration structure for MMCSD module. More...
struct | CSL_MMCControllerObj
| structure for card specific information. More...
## Defines
#define | CSL_MMCSD_STUFF_BITS (0x0000)
#define | CSL_SD_HC_ECHO_PATTERN (0xAAu)
#define | CSL_SD_HC_VHS_ECHO (0x100u)
#define | CSL_MMCSD_SHIFT_MAX (16)
#define | CSL_MMCSD_MASK_MAX (0xFFFF)
#define | CSL_MMCSD_ACTIVE (0x0)
#define | CSL_MMCSD_RESET (0x1u)
#define | CSL_MMCSD_RESET_COUNT (0x20u)
#define | CSL_MMCSD_ENABLE (0x1u)
#define | CSL_MMCSD_DISABLE (0x0)
#define | CSL_MMCSD_ISR_TXMT (0x0)
#define | CSL_MMCSD_ISR_RCV (0x1)
#define | CSL_MMCSD_DELAY_TIME (100U)
#define | CSL_MMCSD_RESPONSE_TIMEOUT (0xFFFF)
#define | CSL_MMCSD_DATA_RW_TIMEOUT (0xFFFF)
#define | CSL_MMCSD_CLK_DIV_INIT (124)
#define | CSL_MMCSD_BUSY_STATE (0x01)
#define | CSL_MMCSD_FIFO_EMPTY (0x20)
#define | CSL_MMCSD_CMDDAT_RESET (0x03)
#define | CSL_SD_CARD_DETECTED (0x0120)
#define | CSL_MMC_CARD_DETECTED (0x8000)
#define | CSL_MMCSD_RESP_DONE (0x04)
#define | CSL_MMCSD_BLOCK_LENGTH (512u)
#define | CSL_MMCSD_BLOCK_LEN_MAX (0x0FFFu)
#define | CSL_MMCSD_READ_READY (0x0400)
#define | CSL_MMCSD_WRITE_READY (0x0200)
#define | CSL_MMCSD_DISPATCH_TABLE_SIZE (12U)
#define | CSL_MMCSD_NULL (0)
#define | CSL_MMCSD_RESP_COUNT (8)
#define | CSL_MMC_MAX_CLOCK_RATE (0xFFu)
#define | CSL_MMC_CMD8_ARG (0x1AAu)
#define | CSL_MMC_CMD1_ARG (0x00ff8000u)
#define | CSL_MMC_ACMD41_ARG_HCS (0x40ff8000u)
#define | CSL_MMC_ACMD41_ARG_NOHCS (0x00ff8000u)
#define | CSL_MMC_BUSWIDTH_4BIT (0x00000002u)
#define | CSL_MMC_BUSWIDTH_1BIT (0x00000001u)
#define | CSL_MMSCD_ACMD41_RETRY_COUNT (1000u)
#define | CSL_MMSCD_CMD1_RETRY_COUNT (1000u)
#define | CSL_MMSCD_READ_WRITE_RETRY_COUNT (1000u)
#define | CSL_MMCSD_WRITE_INIT_CMD (0x0210)
#define | CSL_MMCSD_WRITE_BLOCK_CMD (0x2A18)
#define | CSL_MMCSD_READ_BLOCK_CMD (0xA211)
#define | CSL_MMCSD_WRITE_MULTIPLE_BLOCK_CMD (0x2A19u)
#define | CSL_MMCSD_READ_MULTIPLE_BLOCK_CMD (0xA212)
#define | CSL_MMCSD_ALL_SEND_CID_CMD (0x0402)
#define | CSL_MMCSD_CARD_INIT0_CMD (0x4000)
#define | CSL_MMCSD_SDHC_CARD_INIT_CMD (0x0208)
#define | CSL_MMCSD_SD_CARD_INIT_CMD (0x0237)
#define | CSL_MMCSD_MMCS_CARD_INIT_CMD (0x0601)
#define | CSL_MMCSD_SET_BLKLEN_CMD (0x0210)
#define | CSL_MMCSD_STOP_CMD (0x038C)
#define | CSL_MMCSD_CMD_0 (0x0000)
#define | CSL_MMCSD_CMD_1 (0x0601)
#define | CSL_MMCSD_CMD_2 (0x0402)
#define | CSL_MMCSD_CMD_3 (0x0203)
#define | CSL_MMCSD_CMD_6 (0x0206)
#define | CSL_MMCSD_CMD_7 (0x0307)
#define | CSL_MMCSD_CMD_8 (0x0208)
#define | CSL_MMCSD_CMD_9 (0x0409)
#define | CSL_MMCSD_CMD_13 (0x020D)
#define | CSL_MMCSD_ACMD_23 (0x0217)
#define | CSL_MMCSD_CMD_41 (0x0629)
#define | CSL_MMCSD_ACMD_42 (0x022A)
#define | CSL_MMCSD_CMD_55 (0x0237)
#define | CSL_MMCSD_CMD41_RESP (0x80FF8000u)
#define | CSL_MMCSD_CMD1_RESP (0x80FF8000u)
#define | CSL_MMCSD_SDHC_RESP (0x40000000u)
#define | CSL_MMCSD_CARDCHECK_COUNT (3u)
#define | CSL_MMCSD_EVENT_ERROR
| Error type as received by the MMC on response for a command.
#define | CSL_MMCSD_CMD_TOUT_CRC_ERROR
| Error type for command response timeout and CRC error.
#define | CSL_MMCSD_DATA_TOUT_CRC_ERROR
| Error type for data timeout and CRC error.
## Typedefs
typedef void(* | CSL_MMCCallBackPtr )(void)
| call back function for MMCSD.
typedef void(* | CSL_MMCDataTxferCallBackPtr )(void *mmcsdHandle)
| Data transfer call back function pointer.
typedef CSL_MMCControllerObj * | CSL_MmcsdHandle
| MMCSD Handle.
## Enumerations
enum | CSL_MmcsdInstId { CSL_MMCSD0_INST = (0U), CSL_MMCSD1_INST = (1U), CSL_MMCSD_INST_INV = (2U) }
| Hardware Instance Id to select the MMCSD IO registers. More...
enum | CSL_MmcsdRespType { CSL_MMCSD_RESPTYPE_NO = 0, CSL_MMCSD_RESPTYPE_R1 = 1U, CSL_MMCSD_RESPTYPE_R2 = 2U, CSL_MMCSD_RESPTYPE_R3 = 3U, CSL_MMCSD_RESPTYPE_R4 = 4U, CSL_MMCSD_RESPTYPE_R5 = 5U, CSL_MMCSD_RESPTYPE_R6 = 6U }
| Response type from MMCSD. More...
enum | CSL_MmcsdRespBusy { CSL_MMCSD_RESPBUSY_NO = 0, CSL_MMCSD_RESPBUSY_YES = 1U }
| Response busy signal from the card. More...
enum | CSL_MmcsdLineChr { CSL_MMCSD_LINECHR_PUSHPULL = 0, CSL_MMCSD_LINECHR_OPENDRAIN = 1U }
| Hardware mode of operation of the device. More...
enum | CSL_MmcsdCmdType { CSL_MMCSD_CMDTYPE_BC = 0, CSL_MMCSD_CMDTYPE_BCR = 1U, CSL_MMCSD_CMDTYPE_AC = 2U, CSL_MMCSD_CMDTYPE_ADTC = 3U }
| Different command types in MMCSD standard. More...
enum | CSL_MmcsdCmdIndex { CSL_MMCSD_GO_IDLE_STATE = 0, CSL_MMCSD_SEND_OP_COND_MMC_CARD = 1U, CSL_MMCSD_ALL_SEND_CID = 2U, CSL_MMCSD_RELATIVE_ADDR = 3U, CSL_MMCSD_SET_DSR = 4U, CSL_MMCSD_CMD_IDX_RSV_5 = 5U, CSL_MMCSD_CMD_SWITCH_MMC_CARD = 6U, CSL_MMCSD_SELECT_DESELECT_CARD = 7U, CSL_MMCSD_CMD_SEND_IF_COND_EXT_CSD = 8U, CSL_MMCSD_SEND_CSD = 9U, CSL_MMCSD_SEND_CID = 10U, CSL_MMCSD_READ_DAT_UNTIL_STOP_MMC_CARD = 11U, CSL_MMCSD_STOP_TRANSMISSION = 12U, CSL_MMCSD_SEND_STATUS = 13U, CSL_MMCSD_CMD_IDX_RSV_14 = 14U, CSL_MMCSD_GO_INACTIVE_STATE = 15U, CSL_MMCSD_SET_BLOCKLEN = 16U, CSL_MMCSD_READ_SINGLE_BLOCK = 17U, CSL_MMCSD_READ_MULTIPLE_BLOCK = 18U, CSL_MMCSD_CMD_IDX_RSV_19 = 19U, CSL_MMCSD_WRITE_DAT_UNTIL_STOP_MMC_CARD = 20U, CSL_MMCSD_CMD_IDX_RSV_21 = 21U, CSL_MMCSD_CMD_IDX_RSV_22 = 22U, CSL_MMCSD_SET_BLOCK_COUNT_MMC_CARD = 23U, CSL_MMCSD_WRITE_BLOCK = 24U, CSL_MMCSD_WRITE_MULTIPLE_BLOCK = 25U, CSL_MMCSD_PROGRAM_CID_MMC_CARD = 26U, CSL_MMCSD_PROGRAM_CSD = 27U, CSL_MMCSD_SET_WRITE_PROT = 28U, CSL_MMCSD_CLR_WRITE_PROT = 29U, CSL_MMCSD_SEND_WRITE_PROT = 30U, CSL_MMCSD_CMD_IDX_RSV_31 = 31U, CSL_MMCSD_ERASE_WR_BLK_START_SD_CARD = 32U, CSL_MMCSD_ERASE_WR_BLK_END_SD_CARD = 33U, CSL_MMCSD_CMD_IDX_RSV_34 = 34U, CSL_MMCSD_ERASE_GROUP_START_MMC_CARD = 35U, CSL_MMCSD_ERASE_GROUP_END_MMC_CARD = 36U, CSL_MMCSD_CMD_IDX_RSV_37 = 37U, CSL_MMCSD_ERASE = 38U, CSL_MMCSD_FAST_IO_MMC_CARD = 39U, CSL_MMCSD_GO_IRQ_STATE_MMC_CARD = 40U, CSL_MMCSD_CMD_IDX_RSV_41 = 41U, CSL_MMCSD_LOCK_UNLOCK = 42U, CSL_MMCSD_CMD_IDX_RSV_43 = 43U, CSL_MMCSD_CMD_IDX_RSV_44 = 44U, CSL_MMCSD_CMD_IDX_RSV_45 = 45U, CSL_MMCSD_CMD_IDX_RSV_46 = 46U, CSL_MMCSD_CMD_IDX_RSV_47 = 47U, CSL_MMCSD_CMD_IDX_RSV_48 = 48U, CSL_MMCSD_CMD_IDX_RSV_49 = 49U, CSL_MMCSD_CMD_IDX_RSV_50 = 50U, CSL_MMCSD_CMD_IDX_RSV_51 = 51U, CSL_MMCSD_CMD_IDX_RSV_52 = 52U, CSL_MMCSD_CMD_IDX_RSV_53 = 53U, CSL_MMCSD_CMD_IDX_RSV_54 = 54U, CSL_MMCSD_APP_CMD = 55U, CSL_MMCSD_GEN_CMD = 56U, CSL_MMCSD_CMD_IDX_RSV_57 = 57U, CSL_MMCSD_CMD_IDX_RSV_58 = 58U, CSL_MMCSD_CMD_IDX_RSV_59 = 59U, CSL_MMCSD_CMD_IDX_RSV_60 = 60U, CSL_MMCSD_CMD_IDX_RSV_61 = 61U, CSL_MMCSD_CMD_IDX_RSV_62 = 62U, CSL_MMCSD_CMD_IDX_RSV_63 = 63U }
| Command Index for MMC and SD Cards. More...
enum | CSL_MmcsdDir { CSL_MMCSD_DIR_WRITE = 0, CSL_MMCSD_DIR_READ = 1U, CSL_MMCSD_DIR_DONTCARE = 2U }
| Direction of data transfer. More...
enum | CSL_CardType { CSL_CARD_NONE = 0, CSL_SD_CARD = 1U, CSL_MMC_CARD = 2U }
| Type of card that is inserted. More...
enum | CSL_MmcsdEvent { CSL_MMCSD_EVENT_TRNDNE = (1U << 12U), CSL_MMCSD_EVENT_DATED = (1U << 11U), CSL_MMCSD_EVENT_READ = (1U << 10U), CSL_MMCSD_EVENT_WRITE = (1U << 9U), CSL_MMCSD_EVENT_ERROR_CMDCRC = (1U << 7U), CSL_MMCSD_EVENT_ERROR_DATACRC = ((1U << 6U)|(1U << 5U)), CSL_MMCSD_EVENT_ERROR_CMDTIMEOUT = ((1U) << (4U)), CSL_MMCSD_EVENT_ERROR_DATATIMEOUT = ((1U) << (3U)), CSL_MMCSD_EVENT_EOFCMD = (1U << 2U), CSL_MMCSD_EVENT_CARD_EXITBUSY = ((1U) << (1U)), CSL_MMCSD_EVENT_BLOCK_XFERRED = 1U }
| Event responses in MMCSD. More...
enum | CSL_MMCSDEventType { CSL_MMCSD_EDATDNE_INTERRUPT = 1U, CSL_MMCSD_EBSYDNE_INTERRUPT = (1U << 1U), CSL_MMCSD_ERSPDNE_INTERRUPT = (1U << 2U), CSL_MMCSD_ETOUTRD_INTERRUPT = (1U << 3U), CSL_MMCSD_ETOUTRS_INTERRUPT = (1U << 4U), CSL_MMCSD_ECRCWR_INTERRUPT = (1U << 5U), CSL_MMCSD_ECRCRD_INTERRUPT = (1U << 6U), CSL_MMCSD_ECRCRS_INTERRUPT = (1U << 7U), CSL_MMCSD_RSV_BIT = (1U << 8U), CSL_MMCSD_EDXRDY_INTERRUPT = (1U << 9U), CSL_MMCSD_EDRRDY_INTERRUPT = (1U << 10U), CSL_MMCSD_EDATED_INTERRUPT = (1U << 11U), CSL_MMCSD_ETRNDNE_INTERRUPT = (1U << 12U), CSL_MMCSD_INTERRUPT_NONE = (1U << 13U) }
| Enum variable for the selection of mmcsd interrupts. More...
enum | CSL_MMCSDOpMode { CSL_MMCSD_OPMODE_POLLED = 0, CSL_MMCSD_OPMODE_INTERRUPT = 1U, CSL_MMCSD_OPMODE_DMA = 2U, CSL_MMCSD_OPMODE_NONE = 3U }
| Enum to select the operating mode of the CSL MMCSD module. More...
enum | CSL_MmcsdEndianMode { CSL_MMCSD_ENDIAN_LITTLE = 0, CSL_MMCSD_ENDIAN_BIG = 1U }
| MMC/SD endianness. More...
## Functions
CSL_Status | MMC_init (void)
CSL_MmcsdHandle | MMC_open (CSL_MMCControllerObj *pMmcsdContObj, CSL_MmcsdInstId instId, CSL_MMCSDOpMode opMode, CSL_Status *status)
CSL_Status | MMC_close (CSL_MmcsdHandle hMmcsd)
CSL_Status | MMC_setCardType (CSL_MMCCardObj *pCardObj, CSL_CardType cardType)
CSL_Status | MMC_setCardPtr (CSL_MmcsdHandle hMmcsd, CSL_MMCCardObj *pMmcCardObj)
CSL_Status | MMC_setCallBack (CSL_MmcsdHandle hMmcsd, CSL_MMCCallBackObj *pFunction)
CSL_Status | MMC_getNumberOfCards (CSL_MmcsdHandle hMmcsd, Uint16 *pActiveNoCard)
CSL_Status | MMC_clearResponse (CSL_MmcsdHandle hMmcsd)
CSL_Status | MMC_intEnable (CSL_MmcsdHandle hMmcsd, Uint16 maskValue)
CSL_Status | MMC_eventEnable (CSL_MmcsdHandle hMmcsd, CSL_MMCSDEventType mmcsdEvent)
CSL_Status | MMC_eventDisable (CSL_MmcsdHandle hMmcsd, CSL_MMCSDEventType mmcsdEvent)
Bool | MMC_drrdy (CSL_MmcsdHandle hMmcsd, CSL_Status *pStatus)
Bool | MMC_dxrdy (CSL_MmcsdHandle hMmcsd, CSL_Status *pStatus)
CSL_Status | MMC_saveStatus (CSL_MmcsdHandle hMmcsd)
Uint32 | MMC_getStatus (CSL_MmcsdHandle hMmcsd, Uint32 maskValue, CSL_Status *pStatus)
CSL_Status | MMC_setupNative (CSL_MmcsdHandle hMmcsd, CSL_MMCSetupNative *pMmcInit)
CSL_Status | MMC_config (CSL_MmcsdHandle hMmcsd, CSL_MMCConfig *pMmcConfig)
CSL_Status | MMC_getConfig (CSL_MmcsdHandle hMmcsd, CSL_MMCConfig *pMmcConfig)
CSL_Status | MMC_sendCmd (CSL_MmcsdHandle hMmcsd, Uint32 cmd, Uint32 arg, Uint16 waitForRsp)
CSL_Status | MMC_sendGoIdle (CSL_MmcsdHandle hMmcsd)
CSL_Status | MMC_stop (CSL_MmcsdHandle hMmcsd)
CSL_Status | MMC_deselectCard (CSL_MmcsdHandle hMmcsd, CSL_MMCCardObj *pMmcCardObj)
CSL_Status | MMC_selectCard (CSL_MmcsdHandle hMmcsd, CSL_MMCCardObj *pMmcCardObj)
CSL_Status | MMC_sendOpCond (CSL_MmcsdHandle hMmcsd, Uint16 clkDivValue)
CSL_Status | MMC_setRca (CSL_MmcsdHandle hMmcsd, CSL_MMCCardObj *pMmcCardObj, Uint16 rCardAddr)
CSL_Status | SD_sendRca (CSL_MmcsdHandle hMmcsd, CSL_MMCCardObj *pSdCardObj, Uint16 *pRCardAddr)
CSL_Status | MMC_sendAllCID (CSL_MmcsdHandle hMmcsd, CSL_MMCCardIdObj *pMmcCardIdObj)
CSL_Status | SD_sendAllCID (CSL_MmcsdHandle hMmcsd, CSL_MMCCardIdObj *pSdCardIdObj)
CSL_Status | MMC_getCardCsd (CSL_MmcsdHandle hMmcsd, CSL_MMCCardCsdObj *pMmcCardCsdObj)
CSL_Status | SD_getCardCsd (CSL_MmcsdHandle hMmcsd, CSL_MMCCardCsdObj *pSdCardCsdObj)
CSL_Status | MMC_read (CSL_MmcsdHandle hMmcsd, Uint32 cardAddr, Uint16 noOfBytes, Uint16 *pReadBuffer)
CSL_Status | MMC_write (CSL_MmcsdHandle hMmcsd, Uint32 cardAddr, Uint16 noOfBytes, Uint16 *pWriteBuffer)
CSL_Status | MMC_setDmaHandle (CSL_MmcsdHandle hMmcsd, CSL_DMA_Handle hDmaWrite, CSL_DMA_Handle hDmaRead)
CSL_Status | MMC_setDataTransferCallback (CSL_MmcsdHandle hMmcsd, CSL_MMCDataTxferCallBackPtr dataTransferCallback)
CSL_Status | MMC_setDmaChanConfig (CSL_MmcsdHandle hMmcsd, CSL_MmcsdDmaConfig dmaConfig)
CSL_Status | MMC_setEndianMode (CSL_MmcsdHandle hMmcsd, CSL_MmcsdEndianMode writeEndianMode, CSL_MmcsdEndianMode readEndianMode)
CSL_Status | MMC_setBlockLength (CSL_MmcsdHandle hMmcsd, Uint32 blockLen)
CSL_Status | MMC_setWriteBlkEraseCnt (CSL_MmcsdHandle hMmcsd, Uint32 blkCnt)
CSL_Status | SD_setBusWidth (CSL_MmcsdHandle hMmcsd, Uint8 busWidth)
CSL_Status | MMC_getCardStatus (CSL_MmcsdHandle hMmcsd, Uint32 *pCardStatus)
CSL_Status | SD_configurePullup (CSL_MmcsdHandle hMmcsd, Bool pullupCfg)
static CSL_MMCSDEventType | MMC_getEventId (CSL_MmcsdHandle hMmcsd)

## Detailed Description

Functional layer API header file for MMC/SD CSL.

Path: \(CSLPATH)/inc