Defines
SDIO Symbols Defined
SDIO

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 Documentation

#define CSL_ESDIO_IO_NOTREADY   (0x101u)

Error code to indicate IO portion of the SDIO card is not ready

Referenced by SDIO_initCard().

#define CSL_ESDIO_MEM_NOTREADY   (0x102u)

Error code to indicate Memory portion of the SDIO card is not ready

Referenced by SDIO_initCard().

#define CSL_SDIO_BLKMODE (   blkMode)    CSL_SDIO_LSHIFT(blkMode, 27)

Macro to set bit position for block mode field in CMD53

#define CSL_SDIO_BUSY_STATE   (0x01u)

This bit is used to check whether the card is in busy state

#define CSL_SDIO_CARD_DESELECT_RCA   (0)

RCA value to deselect the SDIO card

Referenced by SDIO_deselectCard().

#define CSL_SDIO_CLK_DIV_INIT   (70u)

Minimum clock division for which both card can respond

Referenced by SDIO_detectCard().

#define CSL_SDIO_CMD41_RESP   (0x80FF8000u)

SDIO response for ACMD41

Referenced by SDIO_initCard().

#define CSL_SDIO_CMD_0   (0x0000u)

Recommended value for command 0

Referenced by SDIO_detectCard().

#define CSL_SDIO_CMD_2   (0x0402u)

Recommended value for command 2

#define CSL_SDIO_CMD_3   (0x0203u)

Recommended value for command 3

Referenced by SDIO_getRca(), and SDIO_initCard().

#define CSL_SDIO_CMD_41   (0x0629u)

Recommended value for command 41

Referenced by SDIO_initCard().

#define CSL_SDIO_CMD_41_ARG   (0x00ff8000)

Argument value for SDIO command 41 for standard capacity cards

Referenced by SDIO_initCard().

#define CSL_SDIO_CMD_41_HCS_ARG   (0x40ff8000)

Argument value for SDIO command 41 for high capacity cards

Referenced by SDIO_initCard().

#define CSL_SDIO_CMD_5   (0x0605u)

Recommended value for command 5

Referenced by SDIO_detectCard(), and SDIO_initCard().

#define CSL_SDIO_CMD_52   (0x0234u)

Recommended value for command 52

Referenced by SDIO_readSingleByte(), SDIO_resetCard(), and SDIO_writeSingleByte().

#define CSL_SDIO_CMD_53_READ   (0x2235u)

Recommended value for command 53 for read operation

Referenced by SDIO_readBlocks(), and SDIO_readBytes().

#define CSL_SDIO_CMD_53_WRITE   (0x2A35u)

Recommended value for command 53 for write operation

Referenced by SDIO_writeBlocks(), and SDIO_writeBytes().

#define CSL_SDIO_CMD_55   (0x0237u)

Recommended value for command 55

Referenced by SDIO_initCard().

#define CSL_SDIO_CMD_7   (0x0307u)

Recommended value for command 7

Referenced by SDIO_initCard(), and SDIO_selectCard().

#define CSL_SDIO_CMD_8   (0x0208u)

Recommended value for command 8

Referenced by SDIO_detectCard().

#define CSL_SDIO_CMD_8_ARG   (0x1AAu)

Argument value for SDIO command 8

Referenced by SDIO_detectCard().

#define CSL_SDIO_CMD_RETRY_COUNT   (500u)

SDIO command retry count during card detection and initialization

Referenced by SDIO_detectCard(), and SDIO_initCard().

#define CSL_SDIO_DATA_RW_TIMEOUT   (0xFFFFu)

Time out duration for data read/write

Referenced by SDIO_detectCard().

#define CSL_SDIO_DELAY_TIME   (100u)

Time delay

#define CSL_SDIO_FIFO_EMPTY   (0x20u)

This bit is used to check whether the FIFO is empty

#define CSL_SDIO_FUNNUM (   funNum)    CSL_SDIO_LSHIFT(funNum, 28)

Macro to set bit position for function number field in CMD52 and CMD53

#define CSL_SDIO_GET_C (   resp)    (CSL_SDIO_RSHIFT(resp, 31) & 0x01)

Macro to read c field value from CMD5 response

Referenced by SDIO_detectCard(), and SDIO_initCard().

#define CSL_SDIO_GET_FUNCNT (   resp)    (CSL_SDIO_RSHIFT(resp, 28) & 0x07)

Macro to read function count field value from CMD5 response

Referenced by SDIO_detectCard().

#define CSL_SDIO_GET_MEM (   resp)    (CSL_SDIO_RSHIFT(resp, 27) & 0x01)

Macro to read mem field value from CMD5 response

Referenced by SDIO_detectCard().

#define CSL_SDIO_GET_OCR (   resp)    (resp & 0xFFFFFF)

Macro to read ocr value from CMD5 response

Referenced by SDIO_detectCard().

#define CSL_SDIO_INIT_TIMEOUT   (0xFFFFu)

Time out duration for command retries during card initialization

#define CSL_SDIO_LSHIFT (   val,
  shift 
)    ((Uint32)val << shift)

Macro to perform a left shift operation on a value

Referenced by SDIO_detectCard(), and SDIO_initCard().

#define CSL_SDIO_MAKE_CMD52_READ_ARG (   regAddr,
  rawFlag,
  funNum,
  rwFlag 
)
Value:
(CSL_SDIO_REGADDR(regAddr) |     \
                                 CSL_SDIO_RAWFLAG(rawFlag) |     \
                                 CSL_SDIO_FUNNUM(funNum)   |     \
                                 CSL_SDIO_RWFLAG(rwFlag))

Macro to make 32 bit argument for CMD52 for read operation

Referenced by SDIO_readSingleByte().

#define CSL_SDIO_MAKE_CMD52_WRITE_ARG (   wrData,
  regAddr,
  rawFlag,
  funNum,
  rwFlag 
)
Value:
(wrData                    |      \
                                CSL_SDIO_REGADDR(regAddr) |      \
                                CSL_SDIO_RAWFLAG(rawFlag) |      \
                                CSL_SDIO_FUNNUM(funNum)   |      \
                                CSL_SDIO_RWFLAG(rwFlag))

Macro to make 32 bit argument for CMD52 for write operation

Referenced by SDIO_resetCard(), and SDIO_writeSingleByte().

#define CSL_SDIO_MAKE_CMD53_ARG (   count,
  regAddr,
  opCode,
  blkMode,
  funNum,
  rwFlag 
)
Value:
(count                     |      \
                                CSL_SDIO_REGADDR(regAddr) |      \
                                CSL_SDIO_OPCODE(opCode)   |      \
                                CSL_SDIO_BLKMODE(blkMode) |      \
                                CSL_SDIO_FUNNUM(funNum)   |      \
                                CSL_SDIO_RWFLAG(rwFlag))

Macro to make 32 bit argument for CMD53

Referenced by SDIO_readBlocks(), SDIO_readBytes(), SDIO_writeBlocks(), and SDIO_writeBytes().

#define CSL_SDIO_MASK_BYTE   (0xFFu)
#define CSL_SDIO_MASK_WORD   (0xFFFFu)
#define CSL_SDIO_MAX_BLOCK_COUNT   (511u)

Maximum number of an data blocks supported by SDIO specification

Referenced by SDIO_readBlocks(), and SDIO_writeBlocks().

#define CSL_SDIO_MAX_BLOCK_SIZE   (2048u)

Maximum size of an data transfer block supported by SDIO specification

Referenced by SDIO_readBlocks(), and SDIO_writeBlocks().

#define CSL_SDIO_MAX_BYTE_COUNT   (512u)

Maximum number of bytes that can be read using CMD53 in byte mode

Referenced by SDIO_readBytes(), and SDIO_writeBytes().

#define CSL_SDIO_MAX_CLKRATE   (0xFFu)

SDIO maximum clock rate value

Referenced by SDIO_setClock().

#define CSL_SDIO_MAX_FUNCTION_COUNT   (7u)

Maximum number of IO functions that are supported by SDIO specification

Referenced by SDIO_readBlocks(), SDIO_readBytes(), SDIO_readSingleByte(), SDIO_writeBlocks(), SDIO_writeBytes(), and SDIO_writeSingleByte().

#define CSL_SDIO_MMCIM_REG_MASK   (0x1FFFu)

Mask value for mmc interrupt enable register

Referenced by SDIO_eventDisable(), and SDIO_eventEnable().

#define CSL_SDIO_NULL   (0)

Macro to compare the NULL values

#define CSL_SDIO_OPCODE (   opCode)    CSL_SDIO_LSHIFT(opCode, 26)

Macro to set bit position for opcode field in CMD53

#define CSL_SDIO_RAWFLAG (   rawFlag)    CSL_SDIO_LSHIFT(rawFlag, 27)

Macro to set bit position for read after write flag in CMD52

#define CSL_SDIO_READ_FIFO_LEVEL   (32u)

SDIO read FIFO level in bytes

Referenced by SDIO_readBlocks(), and SDIO_readBytes().

#define CSL_SDIO_READ_READY   (0x0400u)

Bits that are used to check whether data can be read from the card

Referenced by SDIO_readBlocks(), and SDIO_readBytes().

#define CSL_SDIO_REGADDR (   regAddr)    CSL_SDIO_LSHIFT(regAddr, 9)

Macro to set bit position for register address field in CMD52 and CMD53

#define CSL_SDIO_RESET   (0x1u)

Reset SDIO bit field

#define CSL_SDIO_RESET_COUNT   (0x20u)

Reset count for SDIO

Referenced by SDIO_init().

#define CSL_SDIO_RESP_DONE   (0x04u)

This bit is used to check whether the card has responded to a command

#define CSL_SDIO_RESPONSE_TIMEOUT   (0xFFFFu)

Time out duration for response

Referenced by SDIO_detectCard().

#define CSL_SDIO_RSHIFT (   val,
  shift 
)    (val >> shift)
#define CSL_SDIO_RWFLAG (   rwFlag)    CSL_SDIO_LSHIFT(rwFlag, 31)

Macro to set bit position for read/write flag in CMD52 and CMD53

#define CSL_SDIO_SDHC_RESP   (0x40000000u)

SDIO response for SDHC card

Referenced by SDIO_initCard().

#define CSL_SDIO_SHIFT_BYTE   (8u)

Macro to shift a byte

Referenced by SDIO_readBlocks(), SDIO_readBytes(), SDIO_writeBlocks(), and SDIO_writeBytes().

#define CSL_SDIO_SHIFT_WORD   (16u)
#define CSL_SDIO_STUFF_BITS   (0x0000)

Stuff bits used to fill the command argument

Referenced by SDIO_deselectCard(), SDIO_detectCard(), SDIO_getRca(), SDIO_initCard(), and SDIO_selectCard().

#define CSL_SDIO_WRITE_FIFO_LEVEL   (32u)

SDIO write FIFO level in bytes

Referenced by SDIO_writeBlocks(), and SDIO_writeBytes().

#define CSL_SDIO_WRITE_READY   (0x0200u)

Bits that are used to check whether data can be written to the card

Referenced by SDIO_writeBlocks(), and SDIO_writeBytes().