STM32H735xx HAL User Manual
stm32h7xx_hal_mmc.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h7xx_hal_mmc.h
00004   * @author  MCD Application Team
00005   * @brief   Header file of MMC HAL module.
00006   ******************************************************************************
00007   * @attention
00008   *
00009   * Copyright (c) 2017 STMicroelectronics.
00010   * All rights reserved.
00011   *
00012   * This software is licensed under terms that can be found in the LICENSE file
00013   * in the root directory of this software component.
00014   * If no LICENSE file comes with this software, it is provided AS-IS.
00015   *
00016   ******************************************************************************
00017   */
00018 
00019 /* Define to prevent recursive inclusion -------------------------------------*/
00020 #ifndef STM32H7xx_HAL_MMC_H
00021 #define STM32H7xx_HAL_MMC_H
00022 
00023 #ifdef __cplusplus
00024 extern "C" {
00025 #endif
00026 
00027 /* Includes ------------------------------------------------------------------*/
00028 #include "stm32h7xx_ll_sdmmc.h"
00029 
00030 /** @addtogroup STM32H7xx_HAL_Driver
00031   * @{
00032   */
00033 
00034 /** @addtogroup MMC
00035   * @{
00036   */
00037 
00038 /* Exported types ------------------------------------------------------------*/
00039 /** @defgroup MMC_Exported_Types MMC Exported Types
00040   * @{
00041   */
00042 
00043 /** @defgroup MMC_Exported_Types_Group1 MMC State enumeration structure
00044   * @{
00045   */
00046 typedef enum
00047 {
00048   HAL_MMC_STATE_RESET                  = ((uint32_t)0x00000000U),  /*!< MMC not yet initialized or disabled  */
00049   HAL_MMC_STATE_READY                  = ((uint32_t)0x00000001U),  /*!< MMC initialized and ready for use    */
00050   HAL_MMC_STATE_TIMEOUT                = ((uint32_t)0x00000002U),  /*!< MMC Timeout state                    */
00051   HAL_MMC_STATE_BUSY                   = ((uint32_t)0x00000003U),  /*!< MMC process ongoing                  */
00052   HAL_MMC_STATE_PROGRAMMING            = ((uint32_t)0x00000004U),  /*!< MMC Programming State                */
00053   HAL_MMC_STATE_RECEIVING              = ((uint32_t)0x00000005U),  /*!< MMC Receinving State                 */
00054   HAL_MMC_STATE_TRANSFER               = ((uint32_t)0x00000006U),  /*!< MMC Transfer State                   */
00055   HAL_MMC_STATE_ERROR                  = ((uint32_t)0x0000000FU)   /*!< MMC is in error state                */
00056 } HAL_MMC_StateTypeDef;
00057 /**
00058   * @}
00059   */
00060 
00061 /** @defgroup MMC_Exported_Types_Group2 MMC Card State enumeration structure
00062   * @{
00063   */
00064 typedef uint32_t HAL_MMC_CardStateTypeDef;
00065 
00066 #define HAL_MMC_CARD_IDLE           0x00000000U  /*!< Card is in idle state (can't be checked by CMD13)           */
00067 #define HAL_MMC_CARD_READY          0x00000001U  /*!< Card state is ready (can't be checked by CMD13)             */
00068 #define HAL_MMC_CARD_IDENTIFICATION 0x00000002U  /*!< Card is in identification state (can't be checked by CMD13) */
00069 #define HAL_MMC_CARD_STANDBY        0x00000003U  /*!< Card is in standby state                                    */
00070 #define HAL_MMC_CARD_TRANSFER       0x00000004U  /*!< Card is in transfer state                                   */
00071 #define HAL_MMC_CARD_SENDING        0x00000005U  /*!< Card is sending an operation                                */
00072 #define HAL_MMC_CARD_RECEIVING      0x00000006U  /*!< Card is receiving operation information                     */
00073 #define HAL_MMC_CARD_PROGRAMMING    0x00000007U  /*!< Card is in programming state                                */
00074 #define HAL_MMC_CARD_DISCONNECTED   0x00000008U  /*!< Card is disconnected                                        */
00075 #define HAL_MMC_CARD_BUSTEST        0x00000009U  /*!< Card is in bus test state                                   */
00076 #define HAL_MMC_CARD_SLEEP          0x0000000AU  /*!< Card is in sleep state (can't be checked by CMD13)          */
00077 #define HAL_MMC_CARD_ERROR          0x000000FFU  /*!< Card response Error (can't be checked by CMD13)             */
00078 /**
00079   * @}
00080   */
00081 
00082 /** @defgroup MMC_Exported_Types_Group3 MMC Handle Structure definition
00083   * @{
00084   */
00085 #define MMC_InitTypeDef      SDMMC_InitTypeDef
00086 #define MMC_TypeDef          SDMMC_TypeDef
00087 
00088 /**
00089   * @brief  MMC Card Information Structure definition
00090   */
00091 typedef struct
00092 {
00093   uint32_t CardType;                     /*!< Specifies the card Type                         */
00094 
00095   uint32_t Class;                        /*!< Specifies the class of the card class           */
00096 
00097   uint32_t RelCardAdd;                   /*!< Specifies the Relative Card Address             */
00098 
00099   uint32_t BlockNbr;                     /*!< Specifies the Card Capacity in blocks           */
00100 
00101   uint32_t BlockSize;                    /*!< Specifies one block size in bytes               */
00102 
00103   uint32_t LogBlockNbr;                  /*!< Specifies the Card logical Capacity in blocks   */
00104 
00105   uint32_t LogBlockSize;                 /*!< Specifies logical block size in bytes           */
00106 
00107 } HAL_MMC_CardInfoTypeDef;
00108 
00109 /**
00110   * @brief  MMC handle Structure definition
00111   */
00112 #if defined (USE_HAL_MMC_REGISTER_CALLBACKS) && (USE_HAL_MMC_REGISTER_CALLBACKS == 1U)
00113 typedef struct __MMC_HandleTypeDef
00114 #else
00115 typedef struct
00116 #endif /* USE_HAL_MMC_REGISTER_CALLBACKS */
00117 {
00118   MMC_TypeDef                  *Instance;        /*!< MMC registers base address           */
00119 
00120   MMC_InitTypeDef              Init;             /*!< MMC required parameters              */
00121 
00122   HAL_LockTypeDef              Lock;             /*!< MMC locking object                   */
00123 
00124   uint8_t                      *pTxBuffPtr;      /*!< Pointer to MMC Tx transfer Buffer    */
00125 
00126   uint32_t                     TxXferSize;       /*!< MMC Tx Transfer size                 */
00127 
00128   uint8_t                      *pRxBuffPtr;      /*!< Pointer to MMC Rx transfer Buffer    */
00129 
00130   uint32_t                     RxXferSize;       /*!< MMC Rx Transfer size                 */
00131 
00132   __IO uint32_t                Context;          /*!< MMC transfer context                 */
00133 
00134   __IO HAL_MMC_StateTypeDef    State;            /*!< MMC card State                       */
00135 
00136   __IO uint32_t                ErrorCode;        /*!< MMC Card Error codes                 */
00137 
00138   HAL_MMC_CardInfoTypeDef      MmcCard;          /*!< MMC Card information                 */
00139 
00140   uint32_t                     CSD[4U];          /*!< MMC card specific data table         */
00141 
00142   uint32_t                     CID[4U];          /*!< MMC card identification number table */
00143 
00144   uint32_t                     Ext_CSD[128];
00145 
00146 #if defined (USE_HAL_MMC_REGISTER_CALLBACKS) && (USE_HAL_MMC_REGISTER_CALLBACKS == 1U)
00147   void (* TxCpltCallback)(struct __MMC_HandleTypeDef *hmmc);
00148   void (* RxCpltCallback)(struct __MMC_HandleTypeDef *hmmc);
00149   void (* ErrorCallback)(struct __MMC_HandleTypeDef *hmmc);
00150   void (* AbortCpltCallback)(struct __MMC_HandleTypeDef *hmmc);
00151   void (* Read_DMADblBuf0CpltCallback)(struct __MMC_HandleTypeDef *hmmc);
00152   void (* Read_DMADblBuf1CpltCallback)(struct __MMC_HandleTypeDef *hmmc);
00153   void (* Write_DMADblBuf0CpltCallback)(struct __MMC_HandleTypeDef *hmmc);
00154   void (* Write_DMADblBuf1CpltCallback)(struct __MMC_HandleTypeDef *hmmc);
00155 
00156   void (* MspInitCallback)(struct __MMC_HandleTypeDef *hmmc);
00157   void (* MspDeInitCallback)(struct __MMC_HandleTypeDef *hmmc);
00158 #endif /* USE_HAL_MMC_REGISTER_CALLBACKS */
00159 } MMC_HandleTypeDef;
00160 
00161 
00162 /**
00163   * @}
00164   */
00165 
00166 /** @defgroup MMC_Exported_Types_Group4 Card Specific Data: CSD Register
00167   * @{
00168   */
00169 typedef struct
00170 {
00171   __IO uint8_t  CSDStruct;            /*!< CSD structure                         */
00172   __IO uint8_t  SysSpecVersion;       /*!< System specification version          */
00173   __IO uint8_t  Reserved1;            /*!< Reserved                              */
00174   __IO uint8_t  TAAC;                 /*!< Data read access time 1               */
00175   __IO uint8_t  NSAC;                 /*!< Data read access time 2 in CLK cycles */
00176   __IO uint8_t  MaxBusClkFrec;        /*!< Max. bus clock frequency              */
00177   __IO uint16_t CardComdClasses;      /*!< Card command classes                  */
00178   __IO uint8_t  RdBlockLen;           /*!< Max. read data block length           */
00179   __IO uint8_t  PartBlockRead;        /*!< Partial blocks for read allowed       */
00180   __IO uint8_t  WrBlockMisalign;      /*!< Write block misalignment              */
00181   __IO uint8_t  RdBlockMisalign;      /*!< Read block misalignment               */
00182   __IO uint8_t  DSRImpl;              /*!< DSR implemented                       */
00183   __IO uint8_t  Reserved2;            /*!< Reserved                              */
00184   __IO uint32_t DeviceSize;           /*!< Device Size                           */
00185   __IO uint8_t  MaxRdCurrentVDDMin;   /*!< Max. read current @ VDD min           */
00186   __IO uint8_t  MaxRdCurrentVDDMax;   /*!< Max. read current @ VDD max           */
00187   __IO uint8_t  MaxWrCurrentVDDMin;   /*!< Max. write current @ VDD min          */
00188   __IO uint8_t  MaxWrCurrentVDDMax;   /*!< Max. write current @ VDD max          */
00189   __IO uint8_t  DeviceSizeMul;        /*!< Device size multiplier                */
00190   __IO uint8_t  EraseGrSize;          /*!< Erase group size                      */
00191   __IO uint8_t  EraseGrMul;           /*!< Erase group size multiplier           */
00192   __IO uint8_t  WrProtectGrSize;      /*!< Write protect group size              */
00193   __IO uint8_t  WrProtectGrEnable;    /*!< Write protect group enable            */
00194   __IO uint8_t  ManDeflECC;           /*!< Manufacturer default ECC              */
00195   __IO uint8_t  WrSpeedFact;          /*!< Write speed factor                    */
00196   __IO uint8_t  MaxWrBlockLen;        /*!< Max. write data block length          */
00197   __IO uint8_t  WriteBlockPaPartial;  /*!< Partial blocks for write allowed      */
00198   __IO uint8_t  Reserved3;            /*!< Reserved                              */
00199   __IO uint8_t  ContentProtectAppli;  /*!< Content protection application        */
00200   __IO uint8_t  FileFormatGroup;      /*!< File format group                     */
00201   __IO uint8_t  CopyFlag;             /*!< Copy flag (OTP)                       */
00202   __IO uint8_t  PermWrProtect;        /*!< Permanent write protection            */
00203   __IO uint8_t  TempWrProtect;        /*!< Temporary write protection            */
00204   __IO uint8_t  FileFormat;           /*!< File format                           */
00205   __IO uint8_t  ECC;                  /*!< ECC code                              */
00206   __IO uint8_t  CSD_CRC;              /*!< CSD CRC                               */
00207   __IO uint8_t  Reserved4;            /*!< Always 1                              */
00208 
00209 } HAL_MMC_CardCSDTypeDef;
00210 /**
00211   * @}
00212   */
00213 
00214 /** @defgroup MMC_Exported_Types_Group5 Card Identification Data: CID Register
00215   * @{
00216   */
00217 typedef struct
00218 {
00219   __IO uint8_t  ManufacturerID;  /*!< Manufacturer ID       */
00220   __IO uint16_t OEM_AppliID;     /*!< OEM/Application ID    */
00221   __IO uint32_t ProdName1;       /*!< Product Name part1    */
00222   __IO uint8_t  ProdName2;       /*!< Product Name part2    */
00223   __IO uint8_t  ProdRev;         /*!< Product Revision      */
00224   __IO uint32_t ProdSN;          /*!< Product Serial Number */
00225   __IO uint8_t  Reserved1;       /*!< Reserved1             */
00226   __IO uint16_t ManufactDate;    /*!< Manufacturing Date    */
00227   __IO uint8_t  CID_CRC;         /*!< CID CRC               */
00228   __IO uint8_t  Reserved2;       /*!< Always 1              */
00229 
00230 } HAL_MMC_CardCIDTypeDef;
00231 /**
00232   * @}
00233   */
00234 
00235 #if defined (USE_HAL_MMC_REGISTER_CALLBACKS) && (USE_HAL_MMC_REGISTER_CALLBACKS == 1U)
00236 /** @defgroup MMC_Exported_Types_Group6 MMC Callback ID enumeration definition
00237   * @{
00238   */
00239 typedef enum
00240 {
00241   HAL_MMC_TX_CPLT_CB_ID                 = 0x00U,  /*!< MMC Tx Complete Callback ID                     */
00242   HAL_MMC_RX_CPLT_CB_ID                 = 0x01U,  /*!< MMC Rx Complete Callback ID                     */
00243   HAL_MMC_ERROR_CB_ID                   = 0x02U,  /*!< MMC Error Callback ID                           */
00244   HAL_MMC_ABORT_CB_ID                   = 0x03U,  /*!< MMC Abort Callback ID                           */
00245   HAL_MMC_READ_DMA_DBL_BUF0_CPLT_CB_ID  = 0x04U,  /*!< MMC Rx DMA Double Buffer 0 Complete Callback ID */
00246   HAL_MMC_READ_DMA_DBL_BUF1_CPLT_CB_ID  = 0x05U,  /*!< MMC Rx DMA Double Buffer 1 Complete Callback ID */
00247   HAL_MMC_WRITE_DMA_DBL_BUF0_CPLT_CB_ID = 0x06U,  /*!< MMC Tx DMA Double Buffer 0 Complete Callback ID */
00248   HAL_MMC_WRITE_DMA_DBL_BUF1_CPLT_CB_ID = 0x07U,  /*!< MMC Tx DMA Double Buffer 1 Complete Callback ID */
00249 
00250   HAL_MMC_MSP_INIT_CB_ID                = 0x10U,  /*!< MMC MspInit Callback ID                         */
00251   HAL_MMC_MSP_DEINIT_CB_ID              = 0x11U   /*!< MMC MspDeInit Callback ID                       */
00252 } HAL_MMC_CallbackIDTypeDef;
00253 /**
00254   * @}
00255   */
00256 
00257 /** @defgroup MMC_Exported_Types_Group7 MMC Callback pointer definition
00258   * @{
00259   */
00260 typedef void (*pMMC_CallbackTypeDef)(MMC_HandleTypeDef *hmmc);
00261 /**
00262   * @}
00263   */
00264 #endif /* USE_HAL_MMC_REGISTER_CALLBACKS */
00265 /**
00266   * @}
00267   */
00268 
00269 /* Exported constants --------------------------------------------------------*/
00270 /** @defgroup MMC_Exported_Constants Exported Constants
00271   * @{
00272   */
00273 
00274 #define MMC_BLOCKSIZE   ((uint32_t)512U) /*!< Block size is 512 bytes */
00275 
00276 /** @defgroup MMC_Exported_Constansts_Group1 MMC Error status enumeration Structure definition
00277   * @{
00278   */
00279 #define HAL_MMC_ERROR_NONE                     SDMMC_ERROR_NONE                    /*!< No error                                                      */
00280 #define HAL_MMC_ERROR_CMD_CRC_FAIL             SDMMC_ERROR_CMD_CRC_FAIL            /*!< Command response received (but CRC check failed)              */
00281 #define HAL_MMC_ERROR_DATA_CRC_FAIL            SDMMC_ERROR_DATA_CRC_FAIL           /*!< Data block sent/received (CRC check failed)                   */
00282 #define HAL_MMC_ERROR_CMD_RSP_TIMEOUT          SDMMC_ERROR_CMD_RSP_TIMEOUT         /*!< Command response timeout                                      */
00283 #define HAL_MMC_ERROR_DATA_TIMEOUT             SDMMC_ERROR_DATA_TIMEOUT            /*!< Data timeout                                                  */
00284 #define HAL_MMC_ERROR_TX_UNDERRUN              SDMMC_ERROR_TX_UNDERRUN             /*!< Transmit FIFO underrun                                        */
00285 #define HAL_MMC_ERROR_RX_OVERRUN               SDMMC_ERROR_RX_OVERRUN              /*!< Receive FIFO overrun                                          */
00286 #define HAL_MMC_ERROR_ADDR_MISALIGNED          SDMMC_ERROR_ADDR_MISALIGNED         /*!< Misaligned address                                            */
00287 #define HAL_MMC_ERROR_BLOCK_LEN_ERR            SDMMC_ERROR_BLOCK_LEN_ERR           /*!< Transferred block length is not allowed for the card or the   */
00288 /*!< number of transferred bytes does not match the block length   */
00289 #define HAL_MMC_ERROR_ERASE_SEQ_ERR            SDMMC_ERROR_ERASE_SEQ_ERR           /*!< An error in the sequence of erase command occurs              */
00290 #define HAL_MMC_ERROR_BAD_ERASE_PARAM          SDMMC_ERROR_BAD_ERASE_PARAM         /*!< An invalid selection for erase groups                         */
00291 #define HAL_MMC_ERROR_WRITE_PROT_VIOLATION     SDMMC_ERROR_WRITE_PROT_VIOLATION    /*!< Attempt to program a write protect block                      */
00292 #define HAL_MMC_ERROR_LOCK_UNLOCK_FAILED       SDMMC_ERROR_LOCK_UNLOCK_FAILED      /*!< Sequence or password error has been detected in unlock        */
00293 /*!< command or if there was an attempt to access a locked card    */
00294 #define HAL_MMC_ERROR_COM_CRC_FAILED           SDMMC_ERROR_COM_CRC_FAILED          /*!< CRC check of the previous command failed                      */
00295 #define HAL_MMC_ERROR_ILLEGAL_CMD              SDMMC_ERROR_ILLEGAL_CMD             /*!< Command is not legal for the card state                       */
00296 #define HAL_MMC_ERROR_CARD_ECC_FAILED          SDMMC_ERROR_CARD_ECC_FAILED         /*!< Card internal ECC was applied but failed to correct the data  */
00297 #define HAL_MMC_ERROR_CC_ERR                   SDMMC_ERROR_CC_ERR                  /*!< Internal card controller error                                */
00298 #define HAL_MMC_ERROR_GENERAL_UNKNOWN_ERR      SDMMC_ERROR_GENERAL_UNKNOWN_ERR     /*!< General or unknown error                                      */
00299 #define HAL_MMC_ERROR_STREAM_READ_UNDERRUN     SDMMC_ERROR_STREAM_READ_UNDERRUN    /*!< The card could not sustain data reading in stream rmode       */
00300 #define HAL_MMC_ERROR_STREAM_WRITE_OVERRUN     SDMMC_ERROR_STREAM_WRITE_OVERRUN    /*!< The card could not sustain data programming in stream mode    */
00301 #define HAL_MMC_ERROR_CID_CSD_OVERWRITE        SDMMC_ERROR_CID_CSD_OVERWRITE       /*!< CID/CSD overwrite error                                       */
00302 #define HAL_MMC_ERROR_WP_ERASE_SKIP            SDMMC_ERROR_WP_ERASE_SKIP           /*!< Only partial address space was erased                         */
00303 #define HAL_MMC_ERROR_CARD_ECC_DISABLED        SDMMC_ERROR_CARD_ECC_DISABLED       /*!< Command has been executed without using internal ECC          */
00304 #define HAL_MMC_ERROR_ERASE_RESET              SDMMC_ERROR_ERASE_RESET             /*!< Erase sequence was cleared before executing because an out    */
00305 /*!< of erase sequence command was received                        */
00306 #define HAL_MMC_ERROR_AKE_SEQ_ERR              SDMMC_ERROR_AKE_SEQ_ERR             /*!< Error in sequence of authentication                           */
00307 #define HAL_MMC_ERROR_INVALID_VOLTRANGE        SDMMC_ERROR_INVALID_VOLTRANGE       /*!< Error in case of invalid voltage range                        */
00308 #define HAL_MMC_ERROR_ADDR_OUT_OF_RANGE        SDMMC_ERROR_ADDR_OUT_OF_RANGE       /*!< Error when addressed block is out of range                    */
00309 #define HAL_MMC_ERROR_REQUEST_NOT_APPLICABLE   SDMMC_ERROR_REQUEST_NOT_APPLICABLE  /*!< Error when command request is not applicable                  */
00310 #define HAL_MMC_ERROR_PARAM                    SDMMC_ERROR_INVALID_PARAMETER       /*!< the used parameter is not valid                               */
00311 #define HAL_MMC_ERROR_UNSUPPORTED_FEATURE      SDMMC_ERROR_UNSUPPORTED_FEATURE     /*!< Error when feature is not insupported                         */
00312 #define HAL_MMC_ERROR_BUSY                     SDMMC_ERROR_BUSY                    /*!< Error when transfer process is busy                           */
00313 #define HAL_MMC_ERROR_DMA                      SDMMC_ERROR_DMA                     /*!< Error while DMA transfer                                      */
00314 #define HAL_MMC_ERROR_TIMEOUT                  SDMMC_ERROR_TIMEOUT                 /*!< Timeout error                                                 */
00315 
00316 #if defined (USE_HAL_MMC_REGISTER_CALLBACKS) && (USE_HAL_MMC_REGISTER_CALLBACKS == 1U)
00317 #define HAL_MMC_ERROR_INVALID_CALLBACK         SDMMC_ERROR_INVALID_PARAMETER       /*!< Invalid callback error                                        */
00318 #endif /* USE_HAL_MMC_REGISTER_CALLBACKS */
00319 /**
00320   * @}
00321   */
00322 
00323 /** @defgroup MMC_Exported_Constansts_Group2 MMC context enumeration
00324   * @{
00325   */
00326 #define   MMC_CONTEXT_NONE                 ((uint32_t)0x00000000U)  /*!< None                             */
00327 #define   MMC_CONTEXT_READ_SINGLE_BLOCK    ((uint32_t)0x00000001U)  /*!< Read single block operation      */
00328 #define   MMC_CONTEXT_READ_MULTIPLE_BLOCK  ((uint32_t)0x00000002U)  /*!< Read multiple blocks operation   */
00329 #define   MMC_CONTEXT_WRITE_SINGLE_BLOCK   ((uint32_t)0x00000010U)  /*!< Write single block operation     */
00330 #define   MMC_CONTEXT_WRITE_MULTIPLE_BLOCK ((uint32_t)0x00000020U)  /*!< Write multiple blocks operation  */
00331 #define   MMC_CONTEXT_IT                   ((uint32_t)0x00000008U)  /*!< Process in Interrupt mode        */
00332 #define   MMC_CONTEXT_DMA                  ((uint32_t)0x00000080U)  /*!< Process in DMA mode              */
00333 
00334 /**
00335   * @}
00336   */
00337 
00338 /** @defgroup MMC_Exported_Constansts_Group3 MMC Voltage mode
00339   * @{
00340   */
00341 /**
00342   * @brief
00343   */
00344 #define MMC_HIGH_VOLTAGE_RANGE         0x80FF8000U  /*!< High voltage in byte mode    */
00345 #define MMC_DUAL_VOLTAGE_RANGE         0x80FF8080U  /*!< Dual voltage in byte mode    */
00346 #define MMC_LOW_VOLTAGE_RANGE          0x80000080U  /*!< Low voltage in byte mode     */
00347 #define EMMC_HIGH_VOLTAGE_RANGE        0xC0FF8000U  /*!< High voltage in sector mode  */
00348 #define EMMC_DUAL_VOLTAGE_RANGE        0xC0FF8080U  /*!< Dual voltage in sector mode  */
00349 #define EMMC_LOW_VOLTAGE_RANGE         0xC0000080U  /*!< Low voltage in sector mode   */
00350 #define MMC_INVALID_VOLTAGE_RANGE      0x0001FF01U
00351 /**
00352   * @}
00353   */
00354 
00355 /** @defgroup MMC_Exported_Constansts_Group4 MMC Memory Cards
00356   * @{
00357   */
00358 #define  MMC_LOW_CAPACITY_CARD     ((uint32_t)0x00000000U)   /*!< MMC Card Capacity <=2Gbytes   */
00359 #define  MMC_HIGH_CAPACITY_CARD    ((uint32_t)0x00000001U)   /*!< MMC Card Capacity >2Gbytes and <2Tbytes   */
00360 
00361 /**
00362   * @}
00363   */
00364 
00365 /** @defgroup MMC_Exported_Constansts_Group5 MMC Erase Type
00366   * @{
00367   */
00368 #define HAL_MMC_ERASE             0x00000000U  /*!< Erase the erase groups identified by CMD35 & 36                                   */
00369 #define HAL_MMC_TRIM              0x00000001U  /*!< Erase the write blocks identified by CMD35 & 36                                   */
00370 #define HAL_MMC_DISCARD           0x00000003U  /*!< Discard the write blocks identified by CMD35 & 36                                 */
00371 #define HAL_MMC_SECURE_ERASE      0x80000000U  /*!< Perform a secure purge according SRT on the erase groups identified by CMD35 & 36 */
00372 #define HAL_MMC_SECURE_TRIM_STEP1 0x80000001U  /*!< Mark the write blocks identified by CMD35 & 36 for secure erase                   */
00373 #define HAL_MMC_SECURE_TRIM_STEP2 0x80008000U  /*!< Perform a secure purge according SRT on the write blocks previously identified    */
00374 
00375 #define IS_MMC_ERASE_TYPE(TYPE) (((TYPE) == HAL_MMC_ERASE)             || \
00376                                  ((TYPE) == HAL_MMC_TRIM)              || \
00377                                  ((TYPE) == HAL_MMC_DISCARD)           || \
00378                                  ((TYPE) == HAL_MMC_SECURE_ERASE)      || \
00379                                  ((TYPE) == HAL_MMC_SECURE_TRIM_STEP1) || \
00380                                  ((TYPE) == HAL_MMC_SECURE_TRIM_STEP2))
00381 /**
00382   * @}
00383   */
00384 
00385 /** @defgroup MMC_Exported_Constansts_Group6 MMC Secure Removal Type
00386   * @{
00387   */
00388 #define HAL_MMC_SRT_ERASE                   0x00000001U  /*!< Information removed by an erase                                                                */
00389 #define HAL_MMC_SRT_WRITE_CHAR_ERASE        0x00000002U  /*!< Information removed by an overwriting with a character followed by an erase                    */
00390 #define HAL_MMC_SRT_WRITE_CHAR_COMPL_RANDOM 0x00000004U  /*!< Information removed by an overwriting with a character, its complement then a random character */
00391 #define HAL_MMC_SRT_VENDOR_DEFINED          0x00000008U  /*!< Information removed using a vendor defined                                                     */
00392 
00393 
00394 #define IS_MMC_SRT_TYPE(TYPE) (((TYPE) == HAL_MMC_SRT_ERASE)                   || \
00395                                ((TYPE) == HAL_MMC_SRT_WRITE_CHAR_ERASE)        || \
00396                                ((TYPE) == HAL_MMC_SRT_WRITE_CHAR_COMPL_RANDOM) || \
00397                                ((TYPE) == HAL_MMC_SRT_VENDOR_DEFINED))
00398 /**
00399   * @}
00400   */
00401 
00402 /**
00403   * @}
00404   */
00405 
00406 /* Exported macro ------------------------------------------------------------*/
00407 /** @defgroup MMC_Exported_macros MMC Exported Macros
00408   *  @brief macros to handle interrupts and specific clock configurations
00409   * @{
00410   */
00411 /** @brief Reset MMC handle state.
00412   * @param  __HANDLE__ MMC Handle.
00413   * @retval None
00414   */
00415 #if defined (USE_HAL_MMC_REGISTER_CALLBACKS) && (USE_HAL_MMC_REGISTER_CALLBACKS == 1U)
00416 #define __HAL_MMC_RESET_HANDLE_STATE(__HANDLE__)           do {                                              \
00417                                                                 (__HANDLE__)->State = HAL_MMC_STATE_RESET; \
00418                                                                 (__HANDLE__)->MspInitCallback = NULL;       \
00419                                                                 (__HANDLE__)->MspDeInitCallback = NULL;     \
00420                                                               } while(0)
00421 #else
00422 #define __HAL_MMC_RESET_HANDLE_STATE(__HANDLE__)           ((__HANDLE__)->State = HAL_MMC_STATE_RESET)
00423 #endif /* USE_HAL_MMC_REGISTER_CALLBACKS */
00424 
00425 /**
00426   * @brief  Enable the MMC device interrupt.
00427   * @param  __HANDLE__ MMC Handle.
00428   * @param  __INTERRUPT__ specifies the SDMMC interrupt sources to be enabled.
00429   *         This parameter can be one or a combination of the following values:
00430   *            @arg SDMMC_IT_CCRCFAIL:   Command response received (CRC check failed) interrupt
00431   *            @arg SDMMC_IT_DCRCFAIL:   Data block sent/received (CRC check failed) interrupt
00432   *            @arg SDMMC_IT_CTIMEOUT:   Command response timeout interrupt
00433   *            @arg SDMMC_IT_DTIMEOUT:   Data timeout interrupt
00434   *            @arg SDMMC_IT_TXUNDERR:   Transmit FIFO underrun error interrupt
00435   *            @arg SDMMC_IT_RXOVERR:    Received FIFO overrun error interrupt
00436   *            @arg SDMMC_IT_CMDREND:    Command response received (CRC check passed) interrupt
00437   *            @arg SDMMC_IT_CMDSENT:    Command sent (no response required) interrupt
00438   *            @arg SDMMC_IT_DATAEND:    Data end (data counter, DATACOUNT, is zero) interrupt
00439   *            @arg SDMMC_IT_DHOLD:      Data transfer Hold interrupt
00440   *            @arg SDMMC_IT_DBCKEND:    Data block sent/received (CRC check passed) interrupt
00441   *            @arg SDMMC_IT_DABORT:     Data transfer aborted by CMD12 interrupt
00442   *            @arg SDMMC_IT_TXFIFOHE:   Transmit FIFO Half Empty interrupt
00443   *            @arg SDMMC_IT_RXFIFOHF:   Receive FIFO Half Full interrupt
00444   *            @arg SDMMC_IT_RXFIFOF:    Receive FIFO full interrupt
00445   *            @arg SDMMC_IT_TXFIFOE:    Transmit FIFO empty interrupt
00446   *            @arg SDMMC_IT_BUSYD0END:  End of SDMMC_D0 Busy following a CMD response detected interrupt
00447   *            @arg SDMMC_IT_SDIOIT:     SD I/O interrupt received interrupt
00448   *            @arg SDMMC_IT_ACKFAIL:    Boot Acknowledgment received interrupt
00449   *            @arg SDMMC_IT_ACKTIMEOUT: Boot Acknowledgment timeout interrupt
00450   *            @arg SDMMC_IT_VSWEND:     Voltage switch critical timing section completion interrupt
00451   *            @arg SDMMC_IT_CKSTOP:     SDMMC_CK stopped in Voltage switch procedure interrupt
00452   *            @arg SDMMC_IT_IDMABTC:    IDMA buffer transfer complete interrupt
00453   * @retval None
00454   */
00455 #define __HAL_MMC_ENABLE_IT(__HANDLE__, __INTERRUPT__) __SDMMC_ENABLE_IT((__HANDLE__)->Instance, (__INTERRUPT__))
00456 
00457 /**
00458   * @brief  Disable the MMC device interrupt.
00459   * @param  __HANDLE__ MMC Handle.
00460   * @param  __INTERRUPT__ specifies the SDMMC interrupt sources to be disabled.
00461   *          This parameter can be one or a combination of the following values:
00462   *            @arg SDMMC_IT_CCRCFAIL:   Command response received (CRC check failed) interrupt
00463   *            @arg SDMMC_IT_DCRCFAIL:   Data block sent/received (CRC check failed) interrupt
00464   *            @arg SDMMC_IT_CTIMEOUT:   Command response timeout interrupt
00465   *            @arg SDMMC_IT_DTIMEOUT:   Data timeout interrupt
00466   *            @arg SDMMC_IT_TXUNDERR:   Transmit FIFO underrun error interrupt
00467   *            @arg SDMMC_IT_RXOVERR:    Received FIFO overrun error interrupt
00468   *            @arg SDMMC_IT_CMDREND:    Command response received (CRC check passed) interrupt
00469   *            @arg SDMMC_IT_CMDSENT:    Command sent (no response required) interrupt
00470   *            @arg SDMMC_IT_DATAEND:    Data end (data counter, DATACOUNT, is zero) interrupt
00471   *            @arg SDMMC_IT_DHOLD:      Data transfer Hold interrupt
00472   *            @arg SDMMC_IT_DBCKEND:    Data block sent/received (CRC check passed) interrupt
00473   *            @arg SDMMC_IT_DABORT:     Data transfer aborted by CMD12 interrupt
00474   *            @arg SDMMC_IT_TXFIFOHE:   Transmit FIFO Half Empty interrupt
00475   *            @arg SDMMC_IT_RXFIFOHF:   Receive FIFO Half Full interrupt
00476   *            @arg SDMMC_IT_RXFIFOF:    Receive FIFO full interrupt
00477   *            @arg SDMMC_IT_TXFIFOE:    Transmit FIFO empty interrupt
00478   *            @arg SDMMC_IT_BUSYD0END:  End of SDMMC_D0 Busy following a CMD response detected interrupt
00479   *            @arg SDMMC_IT_SDIOIT:     SD I/O interrupt received interrupt
00480   *            @arg SDMMC_IT_ACKFAIL:    Boot Acknowledgment received interrupt
00481   *            @arg SDMMC_IT_ACKTIMEOUT: Boot Acknowledgment timeout interrupt
00482   *            @arg SDMMC_IT_VSWEND:     Voltage switch critical timing section completion interrupt
00483   *            @arg SDMMC_IT_CKSTOP:     SDMMC_CK stopped in Voltage switch procedure interrupt
00484   *            @arg SDMMC_IT_IDMABTC:    IDMA buffer transfer complete interrupt
00485   * @retval None
00486   */
00487 #define __HAL_MMC_DISABLE_IT(__HANDLE__, __INTERRUPT__) __SDMMC_DISABLE_IT((__HANDLE__)->Instance, (__INTERRUPT__))
00488 
00489 /**
00490   * @brief  Check whether the specified MMC flag is set or not.
00491   * @param  __HANDLE__ MMC Handle.
00492   * @param  __FLAG__ specifies the flag to check.
00493   *          This parameter can be one of the following values:
00494   *            @arg SDMMC_FLAG_CCRCFAIL:   Command response received (CRC check failed)
00495   *            @arg SDMMC_FLAG_DCRCFAIL:   Data block sent/received (CRC check failed)
00496   *            @arg SDMMC_FLAG_CTIMEOUT:   Command response timeout
00497   *            @arg SDMMC_FLAG_DTIMEOUT:   Data timeout
00498   *            @arg SDMMC_FLAG_TXUNDERR:   Transmit FIFO underrun error
00499   *            @arg SDMMC_FLAG_RXOVERR:    Received FIFO overrun error
00500   *            @arg SDMMC_FLAG_CMDREND:    Command response received (CRC check passed)
00501   *            @arg SDMMC_FLAG_CMDSENT:    Command sent (no response required)
00502   *            @arg SDMMC_FLAG_DATAEND:    Data end (data counter, DATACOUNT, is zero)
00503   *            @arg SDMMC_FLAG_DHOLD:      Data transfer Hold
00504   *            @arg SDMMC_FLAG_DBCKEND:    Data block sent/received (CRC check passed)
00505   *            @arg SDMMC_FLAG_DABORT:     Data transfer aborted by CMD12
00506   *            @arg SDMMC_FLAG_DPSMACT:    Data path state machine active
00507   *            @arg SDMMC_FLAG_CPSMACT:    Command path state machine active
00508   *            @arg SDMMC_FLAG_TXFIFOHE:   Transmit FIFO Half Empty
00509   *            @arg SDMMC_FLAG_RXFIFOHF:   Receive FIFO Half Full
00510   *            @arg SDMMC_FLAG_TXFIFOF:    Transmit FIFO full
00511   *            @arg SDMMC_FLAG_RXFIFOF:    Receive FIFO full
00512   *            @arg SDMMC_FLAG_TXFIFOE:    Transmit FIFO empty
00513   *            @arg SDMMC_FLAG_RXFIFOE:    Receive FIFO empty
00514   *            @arg SDMMC_FLAG_BUSYD0:     Inverted value of SDMMC_D0 line (Busy)
00515   *            @arg SDMMC_FLAG_BUSYD0END:  End of SDMMC_D0 Busy following a CMD response detected
00516   *            @arg SDMMC_FLAG_SDIOIT:     SD I/O interrupt received
00517   *            @arg SDMMC_FLAG_ACKFAIL:    Boot Acknowledgment received
00518   *            @arg SDMMC_FLAG_ACKTIMEOUT: Boot Acknowledgment timeout
00519   *            @arg SDMMC_FLAG_VSWEND:     Voltage switch critical timing section completion
00520   *            @arg SDMMC_FLAG_CKSTOP:     SDMMC_CK stopped in Voltage switch procedure
00521   *            @arg SDMMC_FLAG_IDMATE:     IDMA transfer error
00522   *            @arg SDMMC_FLAG_IDMABTC:    IDMA buffer transfer complete
00523   * @retval The new state of MMC FLAG (SET or RESET).
00524   */
00525 #define __HAL_MMC_GET_FLAG(__HANDLE__, __FLAG__) __SDMMC_GET_FLAG((__HANDLE__)->Instance, (__FLAG__))
00526 
00527 /**
00528   * @brief  Clear the MMC's pending flags.
00529   * @param  __HANDLE__ MMC Handle.
00530   * @param  __FLAG__ specifies the flag to clear.
00531   *          This parameter can be one or a combination of the following values:
00532   *            @arg SDMMC_FLAG_CCRCFAIL:   Command response received (CRC check failed)
00533   *            @arg SDMMC_FLAG_DCRCFAIL:   Data block sent/received (CRC check failed)
00534   *            @arg SDMMC_FLAG_CTIMEOUT:   Command response timeout
00535   *            @arg SDMMC_FLAG_DTIMEOUT:   Data timeout
00536   *            @arg SDMMC_FLAG_TXUNDERR:   Transmit FIFO underrun error
00537   *            @arg SDMMC_FLAG_RXOVERR:    Received FIFO overrun error
00538   *            @arg SDMMC_FLAG_CMDREND:    Command response received (CRC check passed)
00539   *            @arg SDMMC_FLAG_CMDSENT:    Command sent (no response required)
00540   *            @arg SDMMC_FLAG_DATAEND:    Data end (data counter, DATACOUNT, is zero)
00541   *            @arg SDMMC_FLAG_DHOLD:      Data transfer Hold
00542   *            @arg SDMMC_FLAG_DBCKEND:    Data block sent/received (CRC check passed)
00543   *            @arg SDMMC_FLAG_DABORT:     Data transfer aborted by CMD12
00544   *            @arg SDMMC_FLAG_BUSYD0END:  End of SDMMC_D0 Busy following a CMD response detected
00545   *            @arg SDMMC_FLAG_SDIOIT:     SD I/O interrupt received
00546   *            @arg SDMMC_FLAG_ACKFAIL:    Boot Acknowledgment received
00547   *            @arg SDMMC_FLAG_ACKTIMEOUT: Boot Acknowledgment timeout
00548   *            @arg SDMMC_FLAG_VSWEND:     Voltage switch critical timing section completion
00549   *            @arg SDMMC_FLAG_CKSTOP:     SDMMC_CK stopped in Voltage switch procedure
00550   *            @arg SDMMC_FLAG_IDMATE:     IDMA transfer error
00551   *            @arg SDMMC_FLAG_IDMABTC:    IDMA buffer transfer complete
00552   * @retval None
00553   */
00554 #define __HAL_MMC_CLEAR_FLAG(__HANDLE__, __FLAG__) __SDMMC_CLEAR_FLAG((__HANDLE__)->Instance, (__FLAG__))
00555 
00556 /**
00557   * @brief  Check whether the specified MMC interrupt has occurred or not.
00558   * @param  __HANDLE__ MMC Handle.
00559   * @param  __INTERRUPT__ specifies the SDMMC interrupt source to check.
00560   *          This parameter can be one of the following values:
00561   *            @arg SDMMC_IT_CCRCFAIL:   Command response received (CRC check failed) interrupt
00562   *            @arg SDMMC_IT_DCRCFAIL:   Data block sent/received (CRC check failed) interrupt
00563   *            @arg SDMMC_IT_CTIMEOUT:   Command response timeout interrupt
00564   *            @arg SDMMC_IT_DTIMEOUT:   Data timeout interrupt
00565   *            @arg SDMMC_IT_TXUNDERR:   Transmit FIFO underrun error interrupt
00566   *            @arg SDMMC_IT_RXOVERR:    Received FIFO overrun error interrupt
00567   *            @arg SDMMC_IT_CMDREND:    Command response received (CRC check passed) interrupt
00568   *            @arg SDMMC_IT_CMDSENT:    Command sent (no response required) interrupt
00569   *            @arg SDMMC_IT_DATAEND:    Data end (data counter, DATACOUNT, is zero) interrupt
00570   *            @arg SDMMC_IT_DHOLD:      Data transfer Hold interrupt
00571   *            @arg SDMMC_IT_DBCKEND:    Data block sent/received (CRC check passed) interrupt
00572   *            @arg SDMMC_IT_DABORT:     Data transfer aborted by CMD12 interrupt
00573   *            @arg SDMMC_IT_TXFIFOHE:   Transmit FIFO Half Empty interrupt
00574   *            @arg SDMMC_IT_RXFIFOHF:   Receive FIFO Half Full interrupt
00575   *            @arg SDMMC_IT_RXFIFOF:    Receive FIFO full interrupt
00576   *            @arg SDMMC_IT_TXFIFOE:    Transmit FIFO empty interrupt
00577   *            @arg SDMMC_IT_BUSYD0END:  End of SDMMC_D0 Busy following a CMD response detected interrupt
00578   *            @arg SDMMC_IT_SDIOIT:     SD I/O interrupt received interrupt
00579   *            @arg SDMMC_IT_ACKFAIL:    Boot Acknowledgment received interrupt
00580   *            @arg SDMMC_IT_ACKTIMEOUT: Boot Acknowledgment timeout interrupt
00581   *            @arg SDMMC_IT_VSWEND:     Voltage switch critical timing section completion interrupt
00582   *            @arg SDMMC_IT_CKSTOP:     SDMMC_CK stopped in Voltage switch procedure interrupt
00583   *            @arg SDMMC_IT_IDMABTC:    IDMA buffer transfer complete interrupt
00584   * @retval The new state of MMC IT (SET or RESET).
00585   */
00586 #define __HAL_MMC_GET_IT(__HANDLE__, __INTERRUPT__) __SDMMC_GET_IT((__HANDLE__)->Instance, (__INTERRUPT__))
00587 
00588 /**
00589   * @brief  Clear the MMC's interrupt pending bits.
00590   * @param  __HANDLE__ MMC Handle.
00591   * @param  __INTERRUPT__ specifies the interrupt pending bit to clear.
00592   *          This parameter can be one or a combination of the following values:
00593   *            @arg SDMMC_IT_CCRCFAIL:   Command response received (CRC check failed) interrupt
00594   *            @arg SDMMC_IT_DCRCFAIL:   Data block sent/received (CRC check failed) interrupt
00595   *            @arg SDMMC_IT_CTIMEOUT:   Command response timeout interrupt
00596   *            @arg SDMMC_IT_DTIMEOUT:   Data timeout interrupt
00597   *            @arg SDMMC_IT_TXUNDERR:   Transmit FIFO underrun error interrupt
00598   *            @arg SDMMC_IT_RXOVERR:    Received FIFO overrun error interrupt
00599   *            @arg SDMMC_IT_CMDREND:    Command response received (CRC check passed) interrupt
00600   *            @arg SDMMC_IT_CMDSENT:    Command sent (no response required) interrupt
00601   *            @arg SDMMC_IT_DATAEND:    Data end (data counter, DATACOUNT, is zero) interrupt
00602   *            @arg SDMMC_IT_DHOLD:      Data transfer Hold interrupt
00603   *            @arg SDMMC_IT_DBCKEND:    Data block sent/received (CRC check passed) interrupt
00604   *            @arg SDMMC_IT_DABORT:     Data transfer aborted by CMD12 interrupt
00605   *            @arg SDMMC_IT_TXFIFOHE:   Transmit FIFO Half Empty interrupt
00606   *            @arg SDMMC_IT_RXFIFOHF:   Receive FIFO Half Full interrupt
00607   *            @arg SDMMC_IT_RXFIFOF:    Receive FIFO full interrupt
00608   *            @arg SDMMC_IT_TXFIFOE:    Transmit FIFO empty interrupt
00609   *            @arg SDMMC_IT_BUSYD0END:  End of SDMMC_D0 Busy following a CMD response detected interrupt
00610   *            @arg SDMMC_IT_SDIOIT:     SD I/O interrupt received interrupt
00611   *            @arg SDMMC_IT_ACKFAIL:    Boot Acknowledgment received interrupt
00612   *            @arg SDMMC_IT_ACKTIMEOUT: Boot Acknowledgment timeout interrupt
00613   *            @arg SDMMC_IT_VSWEND:     Voltage switch critical timing section completion interrupt
00614   *            @arg SDMMC_IT_CKSTOP:     SDMMC_CK stopped in Voltage switch procedure interrupt
00615   *            @arg SDMMC_IT_IDMABTC:    IDMA buffer transfer complete interrupt
00616   * @retval None
00617   */
00618 #define __HAL_MMC_CLEAR_IT(__HANDLE__, __INTERRUPT__) __SDMMC_CLEAR_IT((__HANDLE__)->Instance, (__INTERRUPT__))
00619 
00620 /**
00621   * @}
00622   */
00623 
00624 /* Include MMC HAL Extension module */
00625 #include "stm32h7xx_hal_mmc_ex.h"
00626 
00627 /* Exported functions --------------------------------------------------------*/
00628 /** @defgroup MMC_Exported_Functions MMC Exported Functions
00629   * @{
00630   */
00631 
00632 /** @defgroup MMC_Exported_Functions_Group1 Initialization and de-initialization functions
00633   * @{
00634   */
00635 HAL_StatusTypeDef HAL_MMC_Init(MMC_HandleTypeDef *hmmc);
00636 HAL_StatusTypeDef HAL_MMC_InitCard(MMC_HandleTypeDef *hmmc);
00637 HAL_StatusTypeDef HAL_MMC_DeInit(MMC_HandleTypeDef *hmmc);
00638 void HAL_MMC_MspInit(MMC_HandleTypeDef *hmmc);
00639 void HAL_MMC_MspDeInit(MMC_HandleTypeDef *hmmc);
00640 
00641 /**
00642   * @}
00643   */
00644 
00645 /** @defgroup MMC_Exported_Functions_Group2 Input and Output operation functions
00646   * @{
00647   */
00648 /* Blocking mode: Polling */
00649 HAL_StatusTypeDef HAL_MMC_ReadBlocks(MMC_HandleTypeDef *hmmc, uint8_t *pData, uint32_t BlockAdd,
00650                                      uint32_t NumberOfBlocks, uint32_t Timeout);
00651 HAL_StatusTypeDef HAL_MMC_WriteBlocks(MMC_HandleTypeDef *hmmc, uint8_t *pData, uint32_t BlockAdd,
00652                                       uint32_t NumberOfBlocks, uint32_t Timeout);
00653 HAL_StatusTypeDef HAL_MMC_Erase(MMC_HandleTypeDef *hmmc, uint32_t BlockStartAdd, uint32_t BlockEndAdd);
00654 /* Non-Blocking mode: IT */
00655 HAL_StatusTypeDef HAL_MMC_ReadBlocks_IT(MMC_HandleTypeDef *hmmc, uint8_t *pData, uint32_t BlockAdd,
00656                                         uint32_t NumberOfBlocks);
00657 HAL_StatusTypeDef HAL_MMC_WriteBlocks_IT(MMC_HandleTypeDef *hmmc, uint8_t *pData, uint32_t BlockAdd,
00658                                          uint32_t NumberOfBlocks);
00659 /* Non-Blocking mode: DMA */
00660 HAL_StatusTypeDef HAL_MMC_ReadBlocks_DMA(MMC_HandleTypeDef *hmmc, uint8_t *pData, uint32_t BlockAdd,
00661                                          uint32_t NumberOfBlocks);
00662 HAL_StatusTypeDef HAL_MMC_WriteBlocks_DMA(MMC_HandleTypeDef *hmmc, uint8_t *pData, uint32_t BlockAdd,
00663                                           uint32_t NumberOfBlocks);
00664 
00665 void HAL_MMC_IRQHandler(MMC_HandleTypeDef *hmmc);
00666 
00667 /* Callback in non blocking modes (DMA) */
00668 void HAL_MMC_TxCpltCallback(MMC_HandleTypeDef *hmmc);
00669 void HAL_MMC_RxCpltCallback(MMC_HandleTypeDef *hmmc);
00670 void HAL_MMC_ErrorCallback(MMC_HandleTypeDef *hmmc);
00671 void HAL_MMC_AbortCallback(MMC_HandleTypeDef *hmmc);
00672 
00673 #if defined (USE_HAL_MMC_REGISTER_CALLBACKS) && (USE_HAL_MMC_REGISTER_CALLBACKS == 1U)
00674 /* MMC callback registering/unregistering */
00675 HAL_StatusTypeDef HAL_MMC_RegisterCallback(MMC_HandleTypeDef *hmmc, HAL_MMC_CallbackIDTypeDef CallbackId,
00676                                            pMMC_CallbackTypeDef pCallback);
00677 HAL_StatusTypeDef HAL_MMC_UnRegisterCallback(MMC_HandleTypeDef *hmmc, HAL_MMC_CallbackIDTypeDef CallbackId);
00678 #endif /* USE_HAL_MMC_REGISTER_CALLBACKS */
00679 /**
00680   * @}
00681   */
00682 
00683 /** @defgroup MMC_Exported_Functions_Group3 Peripheral Control functions
00684   * @{
00685   */
00686 HAL_StatusTypeDef HAL_MMC_ConfigWideBusOperation(MMC_HandleTypeDef *hmmc, uint32_t WideMode);
00687 HAL_StatusTypeDef HAL_MMC_ConfigSpeedBusOperation(MMC_HandleTypeDef *hmmc, uint32_t SpeedMode);
00688 /**
00689   * @}
00690   */
00691 
00692 /** @defgroup MMC_Exported_Functions_Group4 MMC card related functions
00693   * @{
00694   */
00695 HAL_MMC_CardStateTypeDef HAL_MMC_GetCardState(MMC_HandleTypeDef *hmmc);
00696 HAL_StatusTypeDef HAL_MMC_GetCardCID(MMC_HandleTypeDef *hmmc, HAL_MMC_CardCIDTypeDef *pCID);
00697 HAL_StatusTypeDef HAL_MMC_GetCardCSD(MMC_HandleTypeDef *hmmc, HAL_MMC_CardCSDTypeDef *pCSD);
00698 HAL_StatusTypeDef HAL_MMC_GetCardInfo(MMC_HandleTypeDef *hmmc, HAL_MMC_CardInfoTypeDef *pCardInfo);
00699 HAL_StatusTypeDef HAL_MMC_GetCardExtCSD(MMC_HandleTypeDef *hmmc, uint32_t *pExtCSD, uint32_t Timeout);
00700 /**
00701   * @}
00702   */
00703 
00704 /** @defgroup MMC_Exported_Functions_Group5 Peripheral State and Errors functions
00705   * @{
00706   */
00707 HAL_MMC_StateTypeDef HAL_MMC_GetState(MMC_HandleTypeDef *hmmc);
00708 uint32_t HAL_MMC_GetError(MMC_HandleTypeDef *hmmc);
00709 /**
00710   * @}
00711   */
00712 
00713 /** @defgroup MMC_Exported_Functions_Group6 Peripheral Abort management
00714   * @{
00715   */
00716 HAL_StatusTypeDef HAL_MMC_Abort(MMC_HandleTypeDef *hmmc);
00717 HAL_StatusTypeDef HAL_MMC_Abort_IT(MMC_HandleTypeDef *hmmc);
00718 /**
00719   * @}
00720   */
00721 
00722 /** @defgroup MMC_Exported_Functions_Group7 Peripheral Erase management
00723   * @{
00724   */
00725 HAL_StatusTypeDef HAL_MMC_EraseSequence(MMC_HandleTypeDef *hmmc, uint32_t EraseType, uint32_t BlockStartAdd,
00726                                         uint32_t BlockEndAdd);
00727 HAL_StatusTypeDef HAL_MMC_Sanitize(MMC_HandleTypeDef *hmmc);
00728 HAL_StatusTypeDef HAL_MMC_ConfigSecRemovalType(MMC_HandleTypeDef *hmmc, uint32_t SRTMode);
00729 HAL_StatusTypeDef HAL_MMC_GetSupportedSecRemovalType(MMC_HandleTypeDef *hmmc, uint32_t *SupportedSRT);
00730 /**
00731   * @}
00732   */
00733 
00734 /** @defgroup MMC_Exported_Functions_Group8 Peripheral Sleep management
00735   * @{
00736   */
00737 HAL_StatusTypeDef HAL_MMC_SleepDevice(MMC_HandleTypeDef *hmmc);
00738 HAL_StatusTypeDef HAL_MMC_AwakeDevice(MMC_HandleTypeDef *hmmc);
00739 /**
00740   * @}
00741   */
00742 /* Private types -------------------------------------------------------------*/
00743 /** @defgroup MMC_Private_Types MMC Private Types
00744   * @{
00745   */
00746 
00747 /**
00748   * @}
00749   */
00750 
00751 /* Private defines -----------------------------------------------------------*/
00752 /** @defgroup MMC_Private_Defines MMC Private Defines
00753   * @{
00754   */
00755 #define MMC_EXT_CSD_DATA_SEC_SIZE_INDEX 61
00756 #define MMC_EXT_CSD_DATA_SEC_SIZE_POS   8
00757 /**
00758   * @}
00759   */
00760 
00761 /* Private variables ---------------------------------------------------------*/
00762 /** @defgroup MMC_Private_Variables MMC Private Variables
00763   * @{
00764   */
00765 
00766 /**
00767   * @}
00768   */
00769 
00770 /* Private constants ---------------------------------------------------------*/
00771 /** @defgroup MMC_Private_Constants MMC Private Constants
00772   * @{
00773   */
00774 
00775 /**
00776   * @}
00777   */
00778 
00779 /* Private macros ------------------------------------------------------------*/
00780 /** @defgroup MMC_Private_Macros MMC Private Macros
00781   * @{
00782   */
00783 
00784 /**
00785   * @}
00786   */
00787 
00788 /* Private functions prototypes ----------------------------------------------*/
00789 /** @defgroup MMC_Private_Functions_Prototypes MMC Private Functions Prototypes
00790   * @{
00791   */
00792 
00793 /**
00794   * @}
00795   */
00796 
00797 /* Private functions ---------------------------------------------------------*/
00798 /** @defgroup MMC_Private_Functions MMC Private Functions
00799   * @{
00800   */
00801 
00802 /**
00803   * @}
00804   */
00805 
00806 
00807 /**
00808   * @}
00809   */
00810 
00811 /**
00812   * @}
00813   */
00814 
00815 /**
00816   * @}
00817   */
00818 
00819 #ifdef __cplusplus
00820 }
00821 #endif
00822 
00823 
00824 #endif /* STM32H7xx_HAL_MMC_H */