RTEMS  5.0.0
hsmci.h
Go to the documentation of this file.
1 /* ---------------------------------------------------------------------------- */
2 /* Atmel Microcontroller Software Support */
3 /* SAM Software Package License */
4 /* ---------------------------------------------------------------------------- */
5 /* Copyright (c) 2015, Atmel Corporation */
6 /* */
7 /* All rights reserved. */
8 /* */
9 /* Redistribution and use in source and binary forms, with or without */
10 /* modification, are permitted provided that the following condition is met: */
11 /* */
12 /* - Redistributions of source code must retain the above copyright notice, */
13 /* this list of conditions and the disclaimer below. */
14 /* */
15 /* Atmel's name may not be used to endorse or promote products derived from */
16 /* this software without specific prior written permission. */
17 /* */
18 /* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */
19 /* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
20 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */
21 /* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */
22 /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
23 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
24 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
25 /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
26 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
27 /* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
28 /* ---------------------------------------------------------------------------- */
29 
72 #ifndef HSMCID_H
73 #define HSMCID_H
74 
78 /*----------------------------------------------------------------------------
79  * Headers
80  *----------------------------------------------------------------------------*/
81 
82 #include "chip.h"
83 
84 #include <stdint.h>
85 
86 #ifdef __cplusplus
87 extern "C" {
88 #endif
89 /*----------------------------------------------------------------------------
90  * Exported functions
91  *----------------------------------------------------------------------------*/
96 extern void HSMCI_Enable(Hsmci *pRMci);
97 extern void HSMCI_Disable(Hsmci *pRMci);
98 extern void HSMCI_Reset(Hsmci *pRMci, uint8_t bBackup);
99 
100 extern void HSMCI_Select(Hsmci *pRMci, uint8_t bSlot, uint8_t bBusWidth);
101 extern void HSMCI_SetSlot(Hsmci *pRMci, uint8_t bSlot);
102 extern void HSMCI_SetBusWidth(Hsmci *pRMci, uint8_t bBusWidth);
103 extern uint8_t HSMCI_GetBusWidth(Hsmci *pRMci);
104 
105 extern void HSMCI_ConfigureMode(Hsmci *pRMci, uint32_t dwMode);
106 extern uint32_t HSMCI_GetMode(Hsmci *pRMci);
107 extern void HSMCI_ProofEnable(Hsmci *pRMci, uint8_t bRdProof, uint8_t bWrProof);
108 extern void HSMCI_PadvCtl(Hsmci *pRMci, uint8_t bPadv);
109 extern void HSMCI_FByteEnable(Hsmci *pRMci, uint8_t bFByteEn);
110 extern uint8_t HSMCI_IsFByteEnabled(Hsmci *pRMci);
111 extern void HSMCI_DivCtrl(Hsmci *pRMci, uint32_t bClkDiv, uint8_t bPwsDiv);
112 
113 extern void HSMCI_EnableIt(Hsmci *pRMci, uint32_t dwSources);
114 extern void HSMCI_DisableIt(Hsmci *pRMci, uint32_t dwSources);
115 extern uint32_t HSMCI_GetItMask(Hsmci *pRMci);
116 
117 extern void HSMCI_ConfigureTransfer(Hsmci *pRMci, uint16_t wBlkLen,
118  uint16_t wCnt);
119 extern void HSMCI_SetBlockLen(Hsmci *pRMci, uint16_t wBlkSize);
120 extern void HSMCI_SetBlockCount(Hsmci *pRMci, uint16_t wBlkCnt);
121 
122 extern void HSMCI_ConfigureCompletionTO(Hsmci *pRMci, uint32_t dwConfigure);
123 extern void HSMCI_ConfigureDataTO(Hsmci *pRMci, uint32_t dwConfigure);
124 
125 extern void HSMCI_SendCmd(Hsmci *pRMci, uint32_t dwCmd, uint32_t dwArg);
126 extern uint32_t HSMCI_GetResponse(Hsmci *pRMci);
127 extern uint32_t HSMCI_Read(Hsmci *pRMci);
128 extern void HSMCI_ReadFifo(Hsmci *pRMci, uint8_t *pdwData, uint32_t dwSize);
129 extern void HSMCI_Write(Hsmci *pRMci, uint32_t dwData);
130 extern void HSMCI_WriteFifo(Hsmci *pRMci, uint8_t *pdwData, uint32_t dwSize);
131 
132 extern uint32_t HSMCI_GetStatus(Hsmci *pRMci);
133 
134 extern void HSMCI_ConfigureDma(Hsmci *pRMci, uint32_t dwConfigure);
135 extern void HSMCI_EnableDma(Hsmci *pRMci, uint8_t bEnable);
136 
137 extern void HSMCI_Configure(Hsmci *pRMci, uint32_t dwConfigure);
138 extern void HSMCI_HsEnable(Hsmci *pRMci, uint8_t bHsEnable);
139 extern uint8_t HSMCI_IsHsEnabled(Hsmci *pRMci);
140 
141 extern void HSMCI_BusWidthCtl(Hsmci *pRMci, uint8_t bBusWidth);
142 extern void HSMCI_SlotCtl(Hsmci *pRMci, uint8_t bSlot);
143 extern uint8_t HSMCI_GetSlot(Hsmci *pRMci);
144 
145 extern void HSMCI_ConfigureWP(Hsmci *pRMci, uint32_t dwConfigure);
146 extern uint32_t HSMCI_GetWPStatus(Hsmci *pRMci);
147 
148 #ifdef __cplusplus
149 }
150 #endif
151 
154 #endif //#ifndef HSMCID_H
155 
void HSMCI_DisableIt(Hsmci *pRMci, uint32_t dwSources)
Disable one or more interrupt sources of MCI peripheral.
Definition: hsmci.c:294
uint32_t HSMCI_Read(Hsmci *pRMci)
Return the receive data register.
Definition: hsmci.c:401
uint32_t HSMCI_GetItMask(Hsmci *pRMci)
Return the interrupt mask register.
Definition: hsmci.c:305
void HSMCI_HsEnable(Hsmci *pRMci, uint8_t bHsEnable)
Enable/Disable High-Speed mode for MCI.
Definition: hsmci.c:528
void HSMCI_SetBlockLen(Hsmci *pRMci, uint16_t wBlkSize)
Set block length.
Definition: hsmci.c:332
void HSMCI_Configure(Hsmci *pRMci, uint32_t dwConfigure)
Configure the HSMCI.
Definition: hsmci.c:517
uint32_t HSMCI_GetResponse(Hsmci *pRMci)
Return the response register.
Definition: hsmci.c:390
void HSMCI_ConfigureMode(Hsmci *pRMci, uint32_t dwMode)
Configures a MCI peripheral as specified.
Definition: hsmci.c:185
void HSMCI_EnableDma(Hsmci *pRMci, uint8_t bEnable)
Enable the HSMCI DMA.
Definition: hsmci.c:503
void HSMCI_Disable(Hsmci *pRMci)
Disable Multi-Media Interface.
Definition: hsmci.c:65
void HSMCI_ProofEnable(Hsmci *pRMci, uint8_t bRdProof, uint8_t bWrProof)
Enable/Disable R/W proof.
Definition: hsmci.c:207
uint8_t HSMCI_IsHsEnabled(Hsmci *pRMci)
Check if High-speed mode is enabled on MCI.
Definition: hsmci.c:541
void HSMCI_FByteEnable(Hsmci *pRMci, uint8_t bFByteEn)
Force byte transfer enable/disable.
Definition: hsmci.c:236
uint32_t HSMCI_GetWPStatus(Hsmci *pRMci)
Return the write protect status register.
Definition: hsmci.c:563
void HSMCI_WriteFifo(Hsmci *pRMci, uint8_t *pdwData, uint32_t dwSize)
Write to FIFO.
Definition: hsmci.c:453
void HSMCI_Enable(Hsmci *pRMci)
Enable Multi-Media Interface.
Definition: hsmci.c:55
void HSMCI_DivCtrl(Hsmci *pRMci, uint32_t bClkDiv, uint8_t bPwsDiv)
Set Clock Divider & Power save divider for MCI.
Definition: hsmci.c:262
void HSMCI_EnableIt(Hsmci *pRMci, uint32_t dwSources)
Enables one or more interrupt sources of MCI peripheral.
Definition: hsmci.c:283
void HSMCI_SetBusWidth(Hsmci *pRMci, uint8_t bBusWidth)
Set bus width of MCI.
Definition: hsmci.c:141
void HSMCI_ConfigureDma(Hsmci *pRMci, uint32_t dwConfigure)
Configure the HSMCI DMA.
Definition: hsmci.c:492
void HSMCI_ConfigureTransfer(Hsmci *pRMci, uint16_t wBlkLen, uint16_t wCnt)
Set block len & count for transfer.
Definition: hsmci.c:317
uint8_t HSMCI_GetBusWidth(Hsmci *pRMci)
Return bus width setting.
Definition: hsmci.c:166
void HSMCI_SetBlockCount(Hsmci *pRMci, uint16_t wBlkCnt)
Set block (byte) count.
Definition: hsmci.c:343
void HSMCI_Reset(Hsmci *pRMci, uint8_t bBackup)
Reset (& Disable) Multi-Media Interface.
Definition: hsmci.c:78
uint32_t HSMCI_GetMode(Hsmci *pRMci)
Return mode register.
Definition: hsmci.c:195
void HSMCI_ReadFifo(Hsmci *pRMci, uint8_t *pdwData, uint32_t dwSize)
Read from FIFO.
Definition: hsmci.c:413
Hsmci hardware registers.
Definition: component_hsmci.h:41
uint32_t HSMCI_GetStatus(Hsmci *pRMci)
Return the status register.
Definition: hsmci.c:481
void HSMCI_ConfigureCompletionTO(Hsmci *pRMci, uint32_t dwConfigure)
Configure the Completion Signal Timeout.
Definition: hsmci.c:354
uint8_t HSMCI_IsFByteEnabled(Hsmci *pRMci)
Check if Force Byte mode enabled.
Definition: hsmci.c:250
void HSMCI_SendCmd(Hsmci *pRMci, uint32_t dwCmd, uint32_t dwArg)
Send command.
Definition: hsmci.c:377
void HSMCI_ConfigureDataTO(Hsmci *pRMci, uint32_t dwConfigure)
Configure the Data Timeout.
Definition: hsmci.c:365
void HSMCI_PadvCtl(Hsmci *pRMci, uint8_t bPadv)
Padding value setting.
Definition: hsmci.c:222
void HSMCI_SetSlot(Hsmci *pRMci, uint8_t bSlot)
Set slot.
Definition: hsmci.c:130
void HSMCI_Select(Hsmci *pRMci, uint8_t bSlot, uint8_t bBusWidth)
Select slot.
Definition: hsmci.c:105
void HSMCI_Write(Hsmci *pRMci, uint32_t dwData)
Sends data through MCI peripheral.
Definition: hsmci.c:441
void HSMCI_ConfigureWP(Hsmci *pRMci, uint32_t dwConfigure)
Configure the Write Protection Mode.
Definition: hsmci.c:552