SAMV71 Xplained Ultra Software Package 1.3

hsmci.h

Go to the documentation of this file.
00001 /* ----------------------------------------------------------------------------
00002  *         SAM Software Package License 
00003  * ----------------------------------------------------------------------------
00004  * Copyright (c) 2013, Atmel Corporation
00005  *
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions are met:
00010  *
00011  * - Redistributions of source code must retain the above copyright notice,
00012  * this list of conditions and the disclaimer below.
00013  *
00014  * Atmel's name may not be used to endorse or promote products derived from
00015  * this software without specific prior written permission.
00016  *
00017  * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
00018  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00019  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
00020  * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
00021  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00022  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
00023  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00024  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00025  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
00026  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00027  * ----------------------------------------------------------------------------
00028  */
00029 
00030 /** \file */
00031 
00032 /** \addtogroup hsmci_module Working with HSMCI
00033  *  \ingroup mcid_module
00034  *
00035  * \section Purpose
00036  *
00037  * The HSMCI driver provides the interface to configure and use the HSMCI
00038  * peripheral.
00039  *
00040  * \section Usage
00041  *
00042  * -# HSMCI_Enable(), MCI_Disable(): Enable/Disable HSMCI interface.
00043  * -# HSMCI_Reset(): Reset HSMCI interface.
00044  * -# HSMCI_Select(): HSMCI slot and buswidth selection
00045  *                    (\ref Hsmci::HSMCI_SDCR).
00046  * -# HSMCI_ConfigureMode(): Configure the  MCI CLKDIV in the _MR register
00047  *                           (\ref Hsmci::HSMCI_MR).
00048  * -# HSMCI_EnableIt(), HSMCI_DisableIt(), HSMCI_GetItMask(), HSMCI_GetStatus()
00049  *      HSMCI Interrupt control (\ref Hsmci::HSMCI_IER, \ref Hsmci::HSMCI_IDR,
00050  *      \ref Hsmci::HSMCI_IMR, \ref Hsmci::HSMCI_SR).
00051  * -# HSMCI_ConfigureTransfer(): Setup block length and count for MCI transfer
00052  *                               (\ref Hsmci::HSMCI_BLKR).
00053  * -# HSMCI_SendCmd(): Send SD/MMC command with argument
00054  *                     (\ref Hsmci::HSMCI_ARGR, \ref Hsmci::HSMCI_CMDR).
00055  * -# HSMCI_GetResponse(): Get SD/MMC response after command finished
00056  *                         (\ref Hsmci::HSMCI_RSPR).
00057  * -# HSMCI_ConfigureDma(): Configure MCI DMA transfer
00058  *                          (\ref Hsmci::HSMCI_DMA).
00059  * -# HSMCI_Configure(): Configure the HSMCI interface (\ref Hsmci::HSMCI_CFG).
00060  * -# HSMCI_HsEnable(), HSMCI_IsHsEnabled(): High Speed control.
00061  *
00062  * For more accurate information, please look at the HSMCI section of the
00063  * Datasheet.
00064  *
00065  * \sa \ref mcid_module
00066  *
00067  * Related files :\n
00068  * \ref hsmci.h\n
00069  * \ref hsmci.c.\n
00070  */
00071 
00072 #ifndef HSMCID_H
00073 #define HSMCID_H
00074 /** \addtogroup hsmci_module
00075  *@{
00076  */
00077 
00078 /*----------------------------------------------------------------------------
00079  *         Headers
00080  *----------------------------------------------------------------------------*/
00081 
00082 #include "chip.h"
00083 
00084 #include <stdint.h>
00085 
00086 #ifdef __cplusplus
00087  extern "C" {
00088 #endif
00089 /*----------------------------------------------------------------------------
00090  *         Exported functions
00091  *----------------------------------------------------------------------------*/
00092 /** \addtogroup hsmci_functions HSMCI Functions
00093  *      @{
00094  */
00095 
00096 extern void HSMCI_Enable(Hsmci* pRMci);
00097 extern void HSMCI_Disable(Hsmci* pRMci);
00098 extern void HSMCI_Reset(Hsmci* pRMci, uint8_t bBackup);
00099 
00100 extern void HSMCI_Select(Hsmci * pRMci,uint8_t bSlot,uint8_t bBusWidth);
00101 extern void HSMCI_SetSlot(Hsmci * pRMci,uint8_t bSlot);
00102 extern void HSMCI_SetBusWidth(Hsmci * pRMci,uint8_t bBusWidth);
00103 extern uint8_t HSMCI_GetBusWidth(Hsmci * pRMci);
00104 
00105 extern void HSMCI_ConfigureMode(Hsmci *pRMci, uint32_t dwMode);
00106 extern uint32_t HSMCI_GetMode(Hsmci *pRMci);
00107 extern void HSMCI_ProofEnable(Hsmci *pRMci, uint8_t bRdProof, uint8_t bWrProof);
00108 extern void HSMCI_PadvCtl(Hsmci *pRMci, uint8_t bPadv);
00109 extern void HSMCI_FByteEnable(Hsmci *pRMci, uint8_t bFByteEn);
00110 extern uint8_t HSMCI_IsFByteEnabled(Hsmci * pRMci);
00111 extern void HSMCI_DivCtrl(Hsmci *pRMci, uint32_t bClkDiv, uint8_t bPwsDiv);
00112 
00113 extern void HSMCI_EnableIt(Hsmci *pRMci, uint32_t dwSources);
00114 extern void HSMCI_DisableIt(Hsmci *pRMci, uint32_t dwSources);
00115 extern uint32_t HSMCI_GetItMask(Hsmci *pRMci);
00116 
00117 extern void HSMCI_ConfigureTransfer(Hsmci * pRMci,uint16_t wBlkLen,uint16_t wCnt);
00118 extern void HSMCI_SetBlockLen(Hsmci * pRMci,uint16_t wBlkSize);
00119 extern void HSMCI_SetBlockCount(Hsmci * pRMci,uint16_t wBlkCnt);
00120 
00121 extern void HSMCI_ConfigureCompletionTO(Hsmci *pRMci, uint32_t dwConfigure);
00122 extern void HSMCI_ConfigureDataTO(Hsmci *pRMci, uint32_t dwConfigure);
00123 
00124 extern void HSMCI_SendCmd(Hsmci * pRMci,uint32_t dwCmd,uint32_t dwArg);
00125 extern uint32_t HSMCI_GetResponse(Hsmci *pRMci);
00126 extern uint32_t HSMCI_Read(Hsmci *pRMci);
00127 extern void HSMCI_ReadFifo(Hsmci *pRMci, uint8_t *pdwData, uint32_t dwSize);
00128 extern void HSMCI_Write(Hsmci *pRMci, uint32_t dwData);
00129 extern void HSMCI_WriteFifo(Hsmci *pRMci, uint8_t *pdwData, uint32_t dwSize);
00130 
00131 extern uint32_t HSMCI_GetStatus(Hsmci *pRMci);
00132 
00133 extern void HSMCI_ConfigureDma(Hsmci *pRMci, uint32_t dwConfigure);
00134 extern void HSMCI_EnableDma(Hsmci * pRMci,uint8_t bEnable);
00135 
00136 extern void HSMCI_Configure(Hsmci *pRMci, uint32_t dwConfigure);
00137 extern void HSMCI_HsEnable(Hsmci *pRMci, uint8_t bHsEnable);
00138 extern uint8_t HSMCI_IsHsEnabled(Hsmci *pRMci);
00139 
00140 extern void HSMCI_BusWidthCtl(Hsmci *pRMci, uint8_t bBusWidth);
00141 extern void HSMCI_SlotCtl(Hsmci *pRMci, uint8_t bSlot);
00142 extern uint8_t HSMCI_GetSlot(Hsmci *pRMci);
00143 
00144 extern void HSMCI_ConfigureWP(Hsmci *pRMci, uint32_t dwConfigure);
00145 extern uint32_t HSMCI_GetWPStatus(Hsmci *pRMci);
00146 
00147 #ifdef __cplusplus
00148 }
00149 #endif
00150 
00151 /**     @}*/
00152 /**@}*/
00153 #endif //#ifndef HSMCID_H
00154 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines