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