SAMV71 Xplained Ultra Software Package 1.4

mcid_dma.c File Reference

#include "board.h"
#include "sdmmc.h"
#include <assert.h>

Go to the source code of this file.

Defines

#define MCI_ENABLE(pMciHw)   HSMCI_Enable(pMciHw)
#define MCI_DISABLE(pMciHw)   HSMCI_Disable(pMciHw)
#define MCI_RESET(pMciHw)   HSMCI_Reset(pMciHw, 0)
#define toHWCOUNT(byteCnt)   (((byteCnt)&0x1) ? (((byteCnt)/2)+1) : ((byteCnt)/2))
#define toWCOUNT(byteCnt)   (((byteCnt)&0x3) ? (((byteCnt)/4)+1) : ((byteCnt)/4))
#define STATUS_ERRORS
#define STATUS_ERRORS_RESP
#define STATUS_ERRORS_DATA
#define MAX_DMA_SIZE   (XDMAC_MAX_BT_SIZE & 0xFFFFFF00)
#define _CMDR_SDMEM_SINGLE   (HSMCI_CMDR_TRCMD_START_DATA | HSMCI_CMDR_TRTYP_SINGLE)
#define _CMDR_SDMEM_MULTI   (HSMCI_CMDR_TRCMD_START_DATA | HSMCI_CMDR_TRTYP_MULTIPLE)
#define _CMDR_SDIO_BYTE   (HSMCI_CMDR_TRCMD_START_DATA | HSMCI_CMDR_TRTYP_BYTE)
#define _CMDR_SDIO_BLOCK   (HSMCI_CMDR_TRCMD_START_DATA | HSMCI_CMDR_TRTYP_BLOCK)

Functions

void MCID_SetSlot (Hsmci *pMci, uint8_t slot)
void MCID_Init (sMcid *pMcid, Hsmci *pMci, uint8_t bID, uint32_t dwMck, sXdmad *pXdmad, uint8_t bPolling)
uint32_t MCID_Lock (sMcid *pMcid, uint8_t bSlot)
uint32_t MCID_Release (sMcid *pMcid)
uint32_t MCID_SendCmd (sMcid *pMcid, void *pCmd)
void MCID_Handler (sMcid *pMcid)
uint32_t MCID_CancelCmd (sMcid *pMcid)
void MCID_Reset (sMcid *pMcid)
uint32_t MCID_IsCmdCompleted (sMcid *pMcid)
uint32_t MCID_IOCtrl (sMcid *pMcid, uint32_t bCtl, uint32_t param)
void SDD_InitializeSdmmcMode (sSdCard *pSd, void *pDrv, uint8_t bSlot)

Detailed Description

Implement for SD/MMC low level commands.

See also:
Working with HSMCI, sdmmc_module

Definition in file mcid_dma.c.


Define Documentation

#define _CMDR_SDIO_BLOCK   (HSMCI_CMDR_TRCMD_START_DATA | HSMCI_CMDR_TRTYP_BLOCK)

SDIO block transfer

Definition at line 105 of file mcid_dma.c.

#define _CMDR_SDIO_BYTE   (HSMCI_CMDR_TRCMD_START_DATA | HSMCI_CMDR_TRTYP_BYTE)

SDIO byte transfer

Definition at line 102 of file mcid_dma.c.

#define _CMDR_SDMEM_MULTI   (HSMCI_CMDR_TRCMD_START_DATA | HSMCI_CMDR_TRTYP_MULTIPLE)

SD/MMC memory Multi block

Definition at line 99 of file mcid_dma.c.

#define _CMDR_SDMEM_SINGLE   (HSMCI_CMDR_TRCMD_START_DATA | HSMCI_CMDR_TRTYP_SINGLE)

SD/MMC memory Single block

Definition at line 96 of file mcid_dma.c.

#define MAX_DMA_SIZE   (XDMAC_MAX_BT_SIZE & 0xFFFFFF00)

Max DMA size in a single transfer

Definition at line 93 of file mcid_dma.c.

#define MCI_DISABLE (   pMciHw  )     HSMCI_Disable(pMciHw)

Disable MCI

Definition at line 55 of file mcid_dma.c.

#define MCI_ENABLE (   pMciHw  )     HSMCI_Enable(pMciHw)

mcid_defines Enable MCI

Definition at line 53 of file mcid_dma.c.

#define MCI_RESET (   pMciHw  )     HSMCI_Reset(pMciHw, 0)

Reset MCI

Definition at line 57 of file mcid_dma.c.

#define STATUS_ERRORS
Value:

Bit mask for status register errors.

Definition at line 66 of file mcid_dma.c.

#define STATUS_ERRORS_DATA
Value:

Bit mask for data errors

Definition at line 87 of file mcid_dma.c.

#define STATUS_ERRORS_RESP
Value:

Bit mask for response errors

Definition at line 79 of file mcid_dma.c.

#define toHWCOUNT (   byteCnt  )     (((byteCnt)&0x1) ? (((byteCnt)/2)+1) : ((byteCnt)/2))

Return halfword(16-bit) count from byte count

Definition at line 60 of file mcid_dma.c.

#define toWCOUNT (   byteCnt  )     (((byteCnt)&0x3) ? (((byteCnt)/4)+1) : ((byteCnt)/4))

Return word(32-bit) count from byte count

Definition at line 62 of file mcid_dma.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines