source: rtems/c/src/lib/libbsp/arm/atsam/libraries/libchip/include/hsmci.h @ e1eeb883

5
Last change on this file since e1eeb883 was e1eeb883, checked in by Sebastian Huber <sebastian.huber@…>, on 01/12/16 at 14:34:31

bsp/atsam: Import SAM Software Package

Import selected files of the "SAM V71 / V70 / E70 / S70 Software
Package" obtained from the "SAMV71-XULT GNU Software Package 1.5".

Converted files via dos2unix before import.

Update #2529.

  • Property mode set to 100644
File size: 6.8 KB
Line 
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
30/** \file */
31
32/** \addtogroup hsmci_module Working with HSMCI
33 *  \ingroup mcid_module
34 *
35 * \section Purpose
36 *
37 * The HSMCI driver provides the interface to configure and use the HSMCI
38 * peripheral.
39 *
40 * \section Usage
41 *
42 * -# HSMCI_Enable(), MCI_Disable(): Enable/Disable HSMCI interface.
43 * -# HSMCI_Reset(): Reset HSMCI interface.
44 * -# HSMCI_Select(): HSMCI slot and buswidth selection
45 *                    (\ref Hsmci::HSMCI_SDCR).
46 * -# HSMCI_ConfigureMode(): Configure the  MCI CLKDIV in the _MR register
47 *                           (\ref Hsmci::HSMCI_MR).
48 * -# HSMCI_EnableIt(), HSMCI_DisableIt(), HSMCI_GetItMask(), HSMCI_GetStatus()
49 *      HSMCI Interrupt control (\ref Hsmci::HSMCI_IER, \ref Hsmci::HSMCI_IDR,
50 *      \ref Hsmci::HSMCI_IMR, \ref Hsmci::HSMCI_SR).
51 * -# HSMCI_ConfigureTransfer(): Setup block length and count for MCI transfer
52 *                               (\ref Hsmci::HSMCI_BLKR).
53 * -# HSMCI_SendCmd(): Send SD/MMC command with argument
54 *                     (\ref Hsmci::HSMCI_ARGR, \ref Hsmci::HSMCI_CMDR).
55 * -# HSMCI_GetResponse(): Get SD/MMC response after command finished
56 *                         (\ref Hsmci::HSMCI_RSPR).
57 * -# HSMCI_ConfigureDma(): Configure MCI DMA transfer
58 *                          (\ref Hsmci::HSMCI_DMA).
59 * -# HSMCI_Configure(): Configure the HSMCI interface (\ref Hsmci::HSMCI_CFG).
60 * -# HSMCI_HsEnable(), HSMCI_IsHsEnabled(): High Speed control.
61 *
62 * For more accurate information, please look at the HSMCI section of the
63 * Datasheet.
64 *
65 * \sa \ref mcid_module
66 *
67 * Related files :\n
68 * \ref hsmci.h\n
69 * \ref hsmci.c.\n
70 */
71
72#ifndef HSMCID_H
73#define HSMCID_H
74/** \addtogroup hsmci_module
75 *@{
76 */
77
78/*----------------------------------------------------------------------------
79 *         Headers
80 *----------------------------------------------------------------------------*/
81
82#include "chip.h"
83
84#include <stdint.h>
85
86#ifdef __cplusplus
87extern "C" {
88#endif
89/*----------------------------------------------------------------------------
90 *         Exported functions
91 *----------------------------------------------------------------------------*/
92/** \addtogroup hsmci_functions HSMCI Functions
93 *      @{
94 */
95
96extern void HSMCI_Enable(Hsmci *pRMci);
97extern void HSMCI_Disable(Hsmci *pRMci);
98extern void HSMCI_Reset(Hsmci *pRMci, uint8_t bBackup);
99
100extern void HSMCI_Select(Hsmci *pRMci, uint8_t bSlot, uint8_t bBusWidth);
101extern void HSMCI_SetSlot(Hsmci *pRMci, uint8_t bSlot);
102extern void HSMCI_SetBusWidth(Hsmci *pRMci, uint8_t bBusWidth);
103extern uint8_t HSMCI_GetBusWidth(Hsmci *pRMci);
104
105extern void HSMCI_ConfigureMode(Hsmci *pRMci, uint32_t dwMode);
106extern uint32_t HSMCI_GetMode(Hsmci *pRMci);
107extern void HSMCI_ProofEnable(Hsmci *pRMci, uint8_t bRdProof, uint8_t bWrProof);
108extern void HSMCI_PadvCtl(Hsmci *pRMci, uint8_t bPadv);
109extern void HSMCI_FByteEnable(Hsmci *pRMci, uint8_t bFByteEn);
110extern uint8_t HSMCI_IsFByteEnabled(Hsmci *pRMci);
111extern void HSMCI_DivCtrl(Hsmci *pRMci, uint32_t bClkDiv, uint8_t bPwsDiv);
112
113extern void HSMCI_EnableIt(Hsmci *pRMci, uint32_t dwSources);
114extern void HSMCI_DisableIt(Hsmci *pRMci, uint32_t dwSources);
115extern uint32_t HSMCI_GetItMask(Hsmci *pRMci);
116
117extern void HSMCI_ConfigureTransfer(Hsmci *pRMci, uint16_t wBlkLen,
118                                                                        uint16_t wCnt);
119extern void HSMCI_SetBlockLen(Hsmci *pRMci, uint16_t wBlkSize);
120extern void HSMCI_SetBlockCount(Hsmci *pRMci, uint16_t wBlkCnt);
121
122extern void HSMCI_ConfigureCompletionTO(Hsmci *pRMci, uint32_t dwConfigure);
123extern void HSMCI_ConfigureDataTO(Hsmci *pRMci, uint32_t dwConfigure);
124
125extern void HSMCI_SendCmd(Hsmci *pRMci, uint32_t dwCmd, uint32_t dwArg);
126extern uint32_t HSMCI_GetResponse(Hsmci *pRMci);
127extern uint32_t HSMCI_Read(Hsmci *pRMci);
128extern void HSMCI_ReadFifo(Hsmci *pRMci, uint8_t *pdwData, uint32_t dwSize);
129extern void HSMCI_Write(Hsmci *pRMci, uint32_t dwData);
130extern void HSMCI_WriteFifo(Hsmci *pRMci, uint8_t *pdwData, uint32_t dwSize);
131
132extern uint32_t HSMCI_GetStatus(Hsmci *pRMci);
133
134extern void HSMCI_ConfigureDma(Hsmci *pRMci, uint32_t dwConfigure);
135extern void HSMCI_EnableDma(Hsmci *pRMci, uint8_t bEnable);
136
137extern void HSMCI_Configure(Hsmci *pRMci, uint32_t dwConfigure);
138extern void HSMCI_HsEnable(Hsmci *pRMci, uint8_t bHsEnable);
139extern uint8_t HSMCI_IsHsEnabled(Hsmci *pRMci);
140
141extern void HSMCI_BusWidthCtl(Hsmci *pRMci, uint8_t bBusWidth);
142extern void HSMCI_SlotCtl(Hsmci *pRMci, uint8_t bSlot);
143extern uint8_t HSMCI_GetSlot(Hsmci *pRMci);
144
145extern void HSMCI_ConfigureWP(Hsmci *pRMci, uint32_t dwConfigure);
146extern uint32_t HSMCI_GetWPStatus(Hsmci *pRMci);
147
148#ifdef __cplusplus
149}
150#endif
151
152/**     @}*/
153/**@}*/
154#endif //#ifndef HSMCID_H
155
Note: See TracBrowser for help on using the repository browser.