- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

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

Functional layer API header file for SDIO CSL. More...

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

Go to the source code of this file.

## Data Structures
struct | CSL_SdioResponse
| Response array received from the controller. More...
struct | CSL_SdioConfig
| SDIo config structure for setting SDIO Control register. More...
struct | CSL_SdioCardObj
| structure for card specific information. More...
struct | CSL_SdioControllerObj
| structure for card specific information. More...
## Defines
#define | CSL_SDIO_STUFF_BITS (0x0000)
#define | CSL_SDIO_RESET (0x1u)
#define | CSL_SDIO_RESET_COUNT (0x20u)
#define | CSL_SDIO_DELAY_TIME (100u)
#define | CSL_SDIO_RESPONSE_TIMEOUT (0xFFFFu)
#define | CSL_SDIO_INIT_TIMEOUT (0xFFFFu)
#define | CSL_SDIO_DATA_RW_TIMEOUT (0xFFFFu)
#define | CSL_SDIO_CMD_RETRY_COUNT (500u)
#define | CSL_SDIO_CLK_DIV_INIT (70u)
#define | CSL_SDIO_BUSY_STATE (0x01u)
#define | CSL_SDIO_FIFO_EMPTY (0x20u)
#define | CSL_SDIO_RESP_DONE (0x04u)
#define | CSL_SDIO_READ_READY (0x0400u)
#define | CSL_SDIO_WRITE_READY (0x0200u)
#define | CSL_SDIO_CARD_DESELECT_RCA (0)
#define | CSL_SDIO_NULL (0)
#define | CSL_SDIO_CMD_0 (0x0000u)
#define | CSL_SDIO_CMD_2 (0x0402u)
#define | CSL_SDIO_CMD_3 (0x0203u)
#define | CSL_SDIO_CMD_5 (0x0605u)
#define | CSL_SDIO_CMD_7 (0x0307u)
#define | CSL_SDIO_CMD_8 (0x0208u)
#define | CSL_SDIO_CMD_41 (0x0629u)
#define | CSL_SDIO_CMD_55 (0x0237u)
#define | CSL_SDIO_CMD_53_READ (0x2235u)
#define | CSL_SDIO_CMD_53_WRITE (0x2A35u)
#define | CSL_SDIO_CMD_52 (0x0234u)
#define | CSL_SDIO_CMD_8_ARG (0x1AAu)
#define | CSL_SDIO_CMD_41_ARG (0x00ff8000)
#define | CSL_SDIO_CMD_41_HCS_ARG (0x40ff8000)
#define | CSL_SDIO_CMD41_RESP (0x80FF8000u)
#define | CSL_SDIO_SDHC_RESP (0x40000000u)
#define | CSL_ESDIO_IO_NOTREADY (0x101u)
#define | CSL_ESDIO_MEM_NOTREADY (0x102u)
#define | CSL_SDIO_READ_FIFO_LEVEL (32u)
#define | CSL_SDIO_WRITE_FIFO_LEVEL (32u)
#define | CSL_SDIO_SHIFT_WORD (16u)
#define | CSL_SDIO_MASK_WORD (0xFFFFu)
#define | CSL_SDIO_SHIFT_BYTE (8u)
#define | CSL_SDIO_MASK_BYTE (0xFFu)
#define | CSL_SDIO_MMCIM_REG_MASK (0x1FFFu)
#define | CSL_SDIO_MAX_BYTE_COUNT (512u)
#define | CSL_SDIO_MAX_FUNCTION_COUNT (7u)
#define | CSL_SDIO_MAX_BLOCK_SIZE (2048u)
#define | CSL_SDIO_MAX_BLOCK_COUNT (511u)
#define | CSL_SDIO_MAX_CLKRATE (0xFFu)
#define | CSL_SDIO_LSHIFT(val, shift) ((Uint32)val << shift)
#define | CSL_SDIO_RSHIFT(val, shift) (val >> shift)
#define | CSL_SDIO_REGADDR(regAddr) CSL_SDIO_LSHIFT(regAddr, 9)
#define | CSL_SDIO_RAWFLAG(rawFlag) CSL_SDIO_LSHIFT(rawFlag, 27)
#define | CSL_SDIO_FUNNUM(funNum) CSL_SDIO_LSHIFT(funNum, 28)
#define | CSL_SDIO_RWFLAG(rwFlag) CSL_SDIO_LSHIFT(rwFlag, 31)
#define | CSL_SDIO_OPCODE(opCode) CSL_SDIO_LSHIFT(opCode, 26)
#define | CSL_SDIO_BLKMODE(blkMode) CSL_SDIO_LSHIFT(blkMode, 27)
#define | CSL_SDIO_MAKE_CMD52_WRITE_ARG(wrData, regAddr, rawFlag, funNum, rwFlag)
#define | CSL_SDIO_MAKE_CMD52_READ_ARG(regAddr, rawFlag, funNum, rwFlag)
#define | CSL_SDIO_MAKE_CMD53_ARG(count, regAddr, opCode, blkMode, funNum, rwFlag)
#define | CSL_SDIO_GET_OCR(resp) (resp & 0xFFFFFF)
#define | CSL_SDIO_GET_MEM(resp) (CSL_SDIO_RSHIFT(resp, 27) & 0x01)
#define | CSL_SDIO_GET_FUNCNT(resp) (CSL_SDIO_RSHIFT(resp, 28) & 0x07)
#define | CSL_SDIO_GET_C(resp) (CSL_SDIO_RSHIFT(resp, 31) & 0x01)
#define | CSL_SDIO_EVENT_ERROR
| Error type as received by the SDIO controller on response for a command.
#define | CSL_SDIO_CMD_TOUT_CRC_ERROR
| Error type for command response timeout and CRC error.
#define | CSL_SDIO_DATA_TOUT_CRC_ERROR
| Error type for data timeout and CRC error.
## Typedefs
typedef CSL_SdioControllerObj * | CSL_SdioHandle
| SDIO Handle.
## Enumerations
enum | CSL_SdioInstId { CSL_SDIO_INST0, CSL_SDIO_INST1, CSL_SDIO_INST_INV }
| Hardware Instance Id to select SDIO controller registers. More...
enum | CSL_SdioRespType { CSL_SDIO_RESPTYPE_NO, CSL_SDIO_RESPTYPE_R1, CSL_SDIO_RESPTYPE_R2, CSL_SDIO_RESPTYPE_R3, CSL_SDIO_RESPTYPE_R4, CSL_SDIO_RESPTYPE_R5, CSL_SDIO_RESPTYPE_R6 }
| Response type from SDIO card. More...
enum | CSL_SdioRespBusy { CSL_SDIO_RESPBUSY_NO, CSL_SDIO_RESPBUSY_YES }
| Response busy signal from the card. More...
enum | CSL_SdioCardType { CSL_SDIO_CARD_NONE = 0, CSL_SDIO_IO_CARD, CSL_SDIO_COMBO_CARD, CSL_SDIO_INVALID_CARD }
| Type of card that is inserted. More...
enum | CSL_SdioCardRespEvent { CSL_SDIO_EVENT_EOFCMD = (1U << 2U), CSL_SDIO_EVENT_READ = (1U << 10U), CSL_SDIO_EVENT_WRITE = (1U << 9U), CSL_SDIO_EVENT_ERROR_CMDCRC = (1U << 7U), CSL_SDIO_EVENT_ERROR_DATACRC = ((1U << 6U)|(1 << 5U)), CSL_SDIO_EVENT_ERROR_CMDTIMEOUT = ((1U) << (4U)), CSL_SDIO_EVENT_ERROR_DATATIMEOUT = ((1U) << (3U)), CSL_SDIO_EVENT_CARD_EXITBUSY = ((1U) << (1U)), CSL_SDIO_EVENT_BLOCK_XFERRED = 1U }
| SDIO event responses. More...
enum | CSL_SdioEventType { CSL_SDIO_EDATDNE_INTERRUPT, CSL_SDIO_EBSYDNE_INTERRUPT, CSL_SDIO_ERSPDNE_INTERRUPT, CSL_SDIO_ETOUTRD_INTERRUPT, CSL_SDIO_ETOUTRS_INTERRUPT, CSL_SDIO_ECRCWR_INTERRUPT, CSL_SDIO_ECRCRD_INTERRUPT, CSL_SDIO_ECRCRS_INTERRUPT, CSL_SDIO_RSV_BIT, CSL_SDIO_EDXRDY_INTERRUPT, CSL_SDIO_EDRRDY_INTERRUPT, CSL_SDIO_EDATED_INTERRUPT, CSL_SDIO_ETRNDNE_INTERRUPT, CSL_SDIO_MMCIM_ALL_INTERRUPT, CSL_SDIO_READWAIT_INTERRUPT, CSL_SDIO_CARD_INTERRUPT, CSL_SDIO_SDIOIEN_ALL_INTERRUPT }
| Enum variable for the selection of SDIO events. More...
enum | CSL_SdioIntrStatus { CSL_SDIO_READWAIT_INTR_ENABLE, CSL_SDIO_READWAIT_INTR_DISABLE, CSL_SDIO_CARD_INTR_ENABLE, CSL_SDIO_CARD_INTR_DISABLE, CSL_SDIO_ALL_INTR_ENABLE, CSL_SDIO_ALL_INTR_DISABLE }
| Enum variable for the selection of SDIO interrupt status. More...
enum | CSL_SdioEndianMode { CSL_SDIO_ENDIAN_LITTLE = 0U, CSL_SDIO_ENDIAN_BIG = 1U }
| SDIO endianness. More...
## Functions
CSL_Status | SDIO_init (void)
CSL_SdioHandle | SDIO_open (CSL_SdioControllerObj *pSdioContObj, CSL_SdioInstId instId, CSL_Status *status)
CSL_Status | SDIO_close (CSL_SdioHandle hSdio)
CSL_Status | SDIO_config (CSL_SdioHandle hSdio, CSL_SdioConfig *pSdioConfig)
CSL_Status | SDIO_detectCard (CSL_SdioHandle hSdio, CSL_SdioCardObj *pSdioCardObj)
CSL_Status | SDIO_initCard (CSL_SdioHandle hSdio, Uint32 OpCondReg, Bool initMem)
CSL_Status | SDIO_resetCard (CSL_SdioHandle hSdio)
CSL_Status | SDIO_getRca (CSL_SdioHandle hSdio, Uint16 *pRCardAddr)
CSL_Status | SDIO_deselectCard (CSL_SdioHandle hSdio)
CSL_Status | SDIO_selectCard (CSL_SdioHandle hSdio, Uint16 rca)
CSL_Status | SDIO_sendCommand (CSL_SdioHandle hSdio, Uint32 cmd, Uint32 arg, Uint16 respTimeout)
CSL_Status | SDIO_getResponse (CSL_SdioHandle hSdio, CSL_SdioRespType respType, CSL_SdioResponse *pResponse)
CSL_Status | SDIO_clearResponse (CSL_SdioHandle hSdio)
Uint32 | SDIO_getStatus (CSL_SdioHandle hSdio, Uint32 maskValue, CSL_Status *pStatus)
Uint32 | SDIO_getSdioStatus (CSL_SdioHandle hSdio, Uint32 maskValue, CSL_Status *pStatus)
CSL_Status | SDIO_eventEnable (CSL_SdioHandle hSdio, CSL_SdioEventType sdioEvent)
CSL_Status | SDIO_eventDisable (CSL_SdioHandle hSdio, CSL_SdioEventType sdioEvent)
CSL_Status | SDIO_readWaitEnable (CSL_SdioHandle hSdio)
CSL_Status | SDIO_readWaitDisable (CSL_SdioHandle hSdio)
CSL_Status | SDIO_readSingleByte (CSL_SdioHandle hSdio, Uint32 readAddr, Uint8 funNum, Uint8 *pReadData)
CSL_Status | SDIO_writeSingleByte (CSL_SdioHandle hSdio, Uint32 writeAddr, Uint8 funNum, Uint8 writeData)
CSL_Status | SDIO_readBytes (CSL_SdioHandle hSdio, Uint32 readAddr, Uint8 funNum, Bool opCode, Uint16 noOfBytes, Uint16 *pReadBuf)
CSL_Status | SDIO_writeBytes (CSL_SdioHandle hSdio, Uint32 writeAddr, Uint8 funNum, Bool opCode, Uint16 noOfBytes, Uint16 *pWriteBuf)
CSL_Status | SDIO_readBlocks (CSL_SdioHandle hSdio, Uint32 readAddr, Uint8 funNum, Bool opCode, Uint16 noOfBlocks, Uint16 blockSize, Uint16 *pReadBuf)
CSL_Status | SDIO_writeBlocks (CSL_SdioHandle hSdio, Uint32 writeAddr, Uint8 funNum, Bool opCode, Uint16 noOfBlocks, Uint16 blockSize, Uint16 *pWriteBuf)
CSL_Status | SDIO_setEndianMode (CSL_SdioHandle hSdio, CSL_SdioEndianMode writeEndianMode, CSL_SdioEndianMode readEndianMode)
CSL_Status | SDIO_setClock (CSL_SdioHandle hSdio, Uint16 clockRate)

## Detailed Description

Functional layer API header file for SDIO CSL.

Path: \(CSLPATH)\ inc