00001 /* ---------------------------------------------------------------------------- */ 00002 /* Atmel Microcontroller Software Support */ 00003 /* SAM Software Package License */ 00004 /* ---------------------------------------------------------------------------- */ 00005 /* Copyright (c) 2015, Atmel Corporation */ 00006 /* */ 00007 /* All rights reserved. */ 00008 /* */ 00009 /* Redistribution and use in source and binary forms, with or without */ 00010 /* modification, are permitted provided that the following condition is met: */ 00011 /* */ 00012 /* - Redistributions of source code must retain the above copyright notice, */ 00013 /* this list of conditions and the disclaimer below. */ 00014 /* */ 00015 /* Atmel's name may not be used to endorse or promote products derived from */ 00016 /* this software without specific prior written permission. */ 00017 /* */ 00018 /* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ 00019 /* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ 00020 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ 00021 /* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ 00022 /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ 00023 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ 00024 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ 00025 /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ 00026 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ 00027 /* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 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, 00118 uint16_t wCnt); 00119 extern void HSMCI_SetBlockLen(Hsmci *pRMci, uint16_t wBlkSize); 00120 extern void HSMCI_SetBlockCount(Hsmci *pRMci, uint16_t wBlkCnt); 00121 00122 extern void HSMCI_ConfigureCompletionTO(Hsmci *pRMci, uint32_t dwConfigure); 00123 extern void HSMCI_ConfigureDataTO(Hsmci *pRMci, uint32_t dwConfigure); 00124 00125 extern void HSMCI_SendCmd(Hsmci *pRMci, uint32_t dwCmd, uint32_t dwArg); 00126 extern uint32_t HSMCI_GetResponse(Hsmci *pRMci); 00127 extern uint32_t HSMCI_Read(Hsmci *pRMci); 00128 extern void HSMCI_ReadFifo(Hsmci *pRMci, uint8_t *pdwData, uint32_t dwSize); 00129 extern void HSMCI_Write(Hsmci *pRMci, uint32_t dwData); 00130 extern void HSMCI_WriteFifo(Hsmci *pRMci, uint8_t *pdwData, uint32_t dwSize); 00131 00132 extern uint32_t HSMCI_GetStatus(Hsmci *pRMci); 00133 00134 extern void HSMCI_ConfigureDma(Hsmci *pRMci, uint32_t dwConfigure); 00135 extern void HSMCI_EnableDma(Hsmci *pRMci, uint8_t bEnable); 00136 00137 extern void HSMCI_Configure(Hsmci *pRMci, uint32_t dwConfigure); 00138 extern void HSMCI_HsEnable(Hsmci *pRMci, uint8_t bHsEnable); 00139 extern uint8_t HSMCI_IsHsEnabled(Hsmci *pRMci); 00140 00141 extern void HSMCI_BusWidthCtl(Hsmci *pRMci, uint8_t bBusWidth); 00142 extern void HSMCI_SlotCtl(Hsmci *pRMci, uint8_t bSlot); 00143 extern uint8_t HSMCI_GetSlot(Hsmci *pRMci); 00144 00145 extern void HSMCI_ConfigureWP(Hsmci *pRMci, uint32_t dwConfigure); 00146 extern uint32_t HSMCI_GetWPStatus(Hsmci *pRMci); 00147 00148 #ifdef __cplusplus 00149 } 00150 #endif 00151 00152 /** @}*/ 00153 /**@}*/ 00154 #endif //#ifndef HSMCID_H 00155
1.7.1