]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_M7_SAMV71_Xplained/libchip_samv7/include/hsmci.h
Update version number ready for V8.2.1 release.
[freertos] / FreeRTOS / Demo / CORTEX_M7_SAMV71_Xplained / libchip_samv7 / include / hsmci.h
1 /* ----------------------------------------------------------------------------\r
2  *         SAM Software Package License \r
3  * ----------------------------------------------------------------------------\r
4  * Copyright (c) 2013, Atmel Corporation\r
5  *\r
6  * All rights reserved.\r
7  *\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
10  *\r
11  * - Redistributions of source code must retain the above copyright notice,\r
12  * this list of conditions and the disclaimer below.\r
13  *\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
16  *\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
28  */\r
29 \r
30 /** \file */\r
31 \r
32 /** \addtogroup hsmci_module Working with HSMCI\r
33  *  \ingroup mcid_module\r
34  *\r
35  * \section Purpose\r
36  *\r
37  * The HSMCI driver provides the interface to configure and use the HSMCI\r
38  * peripheral.\r
39  *\r
40  * \section Usage\r
41  *\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
61  *\r
62  * For more accurate information, please look at the HSMCI section of the\r
63  * Datasheet.\r
64  *\r
65  * \sa \ref mcid_module\r
66  *\r
67  * Related files :\n\r
68  * \ref hsmci.h\n\r
69  * \ref hsmci.c.\n\r
70  */\r
71 \r
72 #ifndef HSMCID_H\r
73 #define HSMCID_H\r
74 /** \addtogroup hsmci_module\r
75  *@{\r
76  */\r
77 \r
78 /*----------------------------------------------------------------------------\r
79  *         Headers\r
80  *----------------------------------------------------------------------------*/\r
81 \r
82 #include "chip.h"\r
83 \r
84 #include <stdint.h>\r
85 \r
86 /*----------------------------------------------------------------------------\r
87  *         Exported functions\r
88  *----------------------------------------------------------------------------*/\r
89 /** \addtogroup hsmci_functions HSMCI Functions\r
90  *      @{\r
91  */\r
92 \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
96 \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
101 \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
109 \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
113 \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
117 \r
118 extern void HSMCI_ConfigureCompletionTO(Hsmci *pRMci, uint32_t dwConfigure);\r
119 extern void HSMCI_ConfigureDataTO(Hsmci *pRMci, uint32_t dwConfigure);\r
120 \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
127 \r
128 extern uint32_t HSMCI_GetStatus(Hsmci *pRMci);\r
129 \r
130 extern void HSMCI_ConfigureDma(Hsmci *pRMci, uint32_t dwConfigure);\r
131 extern void HSMCI_EnableDma(Hsmci * pRMci,uint8_t bEnable);\r
132 \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
136 \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
140 \r
141 extern void HSMCI_ConfigureWP(Hsmci *pRMci, uint32_t dwConfigure);\r
142 extern uint32_t HSMCI_GetWPStatus(Hsmci *pRMci);\r
143 \r
144 #ifdef __cplusplus\r
145 }\r
146 #endif\r
147 \r
148 /**     @}*/\r
149 /**@}*/\r
150 #endif //#ifndef HSMCID_H\r
151 \r