SAMV71 Xplained Ultra Software Package 1.5

sdmmc.c File Reference

#include <assert.h>
#include <string.h>
#include <stdint.h>
#include "libsdmmc.h"
#include "sdmmc_trace.h"

Go to the source code of this file.

Defines

#define STATUS_APP_CMD   (1UL << 5)
#define STATUS_SWITCH_ERROR   (1UL << 7)
#define STATUS_READY_FOR_DATA   (1UL << 8)
#define STATUS_IDLE   (0UL << 9)
#define STATUS_READY   (1UL << 9)
#define STATUS_IDENT   (2UL << 9)
#define STATUS_STBY   (3UL << 9)
#define STATUS_TRAN   (4UL << 9)
#define STATUS_DATA   (5UL << 9)
#define STATUS_RCV   (6UL << 9)
#define STATUS_PRG   (7UL << 9)
#define STATUS_DIS   (8UL << 9)
#define STATUS_STATE   (0xFUL << 9)
#define STATUS_ERASE_RESET   (1UL << 13)
#define STATUS_WP_ERASE_SKIP   (1UL << 15)
#define STATUS_CIDCSD_OVERWRITE   (1UL << 16)
#define STATUS_OVERRUN   (1UL << 17)
#define STATUS_UNERRUN   (1UL << 18)
#define STATUS_ERROR   (1UL << 19)
#define STATUS_CC_ERROR   (1UL << 20)
#define STATUS_CARD_ECC_FAILED   (1UL << 21)
#define STATUS_ILLEGAL_COMMAND   (1UL << 22)
#define STATUS_COM_CRC_ERROR   (1UL << 23)
#define STATUS_UN_LOCK_FAILED   (1UL << 24)
#define STATUS_CARD_IS_LOCKED   (1UL << 25)
#define STATUS_WP_VIOLATION   (1UL << 26)
#define STATUS_ERASE_PARAM   (1UL << 27)
#define STATUS_ERASE_SEQ_ERROR   (1UL << 28)
#define STATUS_BLOCK_LEN_ERROR   (1UL << 29)
#define STATUS_ADDRESS_MISALIGN   (1UL << 30)
#define STATUS_ADDR_OUT_OR_RANGE   (1UL << 31)
#define STATUS_STOP
#define STATUS_WRITE
#define STATUS_READ
#define STATUS_SD_SWITCH
#define STATUS_MMC_SWITCH
#define SDIO_COM_CRC_ERROR   (1UL << 15)
#define SDIO_ILLEGAL_COMMAND   (1UL << 14)
#define STATUS_SDIO_R6
#define STATUS_SDIO_R5
#define CARD_ADDR(pSd)   (pSd->wAddress)
#define BLOCK_SIZE(pSd)   (pSd->wCurrBlockLen)
#define SD_ADDRESS(pSd, address)
#define MMC_ADDRESS(pSd, address)
#define SD_IsVer1_10(pSd)   (SD_SCR_SD_SPEC(pSd->SCR) >= SD_SCR_SD_SPEC_1_10)
#define SD_IsHsModeSupported(pSd)   (/*SD_IsVer1_10(pSd)||*/(SD_CSD_STRUCTURE(pSd->CSD)>=1))
#define SD_IsBusModeSupported(pSd)   (1)
#define MMC_IsVer4(pSd)   (MMC_CSD_SPEC_VERS(pSd->CSD) >= 4)
#define MMC_IsCSDVer1_2(pSd)
#define MMC_IsBootModeSupported(pSd)   ((MMC_IsVer4(pSd)&&(eMMC_CID_CBX(pSd->CID)==0x01))
#define MMC_IsBusModeSupported(pSd)   (MMC_IsVer4(pSd))
#define MMC_IsHsModeSupported(pSd)   (MMC_IsCSDVer1_2(pSd)&&(MMC_EXT_CARD_TYPE(pSd->EXT)&0x2))

Functions

 COMPILER_ALIGNED (32) const
void _DumpREG (void *pREG, uint32_t dwSize)
 Dump register.
uint8_t SD_Read (sSdCard *pSd, uint32_t dwAddr, void *pData, uint32_t dwNbBlocks, fSdmmcCallback fCallback, void *pArg)
uint8_t SD_Write (sSdCard *pSd, uint32_t dwAddr, const void *pData, uint32_t dwNbBlocks, fSdmmcCallback fCallback, void *pArg)
uint8_t SD_ReadBlocks (sSdCard *pSd, uint32_t dwAddr, void *pData, uint32_t dwNbBlocks)
uint8_t SD_WriteBlocks (sSdCard *pSd, uint32_t dwAddr, const void *pData, uint32_t dwNbBlocks)
void SDD_Initialize (sSdCard *pSd, const void *pDrv, uint8_t bSlot, const sSdHalFunctions *pHalf)
uint8_t SD_Init (sSdCard *pSd)
void SD_DeInit (sSdCard *pSd)
uint8_t SD_GetCardType (sSdCard *pSd)
uint32_t SD_GetTotalSizeKB (sSdCard *pSd)
uint32_t SD_GetBlockSize (sSdCard *pSd)
uint32_t SD_GetNumberBlocks (sSdCard *pSd)
uint8_t SDIO_ReadDirect (sSdCard *pSd, uint8_t bFunctionNum, uint32_t dwAddress, uint8_t *pData, uint32_t dwSize)
uint8_t SDIO_WriteDirect (sSdCard *pSd, uint8_t bFunctionNum, uint32_t dwAddress, uint8_t bDataByte)
uint8_t SDIO_ReadBytes (sSdCard *pSd, uint8_t bFunctionNum, uint32_t dwAddress, uint8_t bIsFixedAddress, uint8_t *pData, uint16_t wSize, fSdmmcCallback fCallback, void *pArg)
uint8_t SDIO_WriteBytes (sSdCard *pSd, uint8_t bFunctionNum, uint32_t dwAddress, uint8_t bIsFixedAddress, uint8_t *pData, uint16_t wSize, fSdmmcCallback fCallback, void *pArg)
void SDIO_DumpCardInformation (sSdCard *pSd)
void SD_DumpCID (void *pCID)
void SD_DumpCSD (void *pCSD)
void SD_DumpExtCSD (void *pExtCSD)
void SD_DumpSCR (void *pSCR)
void SD_DumpSdStatus (void *pSdST)

Variables

uint32_t switchStatus [512/32]

Detailed Description

Definition in file sdmmc.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines