annotate Common/Drivers/STM32F4xx_HAL_DRIVER_v120/Inc/stm32f4xx_hal_sd.h @ 81:da9444f53f46 kittz

Created new branch kittz
author Dmitry Romanov <kitt@bk.ru>
date Tue, 20 Nov 2018 09:25:17 +0000
parents 5f11787b4f42
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 * @file stm32f4xx_hal_sd.h
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 * @author MCD Application Team
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 * @version V1.2.0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 * @date 26-December-2014
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 * @brief Header file of SD HAL module.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 * @attention
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 * Redistribution and use in source and binary forms, with or without modification,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 * are permitted provided that the following conditions are met:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 * 1. Redistributions of source code must retain the above copyright notice,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 * this list of conditions and the following disclaimer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 * this list of conditions and the following disclaimer in the documentation
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 * and/or other materials provided with the distribution.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 * may be used to endorse or promote products derived from this software
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 * without specific prior written permission.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 /* Define to prevent recursive inclusion -------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 #ifndef __STM32F4xx_HAL_SD_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 #define __STM32F4xx_HAL_SD_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43 extern "C" {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 /* Includes ------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 #include "stm32f4xx_ll_sdmmc.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 /** @addtogroup STM32F4xx_HAL_Driver
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 /** @defgroup SD SD
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 * @brief SD HAL module driver
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58 /* Exported types ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 /** @defgroup SD_Exported_Types SD Exported Types
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 /** @defgroup SD_Exported_Types_Group1 SD Handle Structure definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 #define SD_InitTypeDef SDIO_InitTypeDef
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 #define SD_TypeDef SDIO_TypeDef
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 SD_TypeDef *Instance; /*!< SDIO register base address */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73 SD_InitTypeDef Init; /*!< SD required parameters */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75 HAL_LockTypeDef Lock; /*!< SD locking object */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 uint32_t CardType; /*!< SD card type */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 uint32_t RCA; /*!< SD relative card address */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 uint32_t CSD[4]; /*!< SD card specific data table */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 uint32_t CID[4]; /*!< SD card identification number table */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 __IO uint32_t SdTransferCplt; /*!< SD transfer complete flag in non blocking mode */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 __IO uint32_t SdTransferErr; /*!< SD transfer error flag in non blocking mode */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89 __IO uint32_t DmaTransferCplt; /*!< SD DMA transfer complete flag */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91 __IO uint32_t SdOperation; /*!< SD transfer operation (read/write) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 DMA_HandleTypeDef *hdmarx; /*!< SD Rx DMA handle parameters */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95 DMA_HandleTypeDef *hdmatx; /*!< SD Tx DMA handle parameters */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97 }SD_HandleTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 /** @defgroup SD_Exported_Types_Group2 Card Specific Data: CSD Register
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 __IO uint8_t CSDStruct; /*!< CSD structure */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 __IO uint8_t SysSpecVersion; /*!< System specification version */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 __IO uint8_t Reserved1; /*!< Reserved */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110 __IO uint8_t TAAC; /*!< Data read access time 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 __IO uint8_t NSAC; /*!< Data read access time 2 in CLK cycles */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 __IO uint8_t MaxBusClkFrec; /*!< Max. bus clock frequency */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 __IO uint16_t CardComdClasses; /*!< Card command classes */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 __IO uint8_t RdBlockLen; /*!< Max. read data block length */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 __IO uint8_t PartBlockRead; /*!< Partial blocks for read allowed */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116 __IO uint8_t WrBlockMisalign; /*!< Write block misalignment */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 __IO uint8_t RdBlockMisalign; /*!< Read block misalignment */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 __IO uint8_t DSRImpl; /*!< DSR implemented */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 __IO uint8_t Reserved2; /*!< Reserved */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 __IO uint32_t DeviceSize; /*!< Device Size */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 __IO uint8_t MaxRdCurrentVDDMin; /*!< Max. read current @ VDD min */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 __IO uint8_t MaxRdCurrentVDDMax; /*!< Max. read current @ VDD max */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 __IO uint8_t MaxWrCurrentVDDMin; /*!< Max. write current @ VDD min */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 __IO uint8_t MaxWrCurrentVDDMax; /*!< Max. write current @ VDD max */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125 __IO uint8_t DeviceSizeMul; /*!< Device size multiplier */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 __IO uint8_t EraseGrSize; /*!< Erase group size */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 __IO uint8_t EraseGrMul; /*!< Erase group size multiplier */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 __IO uint8_t WrProtectGrSize; /*!< Write protect group size */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 __IO uint8_t WrProtectGrEnable; /*!< Write protect group enable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 __IO uint8_t ManDeflECC; /*!< Manufacturer default ECC */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 __IO uint8_t WrSpeedFact; /*!< Write speed factor */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132 __IO uint8_t MaxWrBlockLen; /*!< Max. write data block length */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 __IO uint8_t WriteBlockPaPartial; /*!< Partial blocks for write allowed */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 __IO uint8_t Reserved3; /*!< Reserved */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 __IO uint8_t ContentProtectAppli; /*!< Content protection application */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 __IO uint8_t FileFormatGrouop; /*!< File format group */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 __IO uint8_t CopyFlag; /*!< Copy flag (OTP) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138 __IO uint8_t PermWrProtect; /*!< Permanent write protection */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 __IO uint8_t TempWrProtect; /*!< Temporary write protection */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 __IO uint8_t FileFormat; /*!< File format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 __IO uint8_t ECC; /*!< ECC code */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 __IO uint8_t CSD_CRC; /*!< CSD CRC */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 __IO uint8_t Reserved4; /*!< Always 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 }HAL_SD_CSDTypedef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 /** @defgroup SD_Exported_Types_Group3 Card Identification Data: CID Register
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 __IO uint8_t ManufacturerID; /*!< Manufacturer ID */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 __IO uint16_t OEM_AppliID; /*!< OEM/Application ID */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 __IO uint32_t ProdName1; /*!< Product Name part1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 __IO uint8_t ProdName2; /*!< Product Name part2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 __IO uint8_t ProdRev; /*!< Product Revision */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 __IO uint32_t ProdSN; /*!< Product Serial Number */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 __IO uint8_t Reserved1; /*!< Reserved1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 __IO uint16_t ManufactDate; /*!< Manufacturing Date */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 __IO uint8_t CID_CRC; /*!< CID CRC */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 __IO uint8_t Reserved2; /*!< Always 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166 }HAL_SD_CIDTypedef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171 /** @defgroup SD_Exported_Types_Group4 SD Card Status returned by ACMD13
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176 __IO uint8_t DAT_BUS_WIDTH; /*!< Shows the currently defined data bus width */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 __IO uint8_t SECURED_MODE; /*!< Card is in secured mode of operation */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 __IO uint16_t SD_CARD_TYPE; /*!< Carries information about card type */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 __IO uint32_t SIZE_OF_PROTECTED_AREA; /*!< Carries information about the capacity of protected area */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 __IO uint8_t SPEED_CLASS; /*!< Carries information about the speed class of the card */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181 __IO uint8_t PERFORMANCE_MOVE; /*!< Carries information about the card's performance move */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182 __IO uint8_t AU_SIZE; /*!< Carries information about the card's allocation unit size */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 __IO uint16_t ERASE_SIZE; /*!< Determines the number of AUs to be erased in one operation */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184 __IO uint8_t ERASE_TIMEOUT; /*!< Determines the timeout for any number of AU erase */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 __IO uint8_t ERASE_OFFSET; /*!< Carries information about the erase offset */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187 }HAL_SD_CardStatusTypedef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 /** @defgroup SD_Exported_Types_Group5 SD Card information structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 HAL_SD_CSDTypedef SD_csd; /*!< SD card specific data register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 HAL_SD_CIDTypedef SD_cid; /*!< SD card identification number register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 uint64_t CardCapacity; /*!< Card capacity */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200 uint32_t CardBlockSize; /*!< Card block size */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 uint16_t RCA; /*!< SD relative card address */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202 uint8_t CardType; /*!< SD card type */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 }HAL_SD_CardInfoTypedef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 /** @defgroup SD_Exported_Types_Group6 SD Error status enumeration Structure definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 typedef enum
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 * @brief SD specific error defines
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 SD_CMD_CRC_FAIL = (1), /*!< Command response received (but CRC check failed) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 SD_DATA_CRC_FAIL = (2), /*!< Data block sent/received (CRC check failed) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 SD_CMD_RSP_TIMEOUT = (3), /*!< Command response timeout */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 SD_DATA_TIMEOUT = (4), /*!< Data timeout */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 SD_TX_UNDERRUN = (5), /*!< Transmit FIFO underrun */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 SD_RX_OVERRUN = (6), /*!< Receive FIFO overrun */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 SD_START_BIT_ERR = (7), /*!< Start bit not detected on all data signals in wide bus mode */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 SD_CMD_OUT_OF_RANGE = (8), /*!< Command's argument was out of range. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 SD_ADDR_MISALIGNED = (9), /*!< Misaligned address */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 SD_BLOCK_LEN_ERR = (10), /*!< Transferred block length is not allowed for the card or the number of transferred bytes does not match the block length */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 SD_ERASE_SEQ_ERR = (11), /*!< An error in the sequence of erase command occurs. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 SD_BAD_ERASE_PARAM = (12), /*!< An invalid selection for erase groups */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 SD_WRITE_PROT_VIOLATION = (13), /*!< Attempt to program a write protect block */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 SD_LOCK_UNLOCK_FAILED = (14), /*!< Sequence or password error has been detected in unlock command or if there was an attempt to access a locked card */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 SD_COM_CRC_FAILED = (15), /*!< CRC check of the previous command failed */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 SD_ILLEGAL_CMD = (16), /*!< Command is not legal for the card state */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 SD_CARD_ECC_FAILED = (17), /*!< Card internal ECC was applied but failed to correct the data */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 SD_CC_ERROR = (18), /*!< Internal card controller error */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 SD_GENERAL_UNKNOWN_ERROR = (19), /*!< General or unknown error */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 SD_STREAM_READ_UNDERRUN = (20), /*!< The card could not sustain data transfer in stream read operation. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 SD_STREAM_WRITE_OVERRUN = (21), /*!< The card could not sustain data programming in stream mode */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 SD_CID_CSD_OVERWRITE = (22), /*!< CID/CSD overwrite error */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 SD_WP_ERASE_SKIP = (23), /*!< Only partial address space was erased */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240 SD_CARD_ECC_DISABLED = (24), /*!< Command has been executed without using internal ECC */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 SD_ERASE_RESET = (25), /*!< Erase sequence was cleared before executing because an out of erase sequence command was received */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242 SD_AKE_SEQ_ERROR = (26), /*!< Error in sequence of authentication. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 SD_INVALID_VOLTRANGE = (27),
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 SD_ADDR_OUT_OF_RANGE = (28),
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 SD_SWITCH_ERROR = (29),
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 SD_SDIO_DISABLED = (30),
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 SD_SDIO_FUNCTION_BUSY = (31),
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 SD_SDIO_FUNCTION_FAILED = (32),
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 SD_SDIO_UNKNOWN_FUNCTION = (33),
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 * @brief Standard error defines
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 SD_INTERNAL_ERROR = (34),
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 SD_NOT_CONFIGURED = (35),
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256 SD_REQUEST_PENDING = (36),
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257 SD_REQUEST_NOT_APPLICABLE = (37),
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 SD_INVALID_PARAMETER = (38),
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259 SD_UNSUPPORTED_FEATURE = (39),
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260 SD_UNSUPPORTED_HW = (40),
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 SD_ERROR = (41),
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 SD_OK = (0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264 }HAL_SD_ErrorTypedef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 /** @defgroup SD_Exported_Types_Group7 SD Transfer state enumeration structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272 typedef enum
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274 SD_TRANSFER_OK = 0, /*!< Transfer success */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 SD_TRANSFER_BUSY = 1, /*!< Transfer is occurring */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 SD_TRANSFER_ERROR = 2 /*!< Transfer failed */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 }HAL_SD_TransferStateTypedef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 /** @defgroup SD_Exported_Types_Group8 SD Card State enumeration structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 typedef enum
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 SD_CARD_READY = ((uint32_t)0x00000001), /*!< Card state is ready */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 SD_CARD_IDENTIFICATION = ((uint32_t)0x00000002), /*!< Card is in identification state */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 SD_CARD_STANDBY = ((uint32_t)0x00000003), /*!< Card is in standby state */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291 SD_CARD_TRANSFER = ((uint32_t)0x00000004), /*!< Card is in transfer state */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292 SD_CARD_SENDING = ((uint32_t)0x00000005), /*!< Card is sending an operation */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293 SD_CARD_RECEIVING = ((uint32_t)0x00000006), /*!< Card is receiving operation information */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294 SD_CARD_PROGRAMMING = ((uint32_t)0x00000007), /*!< Card is in programming state */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 SD_CARD_DISCONNECTED = ((uint32_t)0x00000008), /*!< Card is disconnected */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296 SD_CARD_ERROR = ((uint32_t)0x000000FF) /*!< Card is in error state */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 }HAL_SD_CardStateTypedef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303 /** @defgroup SD_Exported_Types_Group9 SD Operation enumeration structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 typedef enum
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308 SD_READ_SINGLE_BLOCK = 0, /*!< Read single block operation */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 SD_READ_MULTIPLE_BLOCK = 1, /*!< Read multiple blocks operation */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310 SD_WRITE_SINGLE_BLOCK = 2, /*!< Write single block operation */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 SD_WRITE_MULTIPLE_BLOCK = 3 /*!< Write multiple blocks operation */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 }HAL_SD_OperationTypedef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322 /* Exported constants --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323 /** @defgroup SD_Exported_Constants SD Exported Constants
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
324 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
325 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
326
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
327 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328 * @brief SD Commands Index
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330 #define SD_CMD_GO_IDLE_STATE ((uint8_t)0) /*!< Resets the SD memory card. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331 #define SD_CMD_SEND_OP_COND ((uint8_t)1) /*!< Sends host capacity support information and activates the card's initialization process. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332 #define SD_CMD_ALL_SEND_CID ((uint8_t)2) /*!< Asks any card connected to the host to send the CID numbers on the CMD line. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333 #define SD_CMD_SET_REL_ADDR ((uint8_t)3) /*!< Asks the card to publish a new relative address (RCA). */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334 #define SD_CMD_SET_DSR ((uint8_t)4) /*!< Programs the DSR of all cards. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335 #define SD_CMD_SDIO_SEN_OP_COND ((uint8_t)5) /*!< Sends host capacity support information (HCS) and asks the accessed card to send its
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
336 operating condition register (OCR) content in the response on the CMD line. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
337 #define SD_CMD_HS_SWITCH ((uint8_t)6) /*!< Checks switchable function (mode 0) and switch card function (mode 1). */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
338 #define SD_CMD_SEL_DESEL_CARD ((uint8_t)7) /*!< Selects the card by its own relative address and gets deselected by any other address */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
339 #define SD_CMD_HS_SEND_EXT_CSD ((uint8_t)8) /*!< Sends SD Memory Card interface condition, which includes host supply voltage information
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340 and asks the card whether card supports voltage. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341 #define SD_CMD_SEND_CSD ((uint8_t)9) /*!< Addressed card sends its card specific data (CSD) on the CMD line. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
342 #define SD_CMD_SEND_CID ((uint8_t)10) /*!< Addressed card sends its card identification (CID) on the CMD line. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
343 #define SD_CMD_READ_DAT_UNTIL_STOP ((uint8_t)11) /*!< SD card doesn't support it. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
344 #define SD_CMD_STOP_TRANSMISSION ((uint8_t)12) /*!< Forces the card to stop transmission. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
345 #define SD_CMD_SEND_STATUS ((uint8_t)13) /*!< Addressed card sends its status register. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
346 #define SD_CMD_HS_BUSTEST_READ ((uint8_t)14)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
347 #define SD_CMD_GO_INACTIVE_STATE ((uint8_t)15) /*!< Sends an addressed card into the inactive state. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
348 #define SD_CMD_SET_BLOCKLEN ((uint8_t)16) /*!< Sets the block length (in bytes for SDSC) for all following block commands
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
349 (read, write, lock). Default block length is fixed to 512 Bytes. Not effective
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
350 for SDHS and SDXC. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351 #define SD_CMD_READ_SINGLE_BLOCK ((uint8_t)17) /*!< Reads single block of size selected by SET_BLOCKLEN in case of SDSC, and a block of
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
352 fixed 512 bytes in case of SDHC and SDXC. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
353 #define SD_CMD_READ_MULT_BLOCK ((uint8_t)18) /*!< Continuously transfers data blocks from card to host until interrupted by
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
354 STOP_TRANSMISSION command. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
355 #define SD_CMD_HS_BUSTEST_WRITE ((uint8_t)19) /*!< 64 bytes tuning pattern is sent for SDR50 and SDR104. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
356 #define SD_CMD_WRITE_DAT_UNTIL_STOP ((uint8_t)20) /*!< Speed class control command. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
357 #define SD_CMD_SET_BLOCK_COUNT ((uint8_t)23) /*!< Specify block count for CMD18 and CMD25. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
358 #define SD_CMD_WRITE_SINGLE_BLOCK ((uint8_t)24) /*!< Writes single block of size selected by SET_BLOCKLEN in case of SDSC, and a block of
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
359 fixed 512 bytes in case of SDHC and SDXC. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
360 #define SD_CMD_WRITE_MULT_BLOCK ((uint8_t)25) /*!< Continuously writes blocks of data until a STOP_TRANSMISSION follows. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
361 #define SD_CMD_PROG_CID ((uint8_t)26) /*!< Reserved for manufacturers. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
362 #define SD_CMD_PROG_CSD ((uint8_t)27) /*!< Programming of the programmable bits of the CSD. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
363 #define SD_CMD_SET_WRITE_PROT ((uint8_t)28) /*!< Sets the write protection bit of the addressed group. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
364 #define SD_CMD_CLR_WRITE_PROT ((uint8_t)29) /*!< Clears the write protection bit of the addressed group. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365 #define SD_CMD_SEND_WRITE_PROT ((uint8_t)30) /*!< Asks the card to send the status of the write protection bits. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366 #define SD_CMD_SD_ERASE_GRP_START ((uint8_t)32) /*!< Sets the address of the first write block to be erased. (For SD card only). */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367 #define SD_CMD_SD_ERASE_GRP_END ((uint8_t)33) /*!< Sets the address of the last write block of the continuous range to be erased. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368 #define SD_CMD_ERASE_GRP_START ((uint8_t)35) /*!< Sets the address of the first write block to be erased. Reserved for each command
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
369 system set by switch function command (CMD6). */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370 #define SD_CMD_ERASE_GRP_END ((uint8_t)36) /*!< Sets the address of the last write block of the continuous range to be erased.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371 Reserved for each command system set by switch function command (CMD6). */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
372 #define SD_CMD_ERASE ((uint8_t)38) /*!< Reserved for SD security applications. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
373 #define SD_CMD_FAST_IO ((uint8_t)39) /*!< SD card doesn't support it (Reserved). */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
374 #define SD_CMD_GO_IRQ_STATE ((uint8_t)40) /*!< SD card doesn't support it (Reserved). */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
375 #define SD_CMD_LOCK_UNLOCK ((uint8_t)42) /*!< Sets/resets the password or lock/unlock the card. The size of the data block is set by
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
376 the SET_BLOCK_LEN command. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
377 #define SD_CMD_APP_CMD ((uint8_t)55) /*!< Indicates to the card that the next command is an application specific command rather
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378 than a standard command. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379 #define SD_CMD_GEN_CMD ((uint8_t)56) /*!< Used either to transfer a data block to the card or to get a data block from the card
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380 for general purpose/application specific commands. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
381 #define SD_CMD_NO_CMD ((uint8_t)64)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
382
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
383 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
384 * @brief Following commands are SD Card Specific commands.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
385 * SDIO_APP_CMD should be sent before sending these commands.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
386 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
387 #define SD_CMD_APP_SD_SET_BUSWIDTH ((uint8_t)6) /*!< (ACMD6) Defines the data bus width to be used for data transfer. The allowed data bus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
388 widths are given in SCR register. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
389 #define SD_CMD_SD_APP_STATUS ((uint8_t)13) /*!< (ACMD13) Sends the SD status. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
390 #define SD_CMD_SD_APP_SEND_NUM_WRITE_BLOCKS ((uint8_t)22) /*!< (ACMD22) Sends the number of the written (without errors) write blocks. Responds with
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
391 32bit+CRC data block. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
392 #define SD_CMD_SD_APP_OP_COND ((uint8_t)41) /*!< (ACMD41) Sends host capacity support information (HCS) and asks the accessed card to
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
393 send its operating condition register (OCR) content in the response on the CMD line. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
394 #define SD_CMD_SD_APP_SET_CLR_CARD_DETECT ((uint8_t)42) /*!< (ACMD42) Connects/Disconnects the 50 KOhm pull-up resistor on CD/DAT3 (pin 1) of the card. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
395 #define SD_CMD_SD_APP_SEND_SCR ((uint8_t)51) /*!< Reads the SD Configuration Register (SCR). */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
396 #define SD_CMD_SDIO_RW_DIRECT ((uint8_t)52) /*!< For SD I/O card only, reserved for security specification. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
397 #define SD_CMD_SDIO_RW_EXTENDED ((uint8_t)53) /*!< For SD I/O card only, reserved for security specification. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
398
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
399 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400 * @brief Following commands are SD Card Specific security commands.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401 * SD_CMD_APP_CMD should be sent before sending these commands.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403 #define SD_CMD_SD_APP_GET_MKB ((uint8_t)43) /*!< For SD card only */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404 #define SD_CMD_SD_APP_GET_MID ((uint8_t)44) /*!< For SD card only */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405 #define SD_CMD_SD_APP_SET_CER_RN1 ((uint8_t)45) /*!< For SD card only */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
406 #define SD_CMD_SD_APP_GET_CER_RN2 ((uint8_t)46) /*!< For SD card only */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407 #define SD_CMD_SD_APP_SET_CER_RES2 ((uint8_t)47) /*!< For SD card only */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
408 #define SD_CMD_SD_APP_GET_CER_RES1 ((uint8_t)48) /*!< For SD card only */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
409 #define SD_CMD_SD_APP_SECURE_READ_MULTIPLE_BLOCK ((uint8_t)18) /*!< For SD card only */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
410 #define SD_CMD_SD_APP_SECURE_WRITE_MULTIPLE_BLOCK ((uint8_t)25) /*!< For SD card only */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
411 #define SD_CMD_SD_APP_SECURE_ERASE ((uint8_t)38) /*!< For SD card only */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
412 #define SD_CMD_SD_APP_CHANGE_SECURE_AREA ((uint8_t)49) /*!< For SD card only */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
413 #define SD_CMD_SD_APP_SECURE_WRITE_MKB ((uint8_t)48) /*!< For SD card only */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
414
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
415 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
416 * @brief Supported SD Memory Cards
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418 #define STD_CAPACITY_SD_CARD_V1_1 ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419 #define STD_CAPACITY_SD_CARD_V2_0 ((uint32_t)0x00000001)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420 #define HIGH_CAPACITY_SD_CARD ((uint32_t)0x00000002)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421 #define MULTIMEDIA_CARD ((uint32_t)0x00000003)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
422 #define SECURE_DIGITAL_IO_CARD ((uint32_t)0x00000004)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423 #define HIGH_SPEED_MULTIMEDIA_CARD ((uint32_t)0x00000005)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
424 #define SECURE_DIGITAL_IO_COMBO_CARD ((uint32_t)0x00000006)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
425 #define HIGH_CAPACITY_MMC_CARD ((uint32_t)0x00000007)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
426 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
427 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
428 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
429
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430 /* Exported macro ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431 /** @defgroup SD_Exported_macros SD Exported Macros
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
432 * @brief macros to handle interrupts and specific clock configurations
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
433 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
434 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
435
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
436 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
437 * @brief Enable the SD device.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
438 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
439 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
440 #define __HAL_SD_SDIO_ENABLE() __SDIO_ENABLE()
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
441
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443 * @brief Disable the SD device.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446 #define __HAL_SD_SDIO_DISABLE() __SDIO_DISABLE()
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
448 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
449 * @brief Enable the SDIO DMA transfer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
450 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
451 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
452 #define __HAL_SD_SDIO_DMA_ENABLE() __SDIO_DMA_ENABLE()
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
453
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
454 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
455 * @brief Disable the SDIO DMA transfer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
456 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
457 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
458 #define __HAL_SD_SDIO_DMA_DISABLE() __SDIO_DMA_DISABLE()
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
459
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
460 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
461 * @brief Enable the SD device interrupt.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
462 * @param __HANDLE__: SD Handle
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
463 * @param __INTERRUPT__: specifies the SDIO interrupt sources to be enabled.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
464 * This parameter can be one or a combination of the following values:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
465 * @arg SDIO_IT_CCRCFAIL: Command response received (CRC check failed) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
466 * @arg SDIO_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
467 * @arg SDIO_IT_CTIMEOUT: Command response timeout interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
468 * @arg SDIO_IT_DTIMEOUT: Data timeout interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
469 * @arg SDIO_IT_TXUNDERR: Transmit FIFO underrun error interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
470 * @arg SDIO_IT_RXOVERR: Received FIFO overrun error interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
471 * @arg SDIO_IT_CMDREND: Command response received (CRC check passed) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
472 * @arg SDIO_IT_CMDSENT: Command sent (no response required) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
473 * @arg SDIO_IT_DATAEND: Data end (data counter, SDIDCOUNT, is zero) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
474 * @arg SDIO_IT_STBITERR: Start bit not detected on all data signals in wide
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
475 * bus mode interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
476 * @arg SDIO_IT_DBCKEND: Data block sent/received (CRC check passed) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
477 * @arg SDIO_IT_CMDACT: Command transfer in progress interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
478 * @arg SDIO_IT_TXACT: Data transmit in progress interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
479 * @arg SDIO_IT_RXACT: Data receive in progress interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
480 * @arg SDIO_IT_TXFIFOHE: Transmit FIFO Half Empty interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
481 * @arg SDIO_IT_RXFIFOHF: Receive FIFO Half Full interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
482 * @arg SDIO_IT_TXFIFOF: Transmit FIFO full interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
483 * @arg SDIO_IT_RXFIFOF: Receive FIFO full interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
484 * @arg SDIO_IT_TXFIFOE: Transmit FIFO empty interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
485 * @arg SDIO_IT_RXFIFOE: Receive FIFO empty interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
486 * @arg SDIO_IT_TXDAVL: Data available in transmit FIFO interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
487 * @arg SDIO_IT_RXDAVL: Data available in receive FIFO interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
488 * @arg SDIO_IT_SDIOIT: SD I/O interrupt received interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
489 * @arg SDIO_IT_CEATAEND: CE-ATA command completion signal received for CMD61 interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
490 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
491 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
492 #define __HAL_SD_SDIO_ENABLE_IT(__HANDLE__, __INTERRUPT__) __SDIO_ENABLE_IT((__HANDLE__)->Instance, (__INTERRUPT__))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
493
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
494 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
495 * @brief Disable the SD device interrupt.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
496 * @param __HANDLE__: SD Handle
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
497 * @param __INTERRUPT__: specifies the SDIO interrupt sources to be disabled.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
498 * This parameter can be one or a combination of the following values:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
499 * @arg SDIO_IT_CCRCFAIL: Command response received (CRC check failed) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
500 * @arg SDIO_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
501 * @arg SDIO_IT_CTIMEOUT: Command response timeout interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
502 * @arg SDIO_IT_DTIMEOUT: Data timeout interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
503 * @arg SDIO_IT_TXUNDERR: Transmit FIFO underrun error interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
504 * @arg SDIO_IT_RXOVERR: Received FIFO overrun error interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
505 * @arg SDIO_IT_CMDREND: Command response received (CRC check passed) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
506 * @arg SDIO_IT_CMDSENT: Command sent (no response required) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
507 * @arg SDIO_IT_DATAEND: Data end (data counter, SDIDCOUNT, is zero) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
508 * @arg SDIO_IT_STBITERR: Start bit not detected on all data signals in wide
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
509 * bus mode interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
510 * @arg SDIO_IT_DBCKEND: Data block sent/received (CRC check passed) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
511 * @arg SDIO_IT_CMDACT: Command transfer in progress interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
512 * @arg SDIO_IT_TXACT: Data transmit in progress interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
513 * @arg SDIO_IT_RXACT: Data receive in progress interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
514 * @arg SDIO_IT_TXFIFOHE: Transmit FIFO Half Empty interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
515 * @arg SDIO_IT_RXFIFOHF: Receive FIFO Half Full interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
516 * @arg SDIO_IT_TXFIFOF: Transmit FIFO full interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
517 * @arg SDIO_IT_RXFIFOF: Receive FIFO full interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
518 * @arg SDIO_IT_TXFIFOE: Transmit FIFO empty interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
519 * @arg SDIO_IT_RXFIFOE: Receive FIFO empty interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
520 * @arg SDIO_IT_TXDAVL: Data available in transmit FIFO interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
521 * @arg SDIO_IT_RXDAVL: Data available in receive FIFO interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
522 * @arg SDIO_IT_SDIOIT: SD I/O interrupt received interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
523 * @arg SDIO_IT_CEATAEND: CE-ATA command completion signal received for CMD61 interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
524 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
525 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
526 #define __HAL_SD_SDIO_DISABLE_IT(__HANDLE__, __INTERRUPT__) __SDIO_DISABLE_IT((__HANDLE__)->Instance, (__INTERRUPT__))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
527
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
528 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
529 * @brief Check whether the specified SD flag is set or not.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
530 * @param __HANDLE__: SD Handle
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
531 * @param __FLAG__: specifies the flag to check.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
532 * This parameter can be one of the following values:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
533 * @arg SDIO_FLAG_CCRCFAIL: Command response received (CRC check failed)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
534 * @arg SDIO_FLAG_DCRCFAIL: Data block sent/received (CRC check failed)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
535 * @arg SDIO_FLAG_CTIMEOUT: Command response timeout
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
536 * @arg SDIO_FLAG_DTIMEOUT: Data timeout
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
537 * @arg SDIO_FLAG_TXUNDERR: Transmit FIFO underrun error
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
538 * @arg SDIO_FLAG_RXOVERR: Received FIFO overrun error
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
539 * @arg SDIO_FLAG_CMDREND: Command response received (CRC check passed)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
540 * @arg SDIO_FLAG_CMDSENT: Command sent (no response required)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
541 * @arg SDIO_FLAG_DATAEND: Data end (data counter, SDIDCOUNT, is zero)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
542 * @arg SDIO_FLAG_STBITERR: Start bit not detected on all data signals in wide bus mode.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
543 * @arg SDIO_FLAG_DBCKEND: Data block sent/received (CRC check passed)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
544 * @arg SDIO_FLAG_CMDACT: Command transfer in progress
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
545 * @arg SDIO_FLAG_TXACT: Data transmit in progress
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
546 * @arg SDIO_FLAG_RXACT: Data receive in progress
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
547 * @arg SDIO_FLAG_TXFIFOHE: Transmit FIFO Half Empty
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
548 * @arg SDIO_FLAG_RXFIFOHF: Receive FIFO Half Full
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
549 * @arg SDIO_FLAG_TXFIFOF: Transmit FIFO full
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
550 * @arg SDIO_FLAG_RXFIFOF: Receive FIFO full
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
551 * @arg SDIO_FLAG_TXFIFOE: Transmit FIFO empty
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
552 * @arg SDIO_FLAG_RXFIFOE: Receive FIFO empty
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
553 * @arg SDIO_FLAG_TXDAVL: Data available in transmit FIFO
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
554 * @arg SDIO_FLAG_RXDAVL: Data available in receive FIFO
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
555 * @arg SDIO_FLAG_SDIOIT: SD I/O interrupt received
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
556 * @arg SDIO_FLAG_CEATAEND: CE-ATA command completion signal received for CMD61
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
557 * @retval The new state of SD FLAG (SET or RESET).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
558 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
559 #define __HAL_SD_SDIO_GET_FLAG(__HANDLE__, __FLAG__) __SDIO_GET_FLAG((__HANDLE__)->Instance, (__FLAG__))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
560
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
561 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
562 * @brief Clear the SD's pending flags.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
563 * @param __HANDLE__: SD Handle
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
564 * @param __FLAG__: specifies the flag to clear.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
565 * This parameter can be one or a combination of the following values:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
566 * @arg SDIO_FLAG_CCRCFAIL: Command response received (CRC check failed)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
567 * @arg SDIO_FLAG_DCRCFAIL: Data block sent/received (CRC check failed)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
568 * @arg SDIO_FLAG_CTIMEOUT: Command response timeout
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
569 * @arg SDIO_FLAG_DTIMEOUT: Data timeout
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
570 * @arg SDIO_FLAG_TXUNDERR: Transmit FIFO underrun error
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571 * @arg SDIO_FLAG_RXOVERR: Received FIFO overrun error
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
572 * @arg SDIO_FLAG_CMDREND: Command response received (CRC check passed)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
573 * @arg SDIO_FLAG_CMDSENT: Command sent (no response required)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
574 * @arg SDIO_FLAG_DATAEND: Data end (data counter, SDIDCOUNT, is zero)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
575 * @arg SDIO_FLAG_STBITERR: Start bit not detected on all data signals in wide bus mode
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
576 * @arg SDIO_FLAG_DBCKEND: Data block sent/received (CRC check passed)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
577 * @arg SDIO_FLAG_SDIOIT: SD I/O interrupt received
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
578 * @arg SDIO_FLAG_CEATAEND: CE-ATA command completion signal received for CMD61
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
579 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
580 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
581 #define __HAL_SD_SDIO_CLEAR_FLAG(__HANDLE__, __FLAG__) __SDIO_CLEAR_FLAG((__HANDLE__)->Instance, (__FLAG__))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
582
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
583 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
584 * @brief Check whether the specified SD interrupt has occurred or not.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
585 * @param __HANDLE__: SD Handle
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
586 * @param __INTERRUPT__: specifies the SDIO interrupt source to check.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
587 * This parameter can be one of the following values:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
588 * @arg SDIO_IT_CCRCFAIL: Command response received (CRC check failed) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
589 * @arg SDIO_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
590 * @arg SDIO_IT_CTIMEOUT: Command response timeout interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
591 * @arg SDIO_IT_DTIMEOUT: Data timeout interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
592 * @arg SDIO_IT_TXUNDERR: Transmit FIFO underrun error interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
593 * @arg SDIO_IT_RXOVERR: Received FIFO overrun error interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
594 * @arg SDIO_IT_CMDREND: Command response received (CRC check passed) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
595 * @arg SDIO_IT_CMDSENT: Command sent (no response required) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
596 * @arg SDIO_IT_DATAEND: Data end (data counter, SDIDCOUNT, is zero) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
597 * @arg SDIO_IT_STBITERR: Start bit not detected on all data signals in wide
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
598 * bus mode interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
599 * @arg SDIO_IT_DBCKEND: Data block sent/received (CRC check passed) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
600 * @arg SDIO_IT_CMDACT: Command transfer in progress interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
601 * @arg SDIO_IT_TXACT: Data transmit in progress interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
602 * @arg SDIO_IT_RXACT: Data receive in progress interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
603 * @arg SDIO_IT_TXFIFOHE: Transmit FIFO Half Empty interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
604 * @arg SDIO_IT_RXFIFOHF: Receive FIFO Half Full interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
605 * @arg SDIO_IT_TXFIFOF: Transmit FIFO full interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
606 * @arg SDIO_IT_RXFIFOF: Receive FIFO full interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
607 * @arg SDIO_IT_TXFIFOE: Transmit FIFO empty interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
608 * @arg SDIO_IT_RXFIFOE: Receive FIFO empty interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
609 * @arg SDIO_IT_TXDAVL: Data available in transmit FIFO interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
610 * @arg SDIO_IT_RXDAVL: Data available in receive FIFO interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
611 * @arg SDIO_IT_SDIOIT: SD I/O interrupt received interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
612 * @arg SDIO_IT_CEATAEND: CE-ATA command completion signal received for CMD61 interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
613 * @retval The new state of SD IT (SET or RESET).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
614 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
615 #define __HAL_SD_SDIO_GET_IT (__HANDLE__, __INTERRUPT__) __SDIO_GET_IT ((__HANDLE__)->Instance, __INTERRUPT__)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
616
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
617 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
618 * @brief Clear the SD's interrupt pending bits.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
619 * @param __HANDLE__ : SD Handle
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
620 * @param __INTERRUPT__: specifies the interrupt pending bit to clear.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
621 * This parameter can be one or a combination of the following values:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
622 * @arg SDIO_IT_CCRCFAIL: Command response received (CRC check failed) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
623 * @arg SDIO_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
624 * @arg SDIO_IT_CTIMEOUT: Command response timeout interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
625 * @arg SDIO_IT_DTIMEOUT: Data timeout interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
626 * @arg SDIO_IT_TXUNDERR: Transmit FIFO underrun error interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
627 * @arg SDIO_IT_RXOVERR: Received FIFO overrun error interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
628 * @arg SDIO_IT_CMDREND: Command response received (CRC check passed) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
629 * @arg SDIO_IT_CMDSENT: Command sent (no response required) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
630 * @arg SDIO_IT_DATAEND: Data end (data counter, SDIO_DCOUNT, is zero) interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
631 * @arg SDIO_IT_STBITERR: Start bit not detected on all data signals in wide
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
632 * bus mode interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
633 * @arg SDIO_IT_SDIOIT: SD I/O interrupt received interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
634 * @arg SDIO_IT_CEATAEND: CE-ATA command completion signal received for CMD61
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
635 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
636 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
637 #define __HAL_SD_SDIO_CLEAR_IT(__HANDLE__, __INTERRUPT__) __SDIO_CLEAR_IT((__HANDLE__)->Instance, (__INTERRUPT__))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
638 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
639 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
640 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
641
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
642 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
643 /** @defgroup SD_Exported_Functions SD Exported Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
644 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
645 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
646
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
647 /** @defgroup SD_Exported_Functions_Group1 Initialization and de-initialization functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
648 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
649 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
650 HAL_SD_ErrorTypedef HAL_SD_Init(SD_HandleTypeDef *hsd, HAL_SD_CardInfoTypedef *SDCardInfo);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
651 HAL_StatusTypeDef HAL_SD_DeInit (SD_HandleTypeDef *hsd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
652 void HAL_SD_MspInit(SD_HandleTypeDef *hsd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
653 void HAL_SD_MspDeInit(SD_HandleTypeDef *hsd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
654 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
655 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
656 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
657
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
658 /** @defgroup SD_Exported_Functions_Group2 I/O operation functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
659 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
660 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
661 /* Blocking mode: Polling */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
662 HAL_SD_ErrorTypedef HAL_SD_ReadBlocks(SD_HandleTypeDef *hsd, uint32_t *pReadBuffer, uint64_t ReadAddr, uint32_t BlockSize, uint32_t NumberOfBlocks);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
663 HAL_SD_ErrorTypedef HAL_SD_WriteBlocks(SD_HandleTypeDef *hsd, uint32_t *pWriteBuffer, uint64_t WriteAddr, uint32_t BlockSize, uint32_t NumberOfBlocks);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
664 HAL_SD_ErrorTypedef HAL_SD_Erase(SD_HandleTypeDef *hsd, uint64_t startaddr, uint64_t endaddr);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
665
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
666 /* Non-Blocking mode: Interrupt */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
667 void HAL_SD_IRQHandler(SD_HandleTypeDef *hsd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
668
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
669 /* Callback in non blocking modes (DMA) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
670 void HAL_SD_DMA_RxCpltCallback(DMA_HandleTypeDef *hdma);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
671 void HAL_SD_DMA_RxErrorCallback(DMA_HandleTypeDef *hdma);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
672 void HAL_SD_DMA_TxCpltCallback(DMA_HandleTypeDef *hdma);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
673 void HAL_SD_DMA_TxErrorCallback(DMA_HandleTypeDef *hdma);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
674 void HAL_SD_XferCpltCallback(SD_HandleTypeDef *hsd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
675 void HAL_SD_XferErrorCallback(SD_HandleTypeDef *hsd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
676
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
677 /* Non-Blocking mode: DMA */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
678 HAL_SD_ErrorTypedef HAL_SD_ReadBlocks_DMA(SD_HandleTypeDef *hsd, uint32_t *pReadBuffer, uint64_t ReadAddr, uint32_t BlockSize, uint32_t NumberOfBlocks);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
679 HAL_SD_ErrorTypedef HAL_SD_WriteBlocks_DMA(SD_HandleTypeDef *hsd, uint32_t *pWriteBuffer, uint64_t WriteAddr, uint32_t BlockSize, uint32_t NumberOfBlocks);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
680 HAL_SD_ErrorTypedef HAL_SD_CheckWriteOperation(SD_HandleTypeDef *hsd, uint32_t Timeout);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
681 HAL_SD_ErrorTypedef HAL_SD_CheckReadOperation(SD_HandleTypeDef *hsd, uint32_t Timeout);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
682 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
683 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
684 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
685
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
686 /** @defgroup SD_Exported_Functions_Group3 Peripheral Control functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
687 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
688 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
689 HAL_SD_ErrorTypedef HAL_SD_Get_CardInfo(SD_HandleTypeDef *hsd, HAL_SD_CardInfoTypedef *pCardInfo);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
690 HAL_SD_ErrorTypedef HAL_SD_WideBusOperation_Config(SD_HandleTypeDef *hsd, uint32_t WideMode);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
691 HAL_SD_ErrorTypedef HAL_SD_StopTransfer(SD_HandleTypeDef *hsd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
692 HAL_SD_ErrorTypedef HAL_SD_HighSpeed (SD_HandleTypeDef *hsd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
693 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
694 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
695 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
696
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
697 /* Peripheral State functions ************************************************/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
698 /** @defgroup SD_Exported_Functions_Group4 Peripheral State functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
699 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
700 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
701 HAL_SD_ErrorTypedef HAL_SD_SendSDStatus(SD_HandleTypeDef *hsd, uint32_t *pSDstatus);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
702 HAL_SD_ErrorTypedef HAL_SD_GetCardStatus(SD_HandleTypeDef *hsd, HAL_SD_CardStatusTypedef *pCardStatus);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
703 HAL_SD_TransferStateTypedef HAL_SD_GetStatus(SD_HandleTypeDef *hsd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
704 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
705 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
706 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
707
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
708 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
709 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
710 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
711
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
712 /* Private types -------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
713 /** @defgroup SD_Private_Types SD Private Types
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
714 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
715 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
716
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
717 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
718 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
719 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
720
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
721 /* Private defines -----------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
722 /** @defgroup SD_Private_Defines SD Private Defines
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
723 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
724 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
725
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
726 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
727 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
728 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
729
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
730 /* Private variables ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
731 /** @defgroup SD_Private_Variables SD Private Variables
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
732 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
733 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
734
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
735 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
736 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
737 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
738
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
739 /* Private constants ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
740 /** @defgroup SD_Private_Constants SD Private Constants
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
741 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
742 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
743
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
744 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
745 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
746 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
747
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
748 /* Private macros ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
749 /** @defgroup SD_Private_Macros SD Private Macros
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
750 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
751 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
752
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
753 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
754 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
755 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
756
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
757 /* Private functions prototypes ----------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
758 /** @defgroup SD_Private_Functions_Prototypes SD Private Functions Prototypes
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
759 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
760 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
761
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
762 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
763 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
764 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
765
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
766 /* Private functions ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
767 /** @defgroup SD_Private_Functions SD Private Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
768 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
769 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
770
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
771 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
772 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
773 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
774
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
775 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
776 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
777 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
778
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
779 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
780 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
781 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
782
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
783 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
784 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
785 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
786
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
787 #endif /* __STM32F4xx_HAL_SD_H */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
788
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
789 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/