1 /* ----------------------------------------------------------------------------
\r
2 * SAM Software Package License
\r
3 * ----------------------------------------------------------------------------
\r
4 * Copyright (c) 2013, Atmel Corporation
\r
6 * All rights reserved.
\r
8 * Redistribution and use in source and binary forms, with or without
\r
9 * modification, are permitted provided that the following conditions are met:
\r
11 * - Redistributions of source code must retain the above copyright notice,
\r
12 * this list of conditions and the disclaimer below.
\r
14 * Atmel's name may not be used to endorse or promote products derived from
\r
15 * this software without specific prior written permission.
\r
17 * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
\r
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
\r
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
\r
20 * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
\r
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
\r
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
\r
23 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
\r
24 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
\r
25 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
\r
26 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\r
27 * ----------------------------------------------------------------------------
\r
32 /** \addtogroup hsmci_module Working with HSMCI
\r
33 * \ingroup mcid_module
\r
37 * The HSMCI driver provides the interface to configure and use the HSMCI
\r
42 * -# HSMCI_Enable(), MCI_Disable(): Enable/Disable HSMCI interface.
\r
43 * -# HSMCI_Reset(): Reset HSMCI interface.
\r
44 * -# HSMCI_Select(): HSMCI slot and buswidth selection
\r
45 * (\ref Hsmci::HSMCI_SDCR).
\r
46 * -# HSMCI_ConfigureMode(): Configure the MCI CLKDIV in the _MR register
\r
47 * (\ref Hsmci::HSMCI_MR).
\r
48 * -# HSMCI_EnableIt(), HSMCI_DisableIt(), HSMCI_GetItMask(), HSMCI_GetStatus()
\r
49 * HSMCI Interrupt control (\ref Hsmci::HSMCI_IER, \ref Hsmci::HSMCI_IDR,
\r
50 * \ref Hsmci::HSMCI_IMR, \ref Hsmci::HSMCI_SR).
\r
51 * -# HSMCI_ConfigureTransfer(): Setup block length and count for MCI transfer
\r
52 * (\ref Hsmci::HSMCI_BLKR).
\r
53 * -# HSMCI_SendCmd(): Send SD/MMC command with argument
\r
54 * (\ref Hsmci::HSMCI_ARGR, \ref Hsmci::HSMCI_CMDR).
\r
55 * -# HSMCI_GetResponse(): Get SD/MMC response after command finished
\r
56 * (\ref Hsmci::HSMCI_RSPR).
\r
57 * -# HSMCI_ConfigureDma(): Configure MCI DMA transfer
\r
58 * (\ref Hsmci::HSMCI_DMA).
\r
59 * -# HSMCI_Configure(): Configure the HSMCI interface (\ref Hsmci::HSMCI_CFG).
\r
60 * -# HSMCI_HsEnable(), HSMCI_IsHsEnabled(): High Speed control.
\r
62 * For more accurate information, please look at the HSMCI section of the
\r
65 * \sa \ref mcid_module
\r
74 /** \addtogroup hsmci_module
\r
78 /*----------------------------------------------------------------------------
\r
80 *----------------------------------------------------------------------------*/
\r
86 /*----------------------------------------------------------------------------
\r
87 * Exported functions
\r
88 *----------------------------------------------------------------------------*/
\r
89 /** \addtogroup hsmci_functions HSMCI Functions
\r
93 extern void HSMCI_Enable(Hsmci* pRMci);
\r
94 extern void HSMCI_Disable(Hsmci* pRMci);
\r
95 extern void HSMCI_Reset(Hsmci* pRMci, uint8_t bBackup);
\r
97 extern void HSMCI_Select(Hsmci * pRMci,uint8_t bSlot,uint8_t bBusWidth);
\r
98 extern void HSMCI_SetSlot(Hsmci * pRMci,uint8_t bSlot);
\r
99 extern void HSMCI_SetBusWidth(Hsmci * pRMci,uint8_t bBusWidth);
\r
100 extern uint8_t HSMCI_GetBusWidth(Hsmci * pRMci);
\r
102 extern void HSMCI_ConfigureMode(Hsmci *pRMci, uint32_t dwMode);
\r
103 extern uint32_t HSMCI_GetMode(Hsmci *pRMci);
\r
104 extern void HSMCI_ProofEnable(Hsmci *pRMci, uint8_t bRdProof, uint8_t bWrProof);
\r
105 extern void HSMCI_PadvCtl(Hsmci *pRMci, uint8_t bPadv);
\r
106 extern void HSMCI_FByteEnable(Hsmci *pRMci, uint8_t bFByteEn);
\r
107 extern uint8_t HSMCI_IsFByteEnabled(Hsmci * pRMci);
\r
108 extern void HSMCI_DivCtrl(Hsmci *pRMci, uint32_t bClkDiv, uint8_t bPwsDiv);
\r
110 extern void HSMCI_EnableIt(Hsmci *pRMci, uint32_t dwSources);
\r
111 extern void HSMCI_DisableIt(Hsmci *pRMci, uint32_t dwSources);
\r
112 extern uint32_t HSMCI_GetItMask(Hsmci *pRMci);
\r
114 extern void HSMCI_ConfigureTransfer(Hsmci * pRMci,uint16_t wBlkLen,uint16_t wCnt);
\r
115 extern void HSMCI_SetBlockLen(Hsmci * pRMci,uint16_t wBlkSize);
\r
116 extern void HSMCI_SetBlockCount(Hsmci * pRMci,uint16_t wBlkCnt);
\r
118 extern void HSMCI_ConfigureCompletionTO(Hsmci *pRMci, uint32_t dwConfigure);
\r
119 extern void HSMCI_ConfigureDataTO(Hsmci *pRMci, uint32_t dwConfigure);
\r
121 extern void HSMCI_SendCmd(Hsmci * pRMci,uint32_t dwCmd,uint32_t dwArg);
\r
122 extern uint32_t HSMCI_GetResponse(Hsmci *pRMci);
\r
123 extern uint32_t HSMCI_Read(Hsmci *pRMci);
\r
124 extern void HSMCI_ReadFifo(Hsmci *pRMci, uint8_t *pdwData, uint32_t dwSize);
\r
125 extern void HSMCI_Write(Hsmci *pRMci, uint32_t dwData);
\r
126 extern void HSMCI_WriteFifo(Hsmci *pRMci, uint8_t *pdwData, uint32_t dwSize);
\r
128 extern uint32_t HSMCI_GetStatus(Hsmci *pRMci);
\r
130 extern void HSMCI_ConfigureDma(Hsmci *pRMci, uint32_t dwConfigure);
\r
131 extern void HSMCI_EnableDma(Hsmci * pRMci,uint8_t bEnable);
\r
133 extern void HSMCI_Configure(Hsmci *pRMci, uint32_t dwConfigure);
\r
134 extern void HSMCI_HsEnable(Hsmci *pRMci, uint8_t bHsEnable);
\r
135 extern uint8_t HSMCI_IsHsEnabled(Hsmci *pRMci);
\r
137 extern void HSMCI_BusWidthCtl(Hsmci *pRMci, uint8_t bBusWidth);
\r
138 extern void HSMCI_SlotCtl(Hsmci *pRMci, uint8_t bSlot);
\r
139 extern uint8_t HSMCI_GetSlot(Hsmci *pRMci);
\r
141 extern void HSMCI_ConfigureWP(Hsmci *pRMci, uint32_t dwConfigure);
\r
142 extern uint32_t HSMCI_GetWPStatus(Hsmci *pRMci);
\r
150 #endif //#ifndef HSMCID_H
\r